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

SDE - Intern

MakeMyTrip
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Journey
I started preparation from my first year of the college itself. Then i started practicing the DSA at the regular basic from the coding Ninjas platform CodeStudio
Application story
This is a on-campus opportunity this company visited our campus for the selection where i have applied
Why selected/rejected for the role?
I was rejected for this role because I am not able to give a optimize solution for my one of the questions
Preparation
Duration: 4 Months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming, System Design
Tip
Tip

Tip 1 : Practice at Atleast 250 Questions
Tip 2 : Ex- Do at least 2 projects

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

Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.

Interview rounds

01
Round
Hard
Face to Face
Duration60 Minutes
Interview date13 Oct 2022
Coding problem2

1. Remove Duplicates

Easy
15m average time
80% success
0/40
Asked in companies
PayPalSAP LabsMakeMyTrip

Ninja is playing with numbers but hates when he gets duplicate numbers. Ninja is provided an array, and he wants to remove all duplicate elements and return the array, but he has to maintain the order in which the elements were supplied to him.

Problem approach

I simply gave the interviewer a hashing based approach and made changes in the original string and he was pretty much satisfied by my approach.

Try solving now

2. Word Search - l

Moderate
30m average time
60% success
0/80
Asked in companies
Morgan StanleyShareChatSprinklr

You are given a 2D board('N' rows and 'M' columns) of characters and a string 'word'.


Your task is to return true if the given word exists in the grid, else return false. The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring.


Note:
The same letter cell should not be used more than once.
For Example:
For a given word “design” and the given 2D board 
[[q’, ‘v’, ‘m’, ‘h’],
 [‘d’, ‘e’, ‘s’, ‘i’],
 [‘d’, ‘g’, ‘f’, ‘g’],
 [‘e’, ‘c’, ‘p’, ‘n’]]

The word design can be formed by sequentially adjacent cells as shown by the highlighted color in the 2nd row and last column.

board

Try solving now
02
Round
Easy
Face to Face
Duration60 Minutes
Interview date13 Oct 2022
Coding problem2

1. Validate Binary Tree Nodes

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

You are given ‘N’ binary tree nodes numbered from 0 to N - 1 where node ‘i’ has two children LEFT_CHILD[i] and RIGHT_CODE[i]. Return ‘True’ if and only if all the given nodes form exactly one valid binary tree. If node ‘i’ has no left child then 'LEFT_CHILD[i]' will equal -1, similarly for the right child.

Example:

Let’s say we have n=4 nodes, 'LEFT_CHILD' = {1, -1, 3, -1} and 
RIGHT_CHILD = {2, -1, -1, -1}. So the resulting tree will look like this:

It will return True as there is only one valid binary tree and each node has only one parent and there is only one root.
Try solving now

2. Longest Palindromic Subsequence

Hard
45m average time
50% success
0/120
Asked in companies
LinkedInIBMMakeMyTrip

You have been given a string ‘A’ consisting of lower case English letters. Your task is to find the length of the longest palindromic subsequence in ‘A’.

A subsequence is a sequence generated from a string after deleting some or no characters of the string without changing the order of the remaining string characters. (i.e. “ace” is a subsequence of “abcde” while “aec” is not).

A string is said to be palindrome if the reverse of the string is the same as the actual string. For example, “abba” is a palindrome, but “abbc” is not a palindrome.

Problem approach

A palindromic subsequence is a sequence of characters that reads the same forwards and backwards, but not necessarily consecutively. The longest palindromic subsequence (LPS) of a given string is the longest subsequence that is a palindrome.

We can start populating the dp table from the bottom right corner and move towards the top left corner, using the following approach:

Initialize the diagonal cells of the dp table with a value of 1, as the longest palindromic subsequence of a single character is always 1.

Iterate over the dp table in a bottom-up manner, starting from the second last row and the second last column, up to the first row and the first column.

For each cell dp[i][j], compare the characters at the i-th and j-th positions of the input string:
a. If the characters are the same, then dp[i][j] = dp[i+1][j-1] + 2. This means that the longest palindromic subsequence of the substring from i-th to j-th characters is equal to the longest palindromic subsequence of the substring from (i+1)-th to (j-1)-th characters, plus 2, as we are including the matching characters in the subsequence.
b. If the characters are different, then dp[i][j] = max(dp[i+1][j], dp[i][j-1]). This means that the longest palindromic subsequence of the substring from i-th to j-th characters is equal to the maximum of the longest palindromic subsequence of the substring from (i+1)-th to j-th characters, and the longest palindromic subsequence of the substring from i-th to (j-1)-th characters, as we need to choose the longer one.

After iterating over all the cells of the dp table, the top right cell dp[0][n-1] (where n is the length of the input string) will represent the length of the longest palindromic subsequence of the entire input string.

To retrieve the actual longest palindromic subsequence, we can trace back from dp[0][n-1] to dp[0][0] by following the arrows (i.e., the choices made in step 3) and including the characters in the input string corresponding to those choices. This will give us the longest palindromic subsequence of the input string.

Try solving now
03
Round
Medium
Face to Face
Duration60 Minutes
Interview date13 Oct 2022
Coding problem2

1. Puzzle

Train collision puzzle

Two trains, separated by a distance of 80km, are running towards each other on the same track at a speed of 40 kmph. A bird takes its flight from train X and flies towards train Y at a constant speed of 100 kmph. Once it reaches train Y, it turns and start flying back toward strain X. The bird keeps flying to and forth till both the trains collide. Determine the distance travelled by the bird.

Problem approach

Velocity of approach for two trains = (40+40)km/hr

Time taken for the trains to collide = 80km/80km/hr = 1hour

The total distance travelled by the bird = 100km/hr * 1hr = 100km

Through this puzzle, the interviewer is testing your approach. Consider yourself rejected if the approach you took involves calculating distance from X to Y, and then Y to X, and so on.

2. Colour the Graph

Moderate
20m average time
80% success
0/80
Asked in companies
MicrosoftHexaware TechnologiesArcesium

You are given a graph with 'N' vertices numbered from '1' to 'N' and 'M' edges. You have to colour this graph in two different colours, say blue and red such that no two vertices connected by an edge are of the same colour.

Note :
The given graph may have connected components.
Problem approach

I use recursion to solve this problem, and assigned color to each node and check at last whether it is giving safe configuration or not that is all nodes are of red and blue color and adjacent nodes have not the same color.

Try solving now

Here's your problem of the day

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

Skill covered: Programming

Which SQL keyword removes duplicate records from a result set?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by MakeMyTrip
826 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by MakeMyTrip
474 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by MakeMyTrip
468 views
0 comments
0 upvotes
company logo
Software Engineer
3 rounds | 5 problems
Interviewed by MakeMyTrip
2236 views
1 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13919 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
13231 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
9230 views
2 comments
0 upvotes