0% found this document useful (0 votes)
30 views12 pages

Interview Questions

The document contains a series of programming tasks, algorithms, and theoretical questions related to data structures, networking, and system programming. It covers topics such as linked lists, binary trees, semaphores, mutexes, OSPF, and various programming challenges. Additionally, it includes questions about memory management, process/thread management, and performance analysis in software development.

Uploaded by

prabhakarraoc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views12 pages

Interview Questions

The document contains a series of programming tasks, algorithms, and theoretical questions related to data structures, networking, and system programming. It covers topics such as linked lists, binary trees, semaphores, mutexes, OSPF, and various programming challenges. Additionally, it includes questions about memory management, process/thread management, and performance analysis in software development.

Uploaded by

prabhakarraoc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 12

1.

Write a program to add two numbers which are represented as linked lists

list A: 1->0->2->3
list B: 3->5

Result: 1->0->3->8
Need recursion logic

2. Write a program to print different permutations of a given set


{1, 2, 3, 4}

{1} {2} {3} {4}

{1, 2} {1, 3} {1, 4} {2, 3} {2, 4} {3, 4}


{2, 1} {3, 1} {4, 1} {3, 2} {4, 2} {4, 3}

{1, 2, 3} {1, 3, 2}, {1, 2, 4}

/*Only some permutations listed above. All permutations should be printed */

3. What is process and What is Thread


4. States of a process
5. What is a Semaphore and What is a Mutex. Differences between them
6. What is DMA
7. OSPF split brain issue
8. RIP vs OSPF
9. Write a program to find sum of all elements in a tree (some nodes have more than 1 parent)

1. There is an advertising system which calls a list of mobile numbers


which are in incremental order. If the call receiver marks it as
DO NOT CALL ME, the advertising system should not call the callee
next time. How will you implement it.

2. Try implement the above using BITMAPS

3. Write a program to provide the common parent of a given node in BST

4. When do you use threads and when do you use processes (fork())

4. #define SQRX (X) (X*X).


Is the above macro correct or does it have any problem.

5. Write a program to reverse the words in a given sentence


Input: This is a network
Output: sihT si a krowten

1. How nexthop is selected in BGP


2. How a router in Area 0 reaches a destination in another area.
What actually happens inside an ABR
3. A computer receives multiple UDP packets from different clients.
It has to receive all UDP packets, process them and send them to a
different system (which uses the info for any purpose). How do you
do it.

2. Write an algorithm/program to calculate product of two numbers without using '*' operator
3. Write an algorithm/program to make anagrams of given word.

1. Write a program to find the predecessor and successor of a node in Binary Tree

1. Write a program to combine two strings in below manner


str1 = "abcd"
str2 = "efghijk"

Result: "aebgcgdhijk"
1. What is a Semaphore and What is a Mutex. Differences between them.
2. Write the pseudo code for different operations on semaphore (P & V operations)
3. What is Virtual Memory. Limit of virtual memory on 32 bit and 64 bit
4. What is Thrashing
5. Write the code for function 'myStr' to get the below desired output

... myStr(....)
{
/* Write code */
}

int main()
{
char *str = "this is a string";

myStr(....);
printf("string = ... ", ....);
return 0;
}

Output: this is a string


6. In above program, please explain how the variables are placed in memory layout of C program

1. Sum of odd divisors of a given numbers

39 = 1, 3, 13, 39
Sum = 52

2. Longest Palindromic substring length in a given string

1. What happens if you configure priority '0' on an interface.


2. Will the session come to Full state?
3. Why do we need two stages in SPF Calculation?
4. What is the difference between pointtomultipoint and NBMA?
5. OSPF vs BGP
6. OSPF vs iBGP
7. How do you simulate HUB and SPOKE in OSPF

1. Write a program to reverse words in a sentence


Solution: https://www.geeksforgeeks.org/reverse-words-in-a-given-string/
2. How VRRP works and how does it resolves the ARP for virtual ip
3. Convert a BST into Linked List
4. ls | wc
Write a small program to implement above using pipes.
5. Output of below program snippet:

char c = 128;
printf("%d", c);
6. Size of below structure:

struct sample {
char a;
char b;
char c;
short int d;
};
7. Explain structure padding and packing. What needs to be done for less memory allocation and efficent usage of structures.
8. Explain how and where OcNOS/ZebOS is deployed on your hardware/processor. (Something related to platform)
9. How do you detect a loop in a linked list, how do you find the length of the loop and how do you break the loop.
10. What is a RAW socket. How it works
11. What are different IPC mechanisms.
12. Given a set of 20 numbers which lie between 0 and 1000. Fastest way to search whether a particular number is present in given set or not.
13. Write a sample program to find the size of a datatype on a given architecture.
14. Write a function which takes rows and columns as parameters to allocate dynamic memory to a 2D array, return the right data type/pointer and use it in main() function.
15. What is the time taken in worst case to search an element in a BST. What can be done to minimize the search time.

