Round 1:
Coding round: 3 questions, 90 mins:
Ques 1) Given k, n, m. where k is no. of coconuts you initially have. n is the some no. such that if you have ≥ n coconuts, you become stressed otherwise you become normal. m is the no. of shops. You go from 1st shop to mth shop without skipping any shop. At ith shop, either you buy Si coconuts or sell Si coconuts. If you are stressed then you must become normal at the next shop. If you have less than Si coconuts and you want to sell then you must sell all the coconuts you have. The task is to calculate maximum possible changes of your mood from stressed to normal or vice-versa. My solution: Used DP.
Ques 2) You have n nodes and m edges with their weights given. If no edge is given from ith node to jth node, you should assume there an edge with weight = 1. You have to calculate the min cost of path from node 1 to node n. My solution: Could be done by Dijkstra, but Floyd Warshall was working for all test-cases hence saved my time by using Floyd Warshall.
There was one more question.
Apti Round: 45 questions, 50 mins.
1st Face to Face Interview:
Ques 1) Asked how you solved the coding questions. When I came on Dijkstra, It was a complete discussion on its algorithm and Time Complexity.
Ques 2) A brief on my projects.
Ques 3) OOPs-Inheritance, Polymorphism, Abstraction.
Ques 4) Discussed Hashing
Ques 5) A problem on Spoj is encrypted using substituting cipher(substituted an English alphabet with another English alphabet). All spaces and punctuation marks are deleted. How will you get the original problem statement?
Ques 6) Discussed Heap
Ques 7) Find 2nd largest element in a given array using min. no. of comparisons. I told him solution with 2n comparisons, but he kept insisting me to think more and reduce the comparisons.
2nd Face to Face Interview:
Ques 1) 1 question on a linked list
Ques 2) Sum tree
Ques 3) How to synchronize 2 threads, one which is downloading contents of a site while loading the website and another UI based thread which is showing the percentage completeness. Without using Java Synchronization concept.
Ques 4) Discussed on sync on Dropbox. You are uploading something on Dropbox. Suddenly network connection is lost. After that, you have modified file and then the network is connected. What should you code on Client-side to resume it instead of restarting? It can be the case that the part of file that was uploaded is modified and you should resend the modified one.
3rd Face to Face Interview: (With Director)
Ques 1) An array is given of size m. First n elements (n < m) are filled and rest contains junk. Write code for linear search to find an element x in first n elements. There would be 2 comparisons per iteration: (i < n) in for loop and (arr[i]==x). You have to reduce the no. of comparisons to 1 comparison/iteration.
My solution for question:
arr[n]=x;
for(int i=0;;i++) if(arr[i]==x) break;
if (i < n) return i;
else return -1;
Ques 2) A two-balls question on trigonometry.
Ques 3) Two balls with same weight and same diameter are there. One is solid and other is hollow. Distinguish between them.
Ques 4) Archimedes principle.
Ques 5) Why Mirage happens.
Ques 6) Explain concept of TIR(Total Internal Reflection).
HR Round:
Think of a real-life society problem and think of some innovative technology you can build to solve that.
All the interviewers were very friendly. Hindi was permitted except HR Round. It was an enjoyable experience.
Thanks for Reading
Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies. Learn more at Placewit . Follow us on Instagram and Facebook for daily learning.