MakeMyTrip Interview Questions

MakeMyTrip is an Indian online travel company founded in 2000. Headquartered in GurugramHaryana, the company provides online travel services including airline tickets, domestic and international holiday packages, hotel reservations, rail, and bus tickets. As of 31 March 2018, they have 14 company-owned travel stores in 14 cities, over 30 franchisee-owned travel stores in 28 cities, and counters in four major airports in India. MakeMyTrip has also numerous international offices in New YorkSingaporeKuala LumpurPhuketBangkok, and Dubai.

It has got a 4.4* rating on Glassdoor and is considered one of the best product-based companies. It is highly regarded for its work-life balance.

They provide good training as well which will be beneficial in future too. You can practice the below MakeMyTrip Interview Questions for the interview. We have collected past frequently asked MakeMyTrip Interview Questions for your reference.

MakeMyTrip Array Questions

Question 1. Segregate 0s and 1s in an Array Problem Statement Suppose you have an integer array. The problem “Segregate 0s and 1s in an array” asks to segregate the array in two parts, in 0s and in 1s. The 0’s should be on the left side of the array and 1’s on the right side of the array. ...

Read more

Question 2. Maximum difference between first and last indexes of an element in array Suppose, you have an array of integers. The problem “Maximum difference between first and last indexes of an element in array” asks to find out the difference between the first and last index of each number present in an array such that the difference is being maximum of all. Example ...

Read more

Question 3. Subarray with 0 sum The problem “Find if there is a subarray with 0 sum” states that you are given an integer array containing negative integers as well. The problem statement asks to determine if any sub-array of size at-least 1. This sub-array should have a sum equal to 1. Example arr[] = {2,1,-3,4,5} ...

Read more

Question 4. Largest subarray with equal number of 0s and 1s You are given an array of integers. The integers are only 0 and 1 in the input array. The problem statement asks to find out the largest sub-array that can have equal count of 0s and 1s. Example arr[]={0,1,0,1,0,1,1,1} 0 to 5 (total 6 elements) Explanation From the array position ...

Read more

Question 5. Segregate even and odd numbers Problem Statement Suppose you have an integer array. The problem “Segregate even and odd numbers” asks to rearrange the array so that the odd and even numbers can be separated in two segments of the array. The even numbers be shifted into the left side of the array and odd ...

Read more