17. What are your strengths. Give an example for each of your strengths mentioned

1. Steps involved in packet processing


2. How many processes are created in below program:

for (i=0;i<2;i++)
fork() ;
3. char *ptr ="ABCDE" ;
Where the value ABCDE is stored in C program's memory layout.
4. What is Structure Padding. What is the size of below structure:

struct sample {
int a; Size of int is 4 bytes
double b; Size of double is 8 bytes
char c; Size of char is 1 byte
};
5. char *ptr =malloc(10)
What does ptr store? When free() is called, how it knows how many bytes has to be freed?
6. Difference between a MACRO and Inline function
7. What is the difference between exit(), abort(), assert()
8. How a system call works. What are the steps involved in it.
9. When fork() is used to create a child process, what are shared between parent and child processes?
10. How bit fields are used in a structure? What are the issues faced while using bit fields?
What precautions has to be taken while using bit fields.
11. Write a program to find max width of a Binary Tree
12. What are different IPC mechanisms.
13. Why only message queues are selected to exchange route messages in your product
14. Differences between Linux and FreeBSD
15. What are blocking and non-blocking system calls.
16. Swap two two bits in an integer.
17. Swap two nibbles in an integer.
18. Find second frequent repetitive character in a string
19. Write a program to reverse words in a sentence
Solution: https://www.geeksforgeeks.org/reverse-words-in-a-given-string/
20. Find middle location of a linked list.
21. How do you deallocate memory without using free() function.
22. How do you analyze memory corruptions
23. Using GDB to analyze Assembly code instructions
24. What are AVL trees.
25. Explain how Patricia insertion or how Patricia trie works
26. What is paging.

1. Which sorting technique you use to sort below array and why?
{1, 0, 1, 1, 0, 0, 1, 0, 0, 1}
2. How to calculate max sum in below array
{1, 2 -3, 10, -4, 6, 7, -8}
3. Write a program to find whether given Binary Tree is Binary Search Tree or not.
4. Program to identify whether a given string is Palindrome or not.

1. Longest Prefix Match and it's algorithm for Ipv6 addresses


2. What is Unix socket and what are the calls involved in it.
3. What is circular queue. How do you implement it
4. How OSPFv3 process is upgraded in a customer deployment.
5. Architecture of ZebOS
6. What are AVL Trees. What is meant by O(Log N)
7. How processes communicate each other.
8. Why lib/thread.c is not pal_ calls.
9. Why multiple threads are necessary when your product is a single threaded architecture
10. Does Windows have threads?
11. What is VPLS
12. What is Vxlan-EVPN. How does it works
13. What is VPLS
14. What is the recent performance issue you have handled

1. Tell me about your work experience


2. What is VRRP. How it works
3. How VRRP routers know that Master router is down
4. What is VRF. How data plane seperation is done in VRF
5. How software upgrade is done in customer location
6. What is ZTP. How it is implemented. Do configurations also can be pushed from server in ZTP or only software upgrade can be done
7. What model you use in NetConf. Have you implemented any NetConf stuff
8. Does data plane runs on same processor or different ones like ASIC or seperate network processor
9. What is the most recent complex issue you have worked on.
10. How protocol modules communicate
11. What happens in background when a command is issued. How a command is processed
12. What are Dockers and Containers. What are their advantages
13. How a best route is installed in RIB. What is the criteria
14. Whar are the features/enhancements you have worked on

