MakeMyTrip interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

MakeMyTrip
upvote
share-icon
3 rounds | 9 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 5 months
Topics: Data Structures, Algorithms, System Design, Aptitude, OOPS
Tip
Tip

Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.

Application process
Where: Other
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.

Interview rounds

01
Round
Easy
Coding Test - Pen and paper
Duration65 minutes
Interview date10 Apr 2015
Coding problem5

This was a written test round with questions based on data structures and algorithms.

1. Count Distinct Elements In Every Window

Moderate
15m average time
85% success
0/80
Asked in companies
AmazonHSBCZS

Given an array of integers ‘arr’ of size ‘n’ and an integer ‘k’. You need to find the count of distinct elements in every sub-array of size ‘k’ in the given array. Return an integer array ‘count’ that consists of n - k + 1 integers where ‘count[i]’ is equal to the number of distinct elements in a sub-array of size ‘k’ starting from index ‘i’.

Note:
1. The sub-array of an array is a continuous part of the array.
2. Consider ‘0’ based indexing.
3. ‘k’ will always be less than or equal to ‘n’.
3. Don’t print anything, just return the integer array ‘count’.
Problem approach

To solve the question in time complexity less than O(n), divide and conquer approach can be used.
Approach : 
1. Check the first and last element of the sorted sequence.
2. If both are equal, the only element in the sequence is the first (only one unique element in the entire sequence).
3. Else, if the are different, divide the sequence and repeat for each subsequence.
Average case time complexity : O(log n)
Worst case time complexity : O(n) when all elements are different

Try solving now

2. Occurrence Of Each Word

Easy
10m average time
90% success
0/40
Asked in companies
HCL TechnologiesAmazonMakeMyTrip

You are given a string S of words. Your task is to count the occurrence of each word present in the string S. A word is a sequence of one or more non-space characters, and there can be multiple spaces between two words, and also there can be leading or trailing spaces in a string S.

For Example:
For the given string  “what we think we become”

“what”,” think”, and “become” occurs 1 time, and “we” occurs 2 times in the given string.
Problem approach

Hashing can be used to solve this problem. 
Use a hash map data structure to store the occurrence of each word in the string.
Traverse the string and for each element, check whether it is present in the map or not. If it is present, then update the frequency of the current word else insert the word with frequency 1.
Traverse in the map and print the frequency of each word.

Try solving now

3. Reverse Words In A String

Easy
10m average time
90% success
0/40
Asked in companies
UnacademyIBMOptum

You are given a string 'str' of length 'N'.


Your task is to reverse the original string word by word.


There can be multiple spaces between two words and there can be leading or trailing spaces but in the output reversed string you need to put a single space between two words, and your reversed string should not contain leading or trailing spaces.


Example :
If the given input string is "Welcome to Coding Ninjas", then you should return "Ninjas Coding to Welcome" as the reversed string has only a single space between two words and there is no leading or trailing space.
Problem approach

Steps : 
1. Reverse the individual words of the given string one by one. 
2. Then, reverse the whole string from start to end to get the desired output.
Time Complexity : O(n)

Try solving now
Hard
0/120
Asked in companies
MakeMyTripMicrosoftAmazon

For a given two-dimensional integer array/list of size (N x M), print it in a spiral form. That is, you need to print in the order followed for every iteration:

a. First row(left to right)
b. Last column(top to bottom)
c. Last row(right to left)
d. First column(bottom to top)

 Mind that every element will be printed only once.

Refer to the Image:

Spiral path of a matrix

Try solving now

5. Technical Question

What data structures will you use to design a garbage collector?

Problem approach

Linked lists and sorted trees (heaps, b-trees etc), arrays (or tables) of pointers and arrays(or tables) of counts can all be considered for use in the garbage collector.

02
Round
Medium
Face to Face
Duration60 minutes
Interview date10 Apr 2015
Coding problem3

This round had questions more around various technology stacks : Design Patterns ( Interceptor, Singleton, Publisher Subscriber, MVC etc etc ) , UI Templates , REST , Spring , Java , In memory database and Log appenders.

1. Generate all parenthesis

Moderate
30m average time
85% success
0/80
Asked in companies
FacebookExpedia GroupLinkedIn

