Showing posts with label Cavium-Network-Interview-question. Show all posts
Showing posts with label Cavium-Network-Interview-question. Show all posts

Wednesday, July 1, 2015

Cavium Network Interview Questions (F-2-F)






First Round
=========== 


1. Briefly explain about the current project and your role in it.
2. what is snmp, its process and states
3. what is CFM n SFM and its state, what are the main functionality. 4. what is vlan, and explain vlan tag.5. write a program to implement the memcpy functionality.6. what is difference in red-black tree and avl tree. In which scenario beneficent.


Second Round
1. about the project.
2. write a program to find and remove the duplicate in linklist.
3. write a program to compare the string.
5. what is the difference in pass by value and pass be reference, with example.
6. Write any program using function pointer
7. how interface vlan work .
8. what is lacp, and lacp state machine.
9. write a program to find machine is little indian or big indian.
10. byte swapping program.

Third Round
===========
1. how hash work and write a program .
2. stp state , and there were multiple questions like he given one topology and asked how stp initiate, how port role and state change.
                   host-1
                     |
            --------------------
           |                    |
         host-2----------------host-3




3. pipeline in forwarding plane.
4. one question related to L2 header 
5. tag and untagged packet.
6. now some question related to expected work, salary and about the work.




Cavium Networks Telephonic Round Interview Questions







1. Introduce yourself.
2. And briefly about the project and  role in that.
3. What is VRF.
4. What is private vlan.
5. What is lacp.
6. What happen if mtu size is set as 1200 for interface and pkt received > 1200.
15. How L2 table maintain.
16. Do you have any question?



We heartily thanks to Maynak for sharing his interview experience/question with q-4-interview.

Saturday, March 28, 2015

Cavium Network, Brocade & Broadcom Interview Questions





Kindly find below the Interview questions asked in "cavium network, Brocade, Broadcom" company. Basically I haven't remember which question asked in which company and in which round, So instead or sharing company wise and round wise, I am sharing a collection of question by topics.

We hope It will help, job seeker to crack the Interview.... 

VLAN:
=====

1. What is use for VLAN_XLATE table, How it work? Design a data structure for VLAN_XLATE table?
2. How do you stop learning per VLAN bases? Where do you apply in pipeline? 

QoS:
===

Mapping:
========

1. How mapping is work?
2. How do create Decoding and Encoding profile?
3. Is there way to modify a packet internal priority?

Police and Shape:
================

1. Were do use police?
2. Were do use shape?
2. Why police is used at ingress and what is the burst and inter packet delay will be handled by police?
3. Why shaping is used at egress, Why can't be ingress? 
4. Write algorithm for police and shape?  

Bandwidth and Shape :
=====================

1. Configure minimum guaranteed bandwidth on Queue0 70% and Queue1 30% and level 1 scheduler shape with 10%, 
    Generate both the traffic 50:50 percent from ingress, what will be the expected output?
    
LAG:
====


C:
===

1. Write a program to toggle a bit location n and m (toggle_bits(int data, int n_loc, int m_loc))?
2. Find a second largest number in array ?
3. int i = 10 and int j, which is declaration and which is definition ?
4. Add a 2 number with out using + operator ?
5. Multiply a number with 8 with out using * operator ?
6. int * ptr = 1000; char *ch = 1000; int **pptr = 1000; void *vd = 1000; ptr++, ch++, pptr++, vd++; printf("all value ") ?
7. Write a program to print range value separated(using -)and single value separated(using ,)in following format(2,4,6-9,11,)?
8. Write a program to insert_sorted_list(),delete_sorted_list(), delete_entire_list() and write program to test inset, delete and delete entire ?
9. Add a given number using program a + b ? (indirectly mean of this question handle overflow) ?
10. Define a data structure for the node should contain list, left child and right child ?
11. Define a data structure for to implement malloc ?
12. Write link list library for insert/delete ?
12. Write a program to delete a n'th node from last ?

                                   10
                                       
                              6         15
                              
                            3   8    12    18 
                            
            output:|------------------------------|    
                   |-> 3->6->8->10->12->15->18----|

  
int Add(int x, int y)
{
   int carry;
    // Iterate till there is no carry 
    while (y != 0)
    {
        // carry now contains common set bits of x and y
        carry = x & y; 

        // Sum of bits of x and y where at least one of the bits is not set
        x = x ^ y;

        // Carry is shifted by one so that adding it to x gives the required sum
        y = carry << 1;
    }
    return x;
}