Question 6. Arrange given numbers to form the biggest number Problem Statement Suppose you have an array of integers. The problem “Arrange given numbers to form the biggest number”  asks to rearrange the array in such a manner that the output should be the maximum value which can be made with those numbers of an array. Example [34, 86, 87, ...

Read more

Question 7. Largest Sum Contiguous Subarray Problem Statement You are given an array of integers. The problem statement asks to find out the largest sum contiguous subarray. This means nothing but to find a subarray (continuous elements) which has the largest sum among all other subarrays in the given array. Example arr[] = {1, -3, 4, ...

Read more

Question 8. The Knapsack Problem Before going to “The Knapsack Problem” first look at a real-life problem. Sakshi wants to carry away the maximum vegetables from a garden. However, her sack has a maximum weight capacity and might break on the addition of extra weight. Let’s look into the situation- Items:        {Potato, ...

Read more

Question 9. Print All Distinct Elements of a Given Integer Array Given an integer array, print all distinct elements in the array. The given array may contain duplicates and the output should print every element only once. The given array is not sorted. Example Input: nums[]= {12, 10, 9, 45, 2, 10, 10, 45} Output: 12, 10, 9, 45, 2 Approach ...

Read more

Question 10. Rotate Array Rotate array is a problem in which we have given an array of size N. We have to rotate the array in the right direction. Each element shift by one position right and last element of the array come to the first position. So, we have given a value K ...

Read more

Question 11. Arrange given Numbers to Form the Biggest Number II Problem Statement In the “Arrange given Numbers to Form the Biggest Number II” problem, we have given an array of positive integers.  Arrange them in such a way that the arrangement will form the largest value. Input Format The first and only one line containing an integer n. Second-line containing ...

Read more

Question 12. Sort 0s 1s and 2s in an Array Problem Statement Given an array containing N elements where elements of the array are 0,1 or 2. Sort or Segregate 0s 1s and 2s in an array. Arrange all zeros in the first half, all ones in the second half and all twos in the third half. Example Input 22 ...

Read more

Question 13. Find Pythagorean Triplets from Array Problem Statement We have given an array that contains n integers. We need to find the set of Pythagorean triples from the given array. Note: Pythagorean triplets condition: a^2 + b^2 = c^2. Example Input 6 [3, 4, 6, 5, 7, 8] Output Pythagorean triplets: 3, 4, 5 Approach 1 ...

Read more

Question 14. Count Number of Occurrences in a Sorted Array Problem Statement In the “Count Number of Occurrences in a Sorted Array” problem, we have given a sorted array. Count the number of occurrences or frequency in a sorted array of X where X is an integer. Example Input 13 1 2 2 2 2 3 3 3 4 4 ...

Read more

Question 15. Maximum difference between two elements such as larger element comes after smaller Problem Statement We have given an array of n integers in which we have to find the maximum difference between two elements such as larger element comes after smaller. Example Input 4  7  2  18  3  6  8  11  21 Output 19 Approach 1 for Maximum difference between two elements  ...

Read more

MakeMyTrip String Questions

Question 16. Valid Palindrome II Leetcode Solution Problem Statement The Valid Palindrome II LeetCode Solution – “Valid Palindrome II” states that given the string s, we need to return true if s can be a palindrome string after deleting at most one character. Example: Input: s = "aba" Output: true Explanation: The input string is already palindrome, so there’s ...

Read more

Question 17. Arrange given numbers to form the biggest number Problem Statement Suppose you have an array of integers. The problem “Arrange given numbers to form the biggest number”  asks to rearrange the array in such a manner that the output should be the maximum value which can be made with those numbers of an array. Example [34, 86, 87, ...

Read more

Question 18. Reverse Integer Problem Statement “Reverse Integer” problem states that you are given an integer variable n containing the number to be reversed. Write a program to reverse its digits. Reversing an integer is nothing different from reversing a string. We can easily convert an integer into a string. And then use the ...

Read more

Question 19. Reverse words in a string Problem Statement “Reverse words in a string” states that you are given a string s of size n. Print the string in reverse order such that the last word becomes the first, second last becomes the second, and so on. Hereby string we refer to a sentence containing words instead ...

Read more

Question 20. KMP Algorithm KMP(Knuth-Morris-Pratt) algorithm is used for pattern searching in a given string. We are given a string S and a pattern p, our goal is to determine whether or not the given pattern is present in the string. Example Input: S = “aaaab” p = “aab” Output: true Naive Approach The ...

Read more

Question 21. Rabin Karp Algorithm Rabin Karp Algorithm used to find the pattern string in the given text string. There are so many types of algorithms or methods used to find the pattern string. In this algorithm, we use Hashing for finding the pattern matching. If we got the same hash code for the substring ...

Read more

Question 22. Check if String can Become Empty by Recursively Deleting given Substring Problem Statement In the “Check if string can become empty by recursively deleting given substring” problem we have given two strings “s” and “t”. We have to check if the given input string “s” can be deleted completely by deleting the given input sub-string “t” recursively. Note: Given sub-string should ...

Read more

Question 23. Compare Two Version Numbers Problem Statement Given two input strings, which are in form of version numbers. A version number looks like a.b.c.d where a, b, c, d are integers. Therefore, the version number is a string in which numbers are separated by dots. We need to compare the two strings (version numbers) and ...

Read more

Question 24. Perfect Reversible String Problem Statement In the “Perfect Reversible String” problem we have given a string “s”. Check that if reverses of all possible substrings of the input string are present in the string or not. If present it’s a perfectly reversible_string. Input Format The first and only one line contain a string ...

Read more

Question 25. Arrange given Numbers to Form the Biggest Number II Problem Statement In the “Arrange given Numbers to Form the Biggest Number II” problem, we have given an array of positive integers.  Arrange them in such a way that the arrangement will form the largest value. Input Format The first and only one line containing an integer n. Second-line containing ...

Read more

MakeMyTrip Tree Questions

Question 26. Find distance between two nodes of a Binary Tree Problem Statement The problem “Find distance between two nodes of a Binary Tree” states that you are given a binary tree and you are given two nodes. Now you need to find the minimum distance between these two nodes. Example // Tree is shown using the image above node 1 ...

Read more

Question 27. Print Right View of a Binary Tree Problem Statement The problem “Print Right View of a Binary Tree” states that you are given a binary tree. Now you need to find the right view of this tree. Here, right view of the binary tree means to print the sequence as the tree looks when looked from the ...

Read more

Question 28. A program to check if a binary tree is BST or not Problem Statement “A program to check if a binary tree is BST or not” states that you are given a binary tree and you need to check if the binary tree satisfies the properties of the binary search tree. So, the binary tree has the following properties:  The left subtree ...

Read more

Question 29. Maximum Depth Of Binary Tree Problem Statement “Maximum depth of binary tree” problem states that you are given a binary tree data structure. Print the maximum depth of the given binary tree. Example Input 2 Explanation: Maximum depth for the given tree is 2. Because there is only a single element below the root (i.e. ...

Read more

Question 30. Print a Binary Tree in Vertical Order In this problem, we have given a pointer denoting the root of the binary tree and your task is to print the binary tree in the vertical order. Example Input 1 / \ 2 3 / \ / \ 4 5 6 7 \ \ 8 9 Output 4 2 ...

Read more

MakeMyTrip Graph Questions

Question 31. Minimum Steps to reach target by a Knight Description The problem “Minimum Steps to reach target by a Knight” states that you are given a square chess board of N x N dimensions, co-ordinates of the Knight piece, and the target cell. Find out the minimum number of steps taken by the Knight piece to reach the target ...

Read more

MakeMyTrip Stack Questions

Question 32. Queue using Stacks In queue using a stack problem, we have to implement the following functions of a queue using the standard functions of stack data structure, Enqueue: Add an element to the end of the queue Dequeue: Remove an element from the start of the queue Example Input: Enqueue(5) Enqueue(11) Enqueue(39) Dequeue()  ...

Read more

MakeMyTrip Queue Questions

Question 33. Minimum Steps to reach target by a Knight Description The problem “Minimum Steps to reach target by a Knight” states that you are given a square chess board of N x N dimensions, co-ordinates of the Knight piece, and the target cell. Find out the minimum number of steps taken by the Knight piece to reach the target ...

Read more

Question 34. Queue using Stacks In queue using a stack problem, we have to implement the following functions of a queue using the standard functions of stack data structure, Enqueue: Add an element to the end of the queue Dequeue: Remove an element from the start of the queue Example Input: Enqueue(5) Enqueue(11) Enqueue(39) Dequeue()  ...

Read more

MakeMyTrip Other Questions

Question 35. Reverse Nodes in k-Group LeetCode Solution Problem Statement: Reverse Nodes in k-Group LeetCode Solution – Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is ...

Read more

Question 36. LRU Cache Leetcode Solution Problem Statement The LRU Cache LeetCode Solution – “LRU Cache” asks you to design a data structure that follows Least Recently Used (LRU) Cache We need to implement LRUCache class that has the following functions: LRUCache(int capacity): Initializes the LRU cache with positive size capacity. int get(int key): Return the value ...

Read more

Question 37. Product of Array Except Self LeetCode Solution Problem Statement Product of Array Except Self LeetCode Solution – Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nums is guaranteed to fit in a 32-bit integer. You must write an algorithm that runs in O(n) time and without using the division ...

Read more

Question 38. Contiguous Array Given an array consisting of number 0’s and 1’s only. We have to find the length of the longest contiguous sub-array consisting o’s and 1’s equally. Example Input arr = [0,1,0,1,0,0,1] Output 6 Explanation The longest contiguous sub-array is marked in red [0,1,0,1,0,0,1] and its length is 6. Algorithm Set ...

Read more

Question 39. Write a function to get the intersection point of two Linked Lists Problem Statement The problem “Write a function to get the intersection point of two Linked Lists” states that you are given two linked lists. But they are not independent linked lists. They are connected at some point. Now you need to find this point of intersection of these two lists. ...

Read more

Question 40. Reverse a linked list Problem Statement The problem “reverse a linked list” states that we are given the head of the linked list. We have to reverse the linked list by changing the links between them and return the head of the reversed linked list. Example 10->20->30->40->NULL NULL<-10<-20<-30<-40 Explanation We have reversed the linked ...

Read more

Translate »