You are given an integer 'N', your task is to generate all combinations of well-formed parenthesis having ‘N’ pairs.


A parenthesis is called well-formed if it is balanced i.e. each left parenthesis has a matching right parenthesis and the matched pairs are well nested.


For Example:

For ‘N’ = 3,
All possible combinations are: 
((()))
(()())
(())()
()(())
()()()
Problem approach

The question can be solved using a backtracking approach. Use two integers to count the remaining left parenthesis (n) and the right parenthesis (m) to be added. At each function call add a left parenthesis if n >0 and add a right parenthesis if m>n. Append the result and terminate recursive calls when both m and n are zero.
Steps :
1. Create a backtrack function that updates the current string if open_brackets are less than n or close_bracket are less than open_bracket
2. When the length of current string becomes equal to 2*n , add it to the combination result array.

Try solving now

2. Reverse List In K Groups

Hard
15m average time
85% success
0/120
Asked in companies
SAP LabsSamsungIBM

You are given a linked list of 'n' nodes and an integer 'k', where 'k' is less than or equal to 'n'.


Your task is to reverse the order of each group of 'k' consecutive nodes, if 'n' is not divisible by 'k', then the last group of nodes should remain unchanged.


For example, if the linked list is 1->2->3->4->5, and 'k' is 3, we have to reverse the first three elements, and leave the last two elements unchanged. Thus, the final linked list being 3->2->1->4->5.


Implement a function that performs this reversal, and returns the head of the modified linked list.


Example:
Input: 'list' = [1, 2, 3, 4], 'k' = 2

Output: 2 1 4 3

Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.


Note:
All the node values will be distinct.


Problem approach

Recursion can be used to solve this problem. We reverse every group of k linked list nodes and attach it to the previous group. 
Steps :
1) The first step is to check whether the Head is NULL or Not, if its NULL then we can directly return NULL,
2) If the Head is not NULL, then we need to check the length of Linked List starting from current Head.
3) If the length is less than k , then there is no need to reverse it and hence we can directly return head,
4) Else if its a multiple of K, then we have to reverse the K elements starting from current Head. While reversing keep track of the next node and previous node. 
5) We will follow the same steps for the rest of the elements Recursively and link the two sub-lists. 
Time Complexity : O(n)
Auxiliary Space : O(n/k)

Try solving now

3. Intersection of Linked List

Easy
25m average time
73% success
0/40
Asked in companies
Hewlett Packard EnterpriseSamsungIntuit

You are given two Singly Linked Lists of integers, which may have an intersection point.

Your task is to return the first intersection node. If there is no intersection, return NULL.


Example:-
The Linked Lists, where a1, a2, c1, c2, c3 is the first linked list and b1, b2, b3, c1, c2, c3 is the second linked list, merging at node c1.

alt.txt

Problem approach

Steps :
• Calculate number of nodes in the first list, let it be c1.
• Calculate number of nodes in the second list, let it be c2.
• Take the difference of counts d = abs(c1 – c2)
• Now traverse the bigger list from the first node till d nodes so that from here onwards both the lists have equal no of nodes
• Then, Traverse both the lists in parallel till you come across a common node.

Try solving now
03
Round
Easy
HR Round
Duration30 minutes
Interview date10 Apr 2015
Coding problem1

HR round with typical behavioral problems.

1. Basic HR Questions

1. Why do you want to join MakeMyTrip ?
2. What are your career aspirations?
3. How do you think it aligns with MMT?

Problem approach

Tip 1 : The cross questioning can go intense some time, think before you speak.
Tip 2 : Be open minded and answer whatever you are thinking, in these rounds I feel it is important to have opinion.
Tip 3 : Context of questions can be switched, pay attention to the details. It is okay to ask questions in these round, like what are the projects currently the company is investing, which team you are mentoring. How all is the work environment etc.
Tip 4 : Since everybody in the interview panel is from tech background, here too you can expect some technical questions. No coding in most of the cases but some discussions over the design can surely happen.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by MakeMyTrip
1176 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 13 problems
Interviewed by MakeMyTrip
1443 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by MakeMyTrip
849 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by MakeMyTrip
701 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
114579 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
57825 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
34961 views
7 comments
0 upvotes