int 
mask_bits(int data, int s_bit, int e_bit) 
{
  int n_mask = 0, mask = 0;
  int n = 0;
  n_mask = ((e_bit - s_bit)+1);
  n =(0x1<<n_mask);
  mask = ~((n-1) << (s_bit-1));
  data =  data & mask;
  return data;
}

23. Reverse ever alternate node in a link list. mean List: 1->2->3->4->5->6->   after reverse 2->1->4->3->6->5->
     Reverse_Alternate_Node(LIST ** head)
       {
         LIST *prev = *head;
         LIST *curr = NULL;
         LIST *to_be_link = NULL; 
         
         if(!prev) return ;
         curr = prev->next;
         
         while(curr) {
          to_be_link = curr->next;
          curr->next = prev;
          prev = to_be_link;
          to_be_link = curr->next;
          if(!prev) break;
            curr = prev->next;
          if(curr) to_be_link->next = curr;    
         }
         
         if(to_be_link) to_be_link->next = prev; 
         return ;
       }
       
24. N number of element("ab", "zb", "cd", "wx", "ab","gv","cd",..."ab", ...."cd") stored in a contagious memory. Element size is 2 byte character.
    Remove the alternate repeated elements(("ab", "zb", "cd", "wx", "--","gv","--",..."ab", ...."cd")). 
    Write an algorithm should meat time complexity O(1) and space complexity constant. 
     > Solution 1: 2 dimension array (array[26][26]) require 676 byte storage.
     > Solution 2: Use Bit-map(size = ((26*26)/8)+1; bitmap[size];) requite 85 byte storage
                    /*Bit map location is calculate with the assumption, 
                      bitmap- 0 bit is map to "aa" 26 bit is map to "ba" so on..*/
                    void
                    get_bitloc(char *str, int *array_loc, int *bit_loc)
                     {
                       /*Assume always str, array_loc and bit_loc is valid*/
                       int base = str[0] - 'a';
                       int base_bit_pos = (base*26)%8;
                       int bit_pos  = (str[1] - 'a');                       
                       *array_loc = (base*26)/8;              
                        base = base_bit_pos + bit_pos;
                       *array_loc += (base/8); 
                       *bit_loc = (base%8);
                     }
                    /*First visit a set a bit second visit unset a bit and remove the element from storage.*/
                    int remove_element(char **mem)
                        {
                           int loc = 0, bit_loc = 0;
                           int is_set = 0;
                           char *ptr[2] = *mem;
                           while(ptr) {
                             get_bitloc(ptr, &loc, &bit_loc);
                             is_set = bitmap[loc]&(0x80>>bit_loc);
                             if(is_set) { remove content in memory}
                             bitmap[loc] = bitmap[loc]^(0x80>>bit_loc);     
                             ptr++;
                           }
                        }
     
    
25. N step staircases are there where you can claim 1 or 2 step at time. How many possible way to reach you a top.
     Solution:
      > if N = 1 , Possible way(1) = 1
      > if N = 2 , Possible way(2) = (1,1) (2)
      > if N = 3 , Possible way(3) = (1,1,1) (2,1) (1,2)
      > if N = 4 , Possible way(5) = (1,1,1,1)(2,1,1) (1,2,1) (1,1,2) (2,2)
      > if N = 5 , Possible way(8) = (1,1,1,1,1) (2,1,1,1)(1,2,1,1) (1,1,2,1) (1,1,1,2) (2,2,1) (2,1,2) (1,2,2) 
      int 
      Fibonacci(int n)
       {
         if ( n == 0 )
           return 0;
         else if ( n == 1 )
           return 1;
         else
           return ( Fibonacci(n-1) + Fibonacci(n-2) );
       } 
       
       

LAG:
====
1. Different between LAG and ECMP ? Why they are configure directly connection node being LAG, why cannot ECMP?
    Directly connected routers can be connect way ecmp path, but there will be a unnecessarily reserve IP address which can be connect way L2 itself.  
2. What we need dynamic LAG, why cannot use static lag instead of dynamic LAG ? (Mean why we need LACP) ?
    Dynamic LAG is require to avoid loop between the node. 
              ____            ____
    example: |    |----------|    |
             | S1 |----------| S2 |
             |____|----------|____|
             
              In "S1" static lag is configured  and S2 normal STP is running on the port which is directly connected.  