1. Toggle a bit
2. Program to sort a given linked list (possibly with O(N) time complexity
1. What are the things you observe in output of 'top' command
2. What is Swap memory
3. Write a program or explain how do you implement priority queues using message passing between two asynchronous process
4. In IP header, checksum field is calculated for what all fields?
5. Write a python program on how to make a dictionary using two different lists without using for loop (you can use lists, map, lambda etc)
6. What is a map in Python
7. How do you implement Exception Handling in C. Write a macro and a function to handle division by '0' case.
8. Explain BGP state machine. What are different BGP packets
9. What is Binary Semaphore. Differences between Binary Semaphore and Mutex

1. Pairwise summation related program in C


2. 10 MCQ questions on snippet of program and its output

1. How ping packet travels. What are the steps involved.


2. How do you determine whether a packet is routable or not.
3. What is VLAN. How it works.
4. Write a small program to find the Nth node from tail of a linked list (without finding length of the full list)
5. How do you determine the duplicate elements in a given linked list
6. Explain what happens at each host and router.

HostA-------RTR1-------------RTR2-----------HostB
7. How does a MAC table look like. What are the fields and contents present in it.
8. Why and how do you use GDB to debug processes. How do you analyze a crash if debug logs are not available.

1. Output of below program 2. Output of below program


int a = -9; void *ptr;
unsigned int b = 6; ptr = malloc(0);
if (a+b)
printf("+ve"); 3. Why and how Volatile and Const keywords are used.
else 4. How do you delete the third element of the linked list. Pointer to NODE 3 is available. HEAD pointer is not available
printf("-ve"); 4->3->2->1->NULL Output: 4->3->1->NULL

4. How do you analyse/debug a crash using GDB.


5. What are the steps involved in developing a Feature/Enhancement in your product
6. How do you detect duplicate code or logic in entire code
7. How do you measure performance/stability of your product while adding a new feature or enhancement

1. Swap two bits of an integer Puzzles


2. Reverse all words in a sentence 1. 3 bulbs and 3 switches.
3. Toggle a bit 2. 100 coins and 7 bags
4. Size of a given structure without using sizeof()
5. Implement a stack using two queues
6. How do you implement circular queues 25. Determine Path MTU using socket programming
7. Priority inversion
8. Mulithreading
9. What are different IPC mechanisms
10 How shared memory works b/w different processes
11. How a system call works
12. How hashmap is used
13. Where do you see stack implementation in your daily work
14. What is RIP
15. What are the differences b/w OSPF and BGP.
16 Reverse bits in an integer
17. Questions on padding
18. Sockets
19. Given string = "abcdae"
Total string length = 27. So the final string is abcdaeabcdaeabcdaeabcdaeabc
Program to find how many times character 'a' apprears in total string
20. Remove a node from a linked list without having a HEAD pointer
21. Ping works at which layer. How do you perform a L2 Ping
22. What is Half Closed TCP connection
23. What is TCP Four-way handshake mechanism
24. Merge point of two linked lists

1. Explain OSPF router LSA and its fields


2. What are the enhancements you have worked on
3. Convert an integer to an IP address

1. Program to display an integer in binary format


2. Program for different operations on a stack
3. Delete a node in a linked list when head pointer is NOT given
4. Delete repeated characters in a string like below
Input - aabbccddeeaaafff
Output-abcdeaf
5. Multithread program where one thread prints ODD number and one thread prints EVEN number
6. Toggle all bits of a given number
7. Find the distinct element in the given set where all are repeating and only one element is NOT repeating.
8. What is Volatile keyword
ADDTRON
1. Dynamic binding
2.Inheritance
3. Singleton class
4. Design pattern
5. Vector, Iterator
6. Friend class
7. Abstract class
8. static member variable
9. difference between process & thread
10. what happens during processor context switch
11. Fastest IPC, why it is fastest (shared memory)
12. IPCs used in your projects, communication between processes in ur project
13. Virtual functions
14. Remove duplicates in sorted linked list
15. Result linked list from 2 intersect linked list
16. toggling kth bit in interger
17. toggling bits 2 - 5 from a given integet
18. timer implementation in SSR
19. volatile in c++
20. how ping works
21 how traceroute works
dhcp relay agent
control messages exchanged during dhcp
UDP sockets
Different type of sockets and difference between them
raw sockets how will be used
how does tcp provides reliab
how tcp provides reliable service
udp socket calls
tcp sockets used by an example application
how pppoe packet in payload got determined from ethernet frame
3 way handshake in TCP
ethernet/ppp packet formats
device a to device b arp resolution, contents of the packets exchanged
1. Brief about overall experience
2.C program memory layout
3.storage classes in c
4.what is structure padding
5.bit fields in c
6.static and dynamic libraries differences
7.what is memory leak and how do you detect
8.how do you analyse core dump
9.what is the difference between process and thread
10.what are thread system calls
11.what is fork and vfork
12.Type of IPC in Linux
13.Difference between pipes and other ipcs
14.what is the fastest IPC
15.what is race condition
16.what is deadlock
17.what is mutex
18.Difference between Mutex and Semaphore
19.Different types of Semaphores
20.Tcp connection establishment sequenCe
21.TCP connection termination sequence
22.Socket System calls for TCP server
23.what is accept system call
24.Accept is blocking or non blocking by default
25.how do you make accept as non blocking call
26.how do you handle sockets if accept is made non blocking

1.Tell me about your self


2.Tell me about your work experience Role/type of products
3.Explain how routing table is updated using OSPF protocol
4 Explain about ARP Protocol
5.what will happen if we have only switches in the internet instead of Routers.
6.How routing table is implemented.
7.write a c program to detect loop in a linked list
8.write a c program to reverse a string
9.Write a c program to reverse a sentence "he is very good" convert to "good very is he"

1.Explain OSPF state Machine


2. H1 is connected to AS1 H2 is connected to AS2.ASBR1 in AS1 is connected to ASBR2 in AS2.Explain How H1 can co
3.Explain control plane and data plane
4.Explain about Ericsson modules worked and Ericsson Router architecture
5.Explain about Zebos architecture
6.Explain about the bugs worked on Ospf and ISIS
7.Two packets with different hello interval come to router.Design the queuing system in the router to process these
8.how can we know that data has come to a socket
9.how can multiple clients can be handled in a server
10.OSPF Split brain for DR election
11.write a program with two threads where one thread forms the packet and another thread sends the packet and r

1.Explain ospf state machine


2.Differences between OSPF and BGP
3.How Routing table is implemented
4.what is port mirroring
5.what is native vlan
6.what is the processor used in router
7.Explain how packet which arrived at interface will be delivered to ospf process
8.Explain about Ethernet header fields
9.Explain some crucial bugs solved in ospf
10.process vs threads

1.Size of the structure


struct nde {
int a;
char b;
shrt c;
duble d;
char e;
}

2.Swap two variables with out using 3rd variable


3.Bubble sort program
4.Number of elements in an array using sizeof()
5.Dynamic Memory initialization for 3x4 Array
6.Count the no of set bits in a number
7.program to check the 7th bit in a number is set or not
8.Function pointer declaration syntax
9.Invoking a function using function pointer.

1.Explain about How Lacp works


2. Five Differences between OSPF,BGP,RIP
3.How can we say OSPF has faster convergence when compared to RIP
4.OSPF packet types
5.Recent OSPF fixes
6.Differences between OSPF and ISIS
7.what is administrative distance
8.Explain about TCAM
9.How FIB is updated
10.Socket system calls both at server side and client side
11.Explain about usage of select
12.write a recursive program to find the sum of digits in an integer
13.write a recursive program to find the sum of digits in two linked lists
14.write a program to find whether nth bit in a number is set or not.if the nth bit is set then reset it
15.write a program for little endian to big endian conversion
16.macro for max(a,b)
17.macro for max(a,b,c)

1.Explain about your experience


2.Explain ospf operation
3.Let me explain ospf bugs fixed
4.What are the IPC mechanisms
5.what is the difference between pipes and message queues
6.what is shared memory
7.what is a thread
8.Differences between threads and process
9.how do you synchronize shared memory
10.what is a dead lock
11.what is a socket.

1.What is the protocol used in AAA


2.what is the authentication mechanism used in AAA
3.ospf states
4.ospf packet types
5.Recent bugs solved in ospf
6.Socket System calls at server side
7.How do you handle multiple clients using sockets
8.explain the logic how to count the repeated words in a paragraph

1.Explain the design considerations for UDP application


2.Explain in detail the socket system calls at server and client side
3.what are the scenarios when RST will be sent
4.why three way handshake
5.when the server is not running what happens to the connect at client side
6.what is the port number used for ospf
7.Explain about the recent bugs in ospf
8.write a program to encode a protocol packet at sending side and decide the protocol packet at receiving side.
9.write a program to toggle the bits after nth position in a manner
10.write a program for longest prefix match

1. Differences between Thread and Process


2. What fork() system call returns to Parent Process
3. Socket system call at server side to handle multiple clients. Explain with detailed code flow
4.Macro to find maximum of a and b .
5. Reverse a string in C
6. Reverse a string in C using recursion
7. "Hello World"
Remove one space and two 'o' s in naive string
8. Explain Vrrp protocol in detail

1. Ospf packet types


2. Crucial OSPF bugs which are recently resolved
3. Questions related to AAA and PPP and Ericsson SSR infra
4. How do you debug a program
5. How do you debug a process crash
6. How do you analyze and resolve a bug.

1.how arp works


2.vlan header
3.number of vlans
4.what are the fields in the mac table
5.what happens when a switch receives unknown destination
6.differences between semaphore and mutex
7.write a program to find whether a machine is little endian or bigendian
8.logic to find the intersection point of two linked lists
9.how do you debug threads using gdb
d very is he"

S2.Explain How H1 can communicate to H2.

e router to process these packets


ad sends the packet and receives the response
ket at receiving side.

You might also like