Showing posts with label Broadcom Interview Questions. Show all posts
Showing posts with label Broadcom Interview Questions. Show all posts

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.



Thursday, January 29, 2015

Broadcom Interview Questions


First Round (Telephonic Round)
=============================
Basically question were from C, DS, and Linux. I tried to recall all questions as much I can, find the same.

0. Briefly introduce your self, and current project you are working.
1. How to check a number, whether it is power of 2 or not, in as single statement.
2. How to delete a node in linklist, when one address of that node is given.
3. How to find the nth node in linklist from back.
4. What is volatile.
5. What is mutex and semaphore, what is difference in both, is binary semaphore and mutex are same.
6. what is virtual memory.
7. Some questions from paging, what is it, how to get address.
8. How to implement sizeof operator.
9. Some basic networking question <easily you can answer.>
10. What is basic difference in hub,switch and bridge etc.
11. Some questions from project specific.

Might be some more questions, but I am not able to recall it right now.

Second Round i.e (Telephonic Round)
==================================


1. common question i.e introduce your self. 
2. Some general questions from c and os.
3. pkt flow in broadcom, l2 and l3 pkt.
4. How to debug in bcm shell.
5. Moving deeper in question 4, how to set particular register, how to track pkt drop,port hit etc, how many multicast/unicast pkt.
6. How to see particular register value in broadcom.
8. Some question from trill, how, what you did.
9. How to find how many bit set in a number.
10. How to check if particular bit set or not in a number.
11. One program he just shared at webex and he asked me to find out the defect in it. Basically in program allocating memory using
melloc and it was not freed, that was defect as per me in program.
12. L2 pket header.

Third Round i.e (Telephonic <call was from USA>)
=============================================== 

It was managerial round, there were no straight questions, 

1. Introduce your self.
2. What work you have done. 
3. Packet flow in BCM.
4. Why you are looking for change. 
5. Question related to project.
6. Some question from router, like if two host connected to router,and pinging from one host to other host <diff subnet>, what are all the configuration needed. 
7. ping pkt flow in question 6, echo request to till echo reply.
8. Then one question from function pointer. 


Fourth Round (Face-2-Face)
========================== 

1. No Introduce you self question in this round. 
2. Draw the architecture, in which you are working, i.e pkt flow in it. then there were multiple question in it. 
3. What are the defect I have worked on.
4. Some question from Broadcome, like pkt flow, l2 learning, port status, how to check counter at ports 
5. Write a program to print the positions of bit set in a given number.
6. How to define a node of linklist,
7. Write a program to delete a node in linklist, i.e node might be in last/first/middle.
8. Write a proram to reverse the linklist.
9. print the linklist element in reverser order by recursion. 

5th & 6th Round (Face-2-Face)

============================
In this round mostly puzzles.

1. You have 10 bags full of coins, in each bag are 1,000 coins.But one bag is full of forgeries, and you can't remember which one.But you do know that a genuine coins weigh 1 gram, but forgeries weigh 1.1 grams. 
To hide the fact that you can't remember which bag contains forgeries, you plan to go just once to the central weighing machine to get ONE ACCURATE weight.How can you identify the bag with the forgeries with just one weighing? 
2. A bag contains five balls numbered 1,2,3,4,5. Another bag contains six balls numbered 1,2,3,4,5,6. One ball is drawn at random from each ball. Find the probability that (i) both balls have the same number.(ii) the sum of the numbers on the balls is 9
3. Write a program to insert a node in a single linklist, (node insertion in head/middle/last)
4. He draw a pic, having 5 routers,given at all router ospf is configured, or if you needed you configured static route also, how you ping from R1 router to R5 router. 
R1 ------ R2 ----- R3 -----R5
|                  | 
----------R4------- 

There were multiple question, like which path will be chooses. routing table information, how router will know about its next hop. etc. 
5. Some C/OS/Linux basic question,
6. what is virtual memory.
7. what is the basic C structure.
8. Memory layout in c.
9. Write a program to show stack is growing. 
10. Write a program a mirror copy of a BST.
11. what is signal, Which signal can't be handle. 
12. How you detect dedlock, If you found, how you prevent it.
13. What is fragmentation, what is internal/external fragmentation.
14. What are the scheduling do you know. 
15. process v/s thead, tell me the scenario where you have used thread instead of process.
16. How you will used in thread.
17. Do you know brk() and sbrk,

7th Round (Telephonic Round)
===========================

It was final interview, and there were no more technical questions, 



2. He shared one program over webex and asked to find out the problem, so basically the program is multi thread, and deadlock condition was happening, Then he asked me, how you will prevent it. 
3. What is static variable. 
4. Write a multi thread program. where proper sync is happening. have to write at webex.
5. Do you know QoS.
6. What is vlan.
7. Do you know filtering in Broadcom. 
8. Any challenging issue you faced.

There were some more question, I am not able to recall right now.

Finally after these many round I heard that I have been selected.

I am very happy while sharing my experience with you. 

Feel free to Like Our Facebook page for more companies interview questions. CLICK --> For more fresh question being asked in various company follow us at facebook.