Interview Qns
Interview Qns
Interview Qns
CommVault:
1. Merge two sorted linked list.
2. Reverse of string.
3. Binary vs BST (use case + complexity)
4. With inorder sequence can build preorder?
5. How Insertion sort work in linked list?
6. Static vs extern
7. Binary search working.
8. 2 hour debugging round (compilation + logical errors)
9. 9h coding round.
Arista:
—------
Round 1
- Given a number n, convert it to binary and do nibble swap for every byte from MSB to LSB.
Ex: 1101 0001 101 -> 0001 1101 101
- Print/count all the substrings of a given string.
Round 2
- Interviewer had a set of c programs, he showed the programs one by one and asked to
find/fix any bugs in it.
Mostly related to C malloc, free, pointer arithmetic, const char *c, pass by value/reference,
structure padding..
- System design related questions:
Started with basic server-client architecture and built questions on top of that like..
How request and response is handled?\
how will you generate the task ID's?
How to handle more no. of requests?
Synchronous and asynchronous requests
what data structures will you use for request handling and response handling, time
complexities for those...
—---------
VMware:
1. First non repeating character in string
2. K th smallest element in BST
3. Meeting room problem
4. Name of some scheduling algos
5. Mutex vs semaphore
6. Process vs thread
7. Virtual memory working
8. Malloc call in infinite loop (when it will stop ?
9. Producer Consumer Problem - spin lock, mutex, semaphore
10. Wait and signal related questions
11. Binary Tree - Inorder traversal to Doubly Linked List
12. Sort array - increasing and decreasing order alternatively
13. Mmap for files
14. How GDB works internally
15. How malloc and free works internally
16. Merge 2 sorted linked list
17. Write program to check if one person can attend all meetings scheduled in a day
18. Review given code
19. Memory layout in C
—---------
Round 1
- Project discussion
- standard leetcode 3Sum question, built more questions based on this.
Round 2
- Project discussion
- OS questions - mutex and binary semaphore; lock and spin_lock; scheduling algo.,
- FS concepts - VFS, file open/read/write.., Inode, I/O layout in linux,
- User space and kernel space, virtual memory..
- System calls, brk(), sbrk(), mmap()..
- C Bitwise questions
Check number if power of 2
Reverse the bits in a number
Given 2 numbers A and B, A has more bits the B. Given two int i and j, copy the bits from B
to A at index i to j.
Round 3
- Project discussion
- NAS ans SAN concepts, file/block storage..
- Memory management in kernel space
- malloc vs calloc
- Print 1 to 100 from 2 threads, 1 thread should print odd and other should print even.
Round 4
- In-depth project discussion - Asked about all things written in the resume.
- Software development and release cycle at huawei
- Explain any complex feature developed
- Explain any design/feature changes and how you adapted to it
- How the product is tested?/ What's the test setup?
- Asked for any questions I have..
—-------
Round 1:
1) About Migration Project , what is my role and responsibilites
2) Given an 2d array first element in each row is requester id and second element
in each row is accepter id, FInd the person who is having maximum friends
Solution : Need to find the max frequency of id , assuming each reuqest goit accepted
3) what is process and thread and what is the differnce and what are shared common and
what are not?
4) How do you avoid corrption of data if mulitple threads works on same address space
5) What is Mutex?
6) What is Semaphore?
7) Mutex vs Semaphore
8) Mutex vs Spinlock
9) what are the different states of a process and how scheduling of a process is done?
10) What are the different scheduling algorithms ?
what are the pros and cons ? what kind of datastructures are useful?
Round2:
1) what is the work you have done that you feel proud of and please explain thoroughly?
2) Given twop array one is the entry array and other is the exit array.
The each index in entry array will tell when the job starts and corresponing index in
exit array tells when trhe job is completed. FInd the minimum number of vms required to
complete all the jobs ?
further complication:
when client4 comes if busy wait untill the offset is freed once freed,
starting doing i/o on the offset.
—----------------
EdgeQ: (startup)
1. Merge two sorted linked list
2. 3 rd largest element from array
3. Fun overloading vs overriding
4. One sorting algo working (with time comlexity)
5. Pointers manipulation questions
6. Insert the node in sorted linked list (cover all scenarios)
7. Decimal to binary
Qualcomm:
HPE:
1. Write a program to find Endianess
2. Write a program to convert little to Big Endian & vice versa
3. Write a program to remove all spaces in the given string.
4. How to achieve process synchronization - spin lock, mutex and semaphore
explanation
5. Structure padding - pragma pack
6. Write a program to count the number of Set Bits
7. Write a program to count the number of unset bits
TeraData:
Unisys:
1. Swap odd and even bits in given integer
2. Reverse k group of nodes in given linked list
3. Write a function to get kth node, maintain group Previous and group Next, reverse
the group, go to next group, continue until kth node is NULL.
4. Semaphore and Mutex
5. What happens when you run an executable?
6. Linking - Static and Dynamic
7. What is virtual memory?
8. What is shared memory?
9. Most challenging task faced in the project
10. Agile SDLC
11. Explain the project
12. Check if given value in Linked List is repeated atleast twice and Delete the last
occurrence of it.
NGX: (startup)
1. Convert Binary represented in linked list to a decimal value given that head is
pointing to MSB.
2. Swap linked list nodes in pairs
3. Semaphore and Mutex
4. What is Deduplication
5. Automation of test scenarios
6. Write generic testcase and specific testcase to test the program written
IBM: