MakeMyTrip | SDE 2 | Gurgaon | March 2021 {Reject}
- Result
- Rejected
- Location
- Gurgaon
- Posted
- 19 Mar 2021
Summary
I interviewed for an SDE 2 position at MakeMyTrip in Gurgaon and was rejected after the second round, primarily due to the design challenges.
How it went
I received a call from a recruiter regarding an SDE 2 opening at MakeMyTrip in Gurgaon.
First Round:
The first round focused heavily on Java. The interviewer asked about my comfort level with Java and then dove into basic questions like 'Why ismain declared as static?'. Since I mentioned using Java 8, we discussed new features such as lambdas, why they're useful, the Stream API, and collectors. I was also asked to write a program to calculate the sum of numbers in an array using Java. The interviewer was clearly a Java enthusiast!
Following the Java questions, we moved to data structures and algorithms. I was given two problems:
- Next Greater Element
- Modify an array into zig-zag order. For example, given
{19, 27, 32, 43, 5, 6}, transform it to{27, 19, 43, 5, 32, 6}.
Second Round:
This round focused more on design.- The first problem was to design a Multi-level Parking Lot, starting with Low-Level Design (LLD) and then moving to High-Level Design (HLD). We delved deep into classes and database schema, with the interviewer asking many follow-up questions. This round felt average; the interviewer seemed to be in a rush and was looking for on-the-spot solutions rather than a detailed explanation of my thought process.
- Next, I was given a problem from a cricket match scenario: '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.' This is a classic Staircase Problem variant. I explained both a recursive and a dynamic programming solution thoroughly.
- The final question was to design an LRU-LFU cache. The eviction policy was specific: first, choose the least frequently used element, but if there are multiple with the same minimum frequency, then choose the least recently used one. I explained the LLD well, but struggled a bit with the HLD, particularly the database schema. I initially thought of using multiple tables, but the interviewer later pointed out that it could be done with a single table (key, value, frequency, last accessed at).
Questions asked (8)
- 01
Java: Why `main` is static?
Other
Explain why the
mainmethod in Java is declared as static. - 02
Java 8 Features & Concepts
Other
Discuss new features introduced in Java 8, specifically focusing on lambdas (why they are used), the Stream API, and Collectors.
- 03
Sum of Array Elements in Java
Data Structures & Algorithms · Easy
Write a program in Java to calculate the sum of all numbers in an array.
- 04
Next Greater Element
Data Structures & Algorithms · Medium
Open the problemFind the next greater element for each element in an array. For example, if the input is
[4, 5, 2, 25], a possible output would be[5, 25, 25, -1]. - 05
Convert Array to Zig-Zag Pattern
Data Structures & Algorithms · Medium
Given an array of distinct elements, rearrange the elements in zig-zag fashion. That is,
arr[0] < arr[1] > arr[2] < arr[3] > arr[4] < arr[5] .... Example: Input:{19, 27, 32, 43, 5, 6}Output:{27, 19, 43, 5, 32, 6}. - 06
Design Multi-Level Parking Lot
System Design · Hard
Design a multi-level parking lot system. Focus on both Low-Level Design (LLD) covering classes and their interactions, and High-Level Design (HLD) including database schema and overall architecture. Be prepared for in-depth follow-up questions.
- 07
Cricket Score Combinations (Staircase Problem)
Data Structures & Algorithms · Easy
Open the problemIn a cricket match, a team needs to chase a given target score. Players can only score 1s or 2s. Count the total number of distinct ways in which the team can achieve the target score. (This is a variation of the classic staircase problem).
- 08
Design LRU-LFU Cache with Custom Eviction
System Design · Hard
Design an LRU-LFU cache. The eviction policy is as follows: first, choose the least frequently used element to remove. If there are multiple elements with the same minimum frequency, then choose the least recently used among them. Provide both Low-Level Design (LLD) and High-Level Design (HLD).