Platform: CoCubes Format: 3 coding questions Time: 75 minutes
They had a pool of questions and three questions(2 + 3 + 5 marks) were given to each student randomly.
- Given an array A of size m and another array B of size n. Return the product of maximum of A and minimum of B. (2 marks)
- Given an integer N and an integer M, output a number closest to N which is divisible by M. (2 marks)
Input: N = 15, M = 7 => Output: 14 Input : N = 17, M = 3 => Output : 18
- Given a string containing or ‘|’ , and ‘&’ and xor ‘^’ in between binary bits 1 or 0. Return the output.Evaluation is from left to right.
Eg. 1^1|1&0^1, answer is 1.
- You are given two increasingly sorted linked lists. Return the head pointer of a linked list containing elements of the two linked lists sorted in descending order. Only use constant extra space
- Given a binary tree. Find the deepest left leaf node (deepest leaf node that is left child of its parent). If there are two such nodes, return the maximum among them. (5 marks) https://www.geeksforgeeks.org/deepest-left-leaf-node-in-a-binary-tree/
- Longest increasing subsequence. (5 marks) https://www.geeksforgeeks.org/longest-increasing-subsequence/
The fly round was about 60 minutes
- Given an N-ary tree. Add a new member next pointer to every node in the tree. Connect nodes at same level. Example of binary is given below but we were asked to solve for N. https://www.geeksforgeeks.org/connect-nodes-at-same-level/
- Given a list of contacts which exist in a phone directory. The task is to implement search query for the phone directory. https://www.geeksforgeeks.org/implement-a-phone-directory/
- Write the test cases for File Transfer ?
We have to write the answers and code in paper. The first question was to test our Coding skills, second one for data structure design and third was for debugging.
I had 3 interviews, in each one of them they asked me to write code on paper.
- Two nodes of a BST are swapped, correct the BST.
- Given only a pointer/reference to a node to be deleted in a singly linked list, how do you delete it?
- Question on your CV. I have done one project using OOP concepts, so he asked me about it.
- LRU cache.
- Matrix chain multiplication https://www.geeksforgeeks.org/dynamic-programming-set-8-matrix-chain-multiplication/
- Printing brackets in Matrix Chain Multiplication Problem https://www.geeksforgeeks.org/printing-brackets-matrix-chain-multiplication-problem/
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Related Practice Problems
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course. In case you are prepared, test your skills using TCS, Wipro, Amazon and Microsoft Test Serieses.