3. 

L2 Learning packets indication to CPU:
*************************************

> Polling method  --> For station moument, first it will send add and delete call to CPU. 
> FIFO method     --> For station moument, send as updated.


We Heartily Thanks to Raja for Sharing his interview experience/questions with Q-4-Interview. 


If you would like to contribute, mail us your interview experience at "q4interview@gmail.com". We will like to publish it on "q4interview.blogspot.in" and let's help other job seekers.



Friday, January 2, 2015

Cavium Network Fresher Interview Question

Cavium Network Interview Questions
                        

          %%%%%%%%%%%%%%%%%
           % First Round %
          %%%%%%%%%%%%%%%%%


NOTE: There could be multiple correct answers for a question. And you are required to explain your answer.
1. Define the enum ABC having attributes POSITIVE, NEGATIVE, and ZERO such that the 'fun()' function prints Postive for a positive number, Negative for a negative number and Zero for 0.

#include<stdio.h>
enum ABC
{
__________      //First Line
__________      //Second Line
__________      //Third Line
};
void fun(int num)
{
      if(num<=NEGATIVE)
           printf("Its a negative number\n");
      else
      {
           if(num>=POSITIVE)
                  printf("Its a positive number\n");
           else
                  printf("Zero\n");
      }
}
int main()
{
     int i;
     scanf("%d",&i);
     fun(i);
     return 0;
}

(a)
enum{
ZERO;
POSITIVE;
NEGATIVE=-1;
};
(b)
enum{
POSITIVE=1;
ZERO=0;
NEGATIVE=-1;
};

(c)
enum{
ZERO=0
POSITIVE=1
NEGATIVE=-1;
};

(d)
enum{
POSITIVE=1;
NEGATIVE=-1;
ZERO;
};

2. What will be the output for the below program.
#define Y 10
#define X 1-(Y)
int main()
{
    int val;
    val=200*X
    printf("Value of val is %d\n",val);
    return 0;
}


3. What will be the output for the below program.
struct ABC
{
      int a;
      char b;
      void *c;
};
int main()
{
     struct ABC *obj=NULL;
     printf("%d: %d: %d: %d: %d\n",sizeof(obj->a),sizeof(obj->b),sizeof(obj->c),sizeof(obj),sizeof(struct ABC));
     return 0;
}

4. Design a data structure which can add 2 numbers in the range of 2127 to 2127-1
5. Using the data structure define above write a program which can add two numbers.
6. Using System Calls define printf function. Assume only one argument can be passed to this function.
7. Suppose you are having an instruction
sbn A,B,C
defined as
Memory[A]=Memory[A]-Memory[B]
if(Memory[A]<0)
    ProgramCounter=C.
Now, you are asked to write a code for moving the content of X to Y.
8. Does p,q and r point to the same location in belwo program.
#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;
}

9. Kindly choose for the blow program.
void fun(x)
{
    lock();
    IO_intensive();
    CPU_Intensive();
    unlock();
}
int main()
{
    fun(a);
    fun(b);
    fun(c);
    fun(d);
}

(a) Uniporcessor System will give optimal performance for this situation.
(b) Dual Core will give optimal performance for this situation.
(c) Quad Core will give optimal performance for this situation.
(d) Multicore with altered code will give optimal performance for this situation..

10. What does function 'fun' returns?
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);
}

11. 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;
}

12. Write the output for the below program.
int main()
{
    int a=0xabcdef;
    char *p;
    p=&a;
    printf("%x\n",*p);
    return 0;
}
                                 %%%%%%%%%%%%%%%%%%
                                  % Second Round %
                                 %%%%%%%%%%%%%%%%%%

1. Introduce yourself.
2. Among the subjects you read so far, which subjects you like the most.
then Why?
3. Do u have learnt Advance Operating System ? what have you learned in Advance Operating System.
4. What do you mean by Segmentation fault?How it get detected.
5. How MMU knows that the memory address being used is not in the processes range?
6. Do you know about TLB? if yes then explain it.
7. What is MMU?
8. Explain Virtual Memory.
9. Do you know execv()?
10. A code was given in which he used execv() and then asked me for the output. the code is as below.
int main()
{
    execv(".../ls",some parameters);
    printf("hello\n");
}

