There was recently an opening at MakeMyTrip. I found it through LinkedIn
I just applied. I didn't really expect to be shortlisted since I have applied to so many companies and didn't really hear back from any of them
A week later, HR called me and asked me if I'm ready for an interview. I gladly accepted and was told there would be three rounds
Round 1 - DSA + Few HLD and Java questions
Question 1 - You are given a method which you need to complete. You need to return the closest manager common to two employees
public Emp getCommonManager(Emp e1, Emp e2) {
// Write your solution
}You can design the Emp class however you like. But given two employees, you need to find the closest manager common to both of them
Question 2 - Given an array, find any subarray which has a sum of 0
I was able to solve both of them. Although I did make a few mistakes. When interviewer pointed it out, I was able to rectify immediately
The interviewer was kind and collaborative but also firm
I was asked a few more questions
I gave decent answers to all and the interviewer felt satisfied
First round wasn't flawless, but overall it was really good for me
Round 2
I was told it would be a LLD round. But instead I was asked one LLD and one HLD problem
I was taken aback
Question 1 - Implement builder pattern in a thread safe way (LLD)
I implemented the builder pattern. I also added locks (synchronized) where necessary. But the interviewer wasn't satisfied as synchronized is blocking in nature. He was expecting solution around Atomic variables
And also while I implemented the buider pattern, I was asked to create two threads and run my program too
I coded it all in an online IDE. But I made really silly mistakes when it came to static methods and static classes. And I was stuck for sometime. I think I should've used an offline IDE like eclipse, it could've suggested me some fixes
It left a bad mark on me because stuff like static is really trivial. But sometimes we forget trivial things and I felt really bad about it
The interviewer said maybe we can proceed with the next question
Question 2 - Shorten URL from a long URL for a MakeMyTrip booking
A user makes a makemytrip booking. You need to generate a long url. You should then convert it to a much shortened url form and ensure that only that user can access it. The short url accessed by others is not authorized
I had read about TinyURL system design question a while back. This was a variant of it as we also need to generate the long url
I gave the solution and I also explained about sessions and how we can ensure proper authentication
The interviewer was satisfied. I asked for feedback from the interviewer. I was told my HLD is good, but my LLD was not upto the mark :(
I haven't heard back from them in a while. So I'm guessing I'm rejected :(
Overall it was a very nice experience, the interviewers were nice. I could've surely done better, but this was also my first interview in four years since college. But it still hurt