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

SDE - 1

MakeMyTrip
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 Month
Topics: DSA, OOPS, Python, Tree, Java, Pointers, DP
Tip
Tip

Tip 1 : OOPs concepts are must.
Tip 2 : Choose any language and master it.
Tip 3 : Explain everything while coding in interview, and tell your approach.

Application process
Where: Referral
Eligibility: NA
Resume Tip
Resume tip

Tip 1 : At least 2 projects.
Tip 2 : Highlight your achievements.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration60 Minutes
Interview date17 Jan 2022
Coding problem2

2 problems from leetcode were asked,
1. Best Time to Buy and Sell Stock
2. Remove K Digits

1. Best Time to Buy and Sell Stock

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

You are given an array/list 'prices' where the elements of the array represent the prices of the stock as they were yesterday and indices of the array represent minutes. Your task is to find and return the maximum profit you can make by buying and selling the stock. You can buy and sell the stock only once.

Note:

You can’t sell without buying first.
For Example:
For the given array [ 2, 100, 150, 120],
The maximum profit can be achieved by buying the stock at minute 0 when its price is Rs. 2 and selling it at minute 2 when its price is Rs. 150.
So, the output will be 148.
Problem approach

Remember one rule :- You can only buy one time & sell one time

So, if buy at 7 & sell at any time in the future, we'll face loss. Because buying price is way higher then selling price available we have

Now, I have seen a dip & I buy at 1 & sell at 5 my overall profit will be 5 - 1 = 4

But what if, I had buy at 1 & sell at 6 my profit will be 6 - 1 = 5. Which is greater then my overall profit. So, i will update my overall profit with new value.

Try solving now

2. Remove K Digits

Moderate
25m average time
75% success
0/80
Asked in companies
FacebookMicrosoftMakeMyTrip

You are given a non-negative integer ‘num’ in the form of a string and provided with an integer ‘k’.


You need to find the smallest integer possible by removing exactly ‘k’ digits from ‘num.’


Note :
‘num’ does not have leading zeros except when ‘num’ equals zero.
Example:
Input: ‘num’ = ‘141’ , ‘k’ = 1.

Output: ‘11’

Explanation: By removing only 1 digit from ‘num’, 3 numbers can be formed: 14, 11, and 41. Out of which 11 is the smallest number.
Note :
You don’t have to print anything. It has already been taken care of. Just implement the given function.
Problem approach

1. Deleting k digits means keeping n - k digits, where n is the total number of digits.

2. Use a stack that you keep sorted ascendingly. You remove elements from it as long as you can still make it to n - k digits,
and your current element is smaller than the top of the stack:

push(2) => 2
push(4) because 2 < 4 => 24
push(6) because 4 < 6 => 246
pop() because 3 < 6 and we can still end up with 2 digits => 24
pop() for the same reason => 2
push(3) => 23
push(5) => 235
Then just take the first k digits => 23. Or you can make sure never to push more than k digits, and then the final stack is your solution.

3. Note that you cannot pop elements if that means you will not be able to build a solution of k digits.
For this, you need to check the current number of elements in the stack and the number of digits to the right of your current position on the input number.

Try solving now
02
Round
Easy
Video Call
Duration60 Minutes
Interview date18 Jan 2022
Coding problem1

Online Coding round.

1. Sub Matrices With Sum Zero

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

You’re given a square matrix 'MAT' of order N. Your task is to find the number of non-empty sub-matrices such that the sum of all the elements inside the submatrix is zero.

NOTE:

1. The matrix may also contain some negative elements.
2. A square matrix is a matrix with the same number of rows and columns.
A matrix obtained by deleting some (possibly zero) of the rows and/or columns from the beginning and/or from the end of a matrix is said to be a sub-matrix of the given matrix.

Example: Given a matrix
 A = 1 2
     3 4

Possible non-empty sub-matrices of A are represented below by bold numbers-

alt text

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 keyword is used for inheritance?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 3 problems
Interviewed by MakeMyTrip
963 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 13 problems
Interviewed by MakeMyTrip
1017 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by MakeMyTrip
563 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by MakeMyTrip
546 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
111048 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
54789 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
33527 views
6 comments
0 upvotes