11. Do you like Data Structure and Algorithm?
12. Write a program to find LCA of the two nodes of a tree.
13. Write a progarm to reverse the single linklist.
14. Ask me to explain my project.
15. Do you have any question to ask?


                                 %%%%%%%%%%%%%%%%%
                                  % Third Round %
                                 %%%%%%%%%%%%%%%%%

1. Introduce yourself.
2. Ask me to introduce big endian and little endian.
3. What is the trade-off between them.
4. How to find whether a system is using little endian or big endian?
5. Is it possible to install 32 bit OS on IA64?
6. A PC with IA64, 32 bit OS will not be able to access the entire RAM(in some cases). Is it possible to access entire RAM. If yes, how?
7. Explain the concept of DMA.
8. Can DMA be in deadlock?
9. Do you have any question to ask?


                                 %%%%%%%%%%%%%%%%%%%%%%%
                                  % Fourth Round (HR) %
                                 %%%%%%%%%%%%%%%%%%%%%%%


1. Introduce yourself.
2. Asked me about the interview, how was each round
3. Do you ever had a fight?
4. From which place do u belong?
5. Given a choice to move to north (I am from UP). Will you move to north.
There were some more normal HR questions.








Tuesday, December 23, 2014

Cavium Network Interview Questions

Cavium Network Interview Questions
Cavium Network Interview Questions
++++++++++++++++++++++++++++++++++

1. What is offset of() macro will work?? will it consider padding ??...

2. Swap the Bit's from x location to y location..!!!
3. Write a function which takes arguments such as bitwise swap, word wise swap, bitwise swap and completes the same
4. How to determine the Big-endian and Little-Endian of machine??
5. Please describe regarding the structure padding and how the __attribute__((packed)) works to remove the structure padding
6. How do you determine the linked list got a circular loop within the list?
7. Reverse the linked list both Recursive and Iterative way.
8. What are the boot stages involved with the boot up of Linux. Why the MMU is initialized two times instead of single??
9. How will the primary boot loader detect the MMC card without any driver, exactly how it will know the format of the disc to read the MBR
10. Why there is a Two stage boot loader instead of simple Single Boot stage process
11. What is the High-Mem and how it is useful in Linux
12. Position Independent and Position Dependent code in Linux?? Do you mean that standard shared libraries can also be made position Independent Code while compiling??
13. Structure padding was also called as holes...!! Can you access them with your normal pointer??
14. What are differences in typedef and
#define?
15. How the DMA coherency is achieved?? Will it need the CPU to come into picture to flush the data to disk??
16. How do you know that your DMA Engine is capable of the scatter-gather??? Can you implement if it not capable??
17. Debugging the pthreads with GDB how?? Can we pause/suspend/kill a thread??
18. What is the dynamic debugging in Linux kernel??? Do you know kgdb??

>-------------------> Hit/Like/Share >------------------------>

For more questions follow/Like.


CLICK --> For more fresh question being asked in various company follow us at facebook. 

Sunday, November 2, 2014

Cavium Network Telephonic Interview Questions



Cavium Network Telephonic Interview Questions
+++++++++++++++++++++++++++++++++++++++++++++

 


Cavium Network Interview
  1. Briefly tell me about yourself.
    ok .. moving forward.
  2. What is vlan, use of it.
  3. Can a port can be part of multiple vlan, if so then how it differentiate what type of vlan pkt has been received.
  4. If a port is part of vlan 100 and if at that port one untagged, one vlan 100 pkt and one other vlan pkt (i.e vlan 200 pkt) recived. what will happen with all the three pkt.
  5. What happen when a pkt reached to switch, what are the area hit. what will happen if it miss the mac lookup.
  6. How we differentiate pkt is tagged or not. format of L2 header.
  7. what is IGMP snooping.
  8. What type of data structure used in your project, and you worked.
  9. What is Red Black Tree, why we go for red black tree, ok do you know, how insertion and deletion take place in it.
 10. Then question from red Black tree... why we go for rotation,why we used colors in it. 

 11. What is Complexity of Red Black Tree. what is complexity of BST.
  12. what are different way to traversing the binary tree.
then postorder ... preorder then inorder in detail.
 13. Do you know prefix, postfix.
  14. can you convert the ((a+b)*c-d) for above. 



  CLICK --> For more fresh question being asked in various company follow us at facebook.