5 DERECHA

Arista Networks 면접대비 본문

Interview

Arista Networks 면접대비

kay30 2023. 12. 5. 08:04

기출 문제 인터넷에 있는거 정리

1. OS related questions, Questions related to my current job, memory management, a simple coding question with two 193.pointed approach to solve.

2. Knowledge of standard data structures like Arrays, Linked Lists, Trees, Tries, Hash tables etc.

3. implementing and utilizing linked lists for dynamic data structures

4. basic questions on layer 2 and layer 3 protocols and as well as on Tcp/IP

5. String manipulation, pointers, sliding window technique

6. Reverse a doubly linked list, add two linked lits, delete from doubly linked list.

7. Leetcode topics were DP and string manipulation

8. BST, Array sort and find lost element, String manipulation

9. Question about bit shifting for signed and unsigned bytes.

10. Questions relates to linked list OOPs

11. Q: Count distinct elements in every window of size k (sliding window)

12. Debug a problem and write a function to delete successive nodes of a linked list.

13. Binary search , tree, bit manipulation , trie etc

14. design a software OS

15. Question on pointer vs reference value and then a binary tree design question.

16. The question was to design Stack API and requirements are not given.

17. Homogenous/ Heterogenous Hold data vs. hold only pointers and the caller will handle the actual data allocation discussed tradeoffs.

18. Describe two possible ways of implementation using dynamic arrays vs. linked lists and describe the tradeoff.

+) Linkedlist approach is better. How can you remove pointer overhead ?
https://www.glassdoor.com/Interview/Arista-Networks-Interview-Questions-E295128_P3.htm?sort.sortType=RD&sort.ascending=false

	      Eg. 1 )
          int main(int argc , char *argv[])
           {
               printf("%c",**++argv);
           }

          Eg. 2)

          int *x[N];
          x=(int(*)[N])malloc(M*sizeof(*x));
          printf("%d %d",sizeof(x),sizeof(*x));

          Eg 3) Asked significance of return statement in C. 
                What does '0' in return(0) means.

          Eg 4) Some questions based on pointing out errors in program 
               (eg. modifying read only string , concepts of constant 
                pointer to string )

          Eg 5) 10000 students are there and each student has one bit 
                data. how can you     modify his data in O(1) time .

          Eg 6 ) Structure Padding details .

          Eg 7) https://www.geeksforgeeks.org/struct-hack/
#include <stdio.h>
#include <stdlib.h>

#define N 5
#define M 10

int main() {
    // Correct declaration: x is a pointer to an array of integers
    int (*x)[N];
    
    // Correct declaration: y is an array of pointers to integers
    int *y[M];

    // Allocate memory for M rows, each row having N integers
    x = (int(*)[N])malloc(M * sizeof(*x));

    if (x == NULL) {
        fprintf(stderr, "Memory allocation failed\n");
        return 1; // Exit with an error code
    }

    // Allocate memory for M pointers to integers
    for (int i = 0; i < M; i++) {
        y[i] = (int *)malloc(N * sizeof(int));
        if (y[i] == NULL) {
            fprintf(stderr, "Memory allocation failed for y[%d]\n", i);
            // Release previously allocated memory for x
            free(x);
            return 1; // Exit with an error code
        }
    }

    printf("%lu %lu %lu %lu", sizeof(x), sizeof(*x), sizeof(y), sizeof(*y));

    // Don't forget to free the allocated memory
    for (int i = 0; i < M; i++) {
        free(y[i]);
    }
    free(x);

    return 0;
}

 

* 정리 *

1) Valid Sudoku / Reorder-list

2) Array & linked list

3) OOP

4) C++ module5(try-catch), 7(template)

5) Stack api구현 

'Interview' 카테고리의 다른 글

Network  (0) 2024.02.09
leetcode 영어 인터뷰 준비  (0) 2023.11.12
Neetcode problem 및 유형별 문제들 정리  (0) 2023.08.15