I got a call from Recruiter for SDE 2 opening for one of the team in MMT at Gurgaon location.
First round:
- Asked how much I am comfortable in Java. Asked few basic questions i.e. Why main is declared as static.
- Asked which version I have been using for Java. I said Java 8. (Honestly I only use Java for DS Algo, and don't give a damn what's the version I am using, but anyway.). So Typical Java 8 questions - New features in java 8, lambda, why lambda, what is stream api, what is collector, asked to write a program for calculating the sum of the numbers of an array in java. Interviewer was Java geek. Really.
- Next greater element.
- Modify array into zig zag order. {19,27,32,43,5,6} ==> 27 19 43 5 32 6.
Were able to do both questions easily hence proceeded for next round.
Second round:
- Design Multi level Parking lot, First LLD then HLD. In depth, asked follow up questions for classes and DB scema. This went average. Interviewer seemed like in rush. While I was building the solution and explaining before writing things. He was looking for solution on the spot. This went average.
- In a cricket match, Given a target to chase, while you can score only 1s or 2s. Count how many ways are there with which you can chase the target. (Stair case problem). Explained well with recursive as well as DP solution.
- Design LRU LFU cache. Eviction policy - First choose the least frequently used element to move out, but if there are many then choose least recently used one. LLD + HLD Both. Explained well for LLD, for HLD, Couldn't explain clearly db schema. I was going with multiple Tables. While it was possible in one table (key, value, frequency, last accessed at) as interviewer mentioned in the end.
HR informed me rejected after second round for design.