:: Share Your Experience And Make People Share Like You ::

Tuesday 10 March 2015

Cavium Networks Interview Experience

Written Test:

1: c basics-enum,pointers
2: system calls (using system calls for printf write a small funtion)
3: #include<stdlib.h>
    #include<stdio.h>
    int main()
    {
     int *p,*q,*r;
     p=malloc(sizeof(int));
     free(p);
     q=malloc(sizeof(int));
     free(q);
     r=malloc(sizeof(int));
     return 0;
    }
    Does p,q and r point to the same location?

4: typedef struct tree* NODE
    struct tree
    {
     int info;
     struct tree *leftMostSibling,*rightSibling;
   };
  int fun(NODE root)
  {
    int value=0;
    if(root)
    {
        value=1;
        value=value+fun(root->leftMostSibling);
        value=value+fun(root->rightSibling);
    }
    return(value);
  }
 What does function 'fun' returns?

5:What is the output of the program given below?
   #include<stdio.h>
   void fun(int *p)
    {
     p=malloc(sizeof(int));
    }
   int main()
   {
     int *p=NULL;
     fun(p);
     if(p)
         printf("p is not null");
     else
         printf("null");
    return 0;
   }

6: little endian,big endian
    int main()
    {
     int a=0xabcdef;
     char *p;
     p=&a;
     printf("%x\n",*p);
     return 0;
    } 
   What is the output?

Technical round 1:
  • Introduce yourself
  • Operating system concepts like paging,virtual memory, memory management unit,system calls,fork(),exec
  • discussion on written paper.
  • C concepts like pointers, function pointers, program address space, malloc,little endian, big endian
Technical round 2:
  • Data structures
  • Linked list and trees
  • Boot strap process
Technical round 3:
  • bit wise manipulations in c
Source: Bhavana Atchutuni(M.Tech(CS))

No comments:

Post a Comment