Add office photos
MakeMyTrip logo
Engaged Employer

MakeMyTrip

Verified
3.7
based on 858 Reviews
Video summary
Filter interviews by
Software Developer
Skills
Clear (1)

30+ MakeMyTrip Software Developer Interview Questions and Answers

Updated 26 Dec 2024

Q1. Minimum Jumps Problem Statement

Bob and his wife are in the famous 'Arcade' mall in the city of Berland. This mall has a unique way of moving between shops using trampolines. Each shop is laid out in a straight...read more

Ans.

Find the minimum number of trampoline jumps Bob needs to make to reach the final shop, or return -1 if it's impossible.

  • Use Breadth First Search (BFS) algorithm to find the minimum number of jumps required.

  • Keep track of the visited shops to avoid revisiting them.

  • If a shop has an Arr value of 0, it is impossible to reach the final shop.

  • Return -1 if the final shop cannot be reached.

Add your answer
right arrow

Q2. Reverse Linked List Problem Statement

Given a singly linked list of integers, return the head of the reversed linked list.

Example:

Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Ans.

Reverse a singly linked list of integers and return the head of the reversed linked list.

  • Iterate through the linked list and reverse the pointers to point to the previous node.

  • Keep track of the current, previous, and next nodes while reversing the linked list.

  • Update the head of the reversed linked list as the last node encountered during reversal.

Add your answer
right arrow

Q3. Smallest Window Problem Statement

Given two strings, S and X, your task is to find the smallest substring in S that contains all the characters present in X.

Example:

Input:
S = "abdd", X = "bd"
Output:
"bd"
Ex...read more
Ans.

Find the smallest substring in string S that contains all characters in string X.

  • Iterate through string S and keep track of characters in X found in a window

  • Use two pointers to maintain the window and slide it to find the smallest window

  • Return the smallest window containing all characters in X

Add your answer
right arrow

Q4. Rat in a Maze Problem Statement

You need to determine all possible paths for a rat starting at position (0, 0) in a square maze to reach its destination at (N-1, N-1). The maze is represented as an N*N matrix w...read more

Ans.

Find all possible paths for a rat in a maze from start to destination.

  • Use backtracking to explore all possible paths in the maze.

  • Keep track of visited cells to avoid revisiting them.

  • Return paths in alphabetical order as a list of strings.

Add your answer
right arrow
Discover MakeMyTrip interview dos and don'ts from real experiences

Q5. Cycle Detection in a Singly Linked List

Determine if a given singly linked list of integers forms a cycle or not.

A cycle in a linked list occurs when a node's next points back to a previous node in the list. T...read more

Ans.

Detect if a singly linked list forms a cycle by checking if a node's next pointer points back to a previous node.

  • Traverse the linked list using two pointers, one moving at double the speed of the other.

  • If the two pointers meet at any point, there is a cycle in the linked list.

  • Use Floyd's Cycle Detection Algorithm for O(N) time complexity and O(1) space complexity.

Add your answer
right arrow

Q6. Minimum Steps for a Knight to Reach Target

Given a square chessboard of size 'N x N', determine the minimum number of moves a Knight requires to reach a specified target position from its initial position.

Expl...read more

Ans.

Calculate the minimum number of moves a Knight needs to reach a target position on a chessboard.

  • Implement a function that takes knight's starting position, target position, and chessboard size as input

  • Use breadth-first search algorithm to find the shortest path for the Knight

  • Consider all possible 8 movements of the Knight on the chessboard

  • Return the minimum number of moves required for the Knight to reach the target position

Add your answer
right arrow
Are these interview questions helpful?

Q7. find out the subset of an array of continuous positive numbers from a larger array whose sum of of the elements is larger in comparision to other subset. eg: {1,2 5 -7, 2 5} .The two subarrays are {1,2,5} {2,5}...

read more
Ans.

Find the subset of an array with the largest sum of continuous positive numbers.

  • Iterate through the array and keep track of the current sum and the maximum sum seen so far.

  • If the current element is positive, add it to the current sum. If it is negative, reset the current sum to 0.

  • Also keep track of the start and end indices of the maximum sum subset.

  • Return the subset using the start and end indices.

Add your answer
right arrow

Q8. Smallest Integer Not Representable as Subset Sum

Given a non-decreasing sorted array ARR of N positive numbers, determine the smallest positive integer that cannot be expressed as the sum of elements from any p...read more

Ans.

Find the smallest positive integer that cannot be expressed as the sum of elements from any proper subset of a non-decreasing sorted array of positive numbers.

  • Start with the smallest possible integer that cannot be represented, which is 1.

  • Iterate through the array and update the smallest integer that cannot be represented.

  • If the current element is greater than the smallest integer that cannot be represented, return that integer.

  • If all elements in the array can be represented,...read more

Add your answer
right arrow
Share interview questions and help millions of jobseekers 🌟
man with laptop
Q9. What are the port numbers of protocols such as FTP and SMTP?
Ans.

FTP uses port number 21 and SMTP uses port number 25.

  • FTP uses port 21 for data transfer and port 20 for control information.

  • SMTP uses port 25 for email communication.

  • Understanding port numbers is important for network communication.

Add your answer
right arrow

Q10. Given an integer array of size n, find the maximum circular subarray sum. A circular array means that the end of the array connects back to the beginning. The solution should consider both the non-circular maxi...

read more
Ans.

Find the maximum circular subarray sum in an integer array.

  • Calculate the non-circular maximum subarray sum using Kadane's algorithm.

  • Calculate the circular maximum subarray sum by subtracting the minimum subarray sum from the total sum.

  • Compare the non-circular and circular maximum subarray sums to get the overall maximum sum.

Add your answer
right arrow
Q11. What are the types of polymorphism in Object-Oriented Programming?
Ans.

Types of polymorphism in OOP include compile-time (method overloading) and runtime (method overriding) polymorphism.

  • Compile-time polymorphism is achieved through method overloading, where multiple methods have the same name but different parameters.

  • Runtime polymorphism is achieved through method overriding, where a subclass provides a specific implementation of a method that is already defined in its superclass.

  • Polymorphism allows objects of different classes to be treated as...read more

Add your answer
right arrow
Q12. What is the difference between deep copy and shallow copy?
Ans.

Deep copy creates a new object and recursively copies all nested objects, while shallow copy creates a new object and copies only the references to nested objects.

  • Deep copy creates a new object and copies all nested objects, while shallow copy creates a new object and copies only the references to nested objects.

  • In deep copy, changes made to the original object do not affect the copied object, while in shallow copy, changes made to the original object may affect the copied ob...read more

Add your answer
right arrow

Q13. You are given two strings s1 and s2.Now, find the smallest substring in s1 containing all characters of s2

Ans.

Find smallest substring in s1 containing all characters of s2.

  • Create a hash table of characters in s2

  • Use sliding window technique to find smallest substring in s1

  • Check if all characters in s2 are present in the substring

  • Update the smallest substring if a smaller one is found

Add your answer
right arrow
Q14. What is the difference between AngularJS and jQuery?
Ans.

AngularJS is a full-fledged MVC framework for building dynamic web applications, while jQuery is a lightweight library for DOM manipulation and event handling.

  • AngularJS is a full-fledged MVC framework, providing features like two-way data binding, dependency injection, and routing.

  • jQuery is a lightweight library primarily used for DOM manipulation and event handling.

  • AngularJS is suitable for building single-page applications, while jQuery is more commonly used for enhancing t...read more

Add your answer
right arrow

Q15. Design a minimum stack that supports the following operations: push, pop, top, and retrieving the minimum element in constant time.

Ans.

Design a stack that supports push, pop, top, and retrieving minimum element in constant time.

  • Use two stacks - one to store the actual elements and another to store the minimum values encountered so far

  • When pushing an element, check if it is smaller than the current minimum and if so, push it to the minimum stack

  • When popping an element, check if it is the current minimum and if so, pop from the minimum stack as well

  • Top operation can be implemented by returning the top element ...read more

Add your answer
right arrow

Q16. How ajax works? Difference between angular js and jquery?

Ans.

Ajax is a technique for creating fast and dynamic web pages. AngularJS is a framework for building dynamic web applications, while jQuery is a library for simplifying HTML DOM traversal and manipulation.

  • Ajax stands for Asynchronous JavaScript and XML

  • It allows web pages to be updated asynchronously by exchanging data with a web server behind the scenes

  • AngularJS is a JavaScript framework that extends HTML with new attributes and makes it more responsive to user actions

  • It provid...read more

Add your answer
right arrow

Q17. What is lazy loading? Advantages and disadvantages of the same?

Ans.

Lazy loading is a technique used to defer the loading of non-critical resources until they are needed.

  • Advantages: faster initial page load, reduced bandwidth usage, improved user experience

  • Disadvantages: increased complexity, potential for slower subsequent page loads, difficulty with SEO

  • Examples: images, videos, and other media files can be loaded only when they are visible on the screen

Add your answer
right arrow
Q18. How would you design a traffic light system?
Ans.

Designing a traffic light system involves creating a system that controls the flow of traffic at intersections.

  • Divide the traffic light system into three main lights: red, yellow, and green.

  • Implement timers to control the duration of each light.

  • Include sensors to detect the presence of vehicles and pedestrians.

  • Consider implementing a pedestrian crossing signal.

  • Integrate a central control system to coordinate the timing of lights at different intersections.

Add your answer
right arrow
Q19. How do you copy files in Linux?
Ans.

To copy files in Linux, you can use the 'cp' command.

  • Use the 'cp' command followed by the source file and destination directory to copy a file.

  • To copy a directory and its contents, use the '-r' flag with the 'cp' command.

  • You can also use wildcards like '*' to copy multiple files at once.

Add your answer
right arrow
Q20. Can you explain the OSI Model?
Ans.

The OSI Model is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven layers.

  • The OSI Model stands for Open Systems Interconnection Model.

  • It consists of seven layers: Physical, Data Link, Network, Transport, Session, Presentation, and Application.

  • Each layer has specific functions and communicates with the adjacent layers.

  • Example: Layer 1 (Physical) deals with physical connections like cables, Layer 2 (Data Link) handles e...read more

Add your answer
right arrow

Q21. Smallest window in a string containing all the characters of another string.(GFG)

Ans.

Find the smallest window in a string containing all characters of another string.

  • Use a sliding window approach to find the smallest window

  • Create a frequency map of characters in the second string

  • Slide the window and update the frequency map until all characters are found

  • Track the minimum window size and indices

View 1 answer
right arrow
Q22. What are the different OOP concepts?
Ans.

OOP concepts include inheritance, encapsulation, polymorphism, and abstraction.

  • Inheritance allows a class to inherit properties and behavior from another class.

  • Encapsulation restricts access to certain components of an object, protecting its integrity.

  • Polymorphism allows objects to be treated as instances of their parent class.

  • Abstraction hides the complex implementation details of an object and only shows the necessary features.

Add your answer
right arrow

Q23. Algorithm to find if any 5 numbers add up to the value of the Sum

Ans.

Use a hash set to store seen numbers and check if the complement of current number is in the set.

  • Iterate through the array and for each number, check if the complement of the current number is in the hash set.

  • If the complement is found, return true. Otherwise, add the current number to the hash set.

  • Repeat this process for all numbers in the array.

  • Example: Array [1, 2, 3, 4, 5] and Sum 9 should return true as 4 + 5 = 9.

Add your answer
right arrow
Q24. What is a virtual function?
Ans.

A virtual function is a function in a base class that is declared using the keyword 'virtual' and can be overridden by a function with the same signature in a derived class.

  • Virtual functions allow for dynamic polymorphism in C++

  • They are used in inheritance to achieve runtime polymorphism

  • Virtual functions are declared in a base class and can be overridden in derived classes

  • They are called based on the type of object being pointed to or referred to, not the type of pointer or r...read more

Add your answer
right arrow

Q25. Deadlocks,4 conditions of Deadlocks and ways of preventing Deadlock

Ans.

Deadlocks occur when two or more processes are waiting for each other to release resources, leading to a standstill.

  • 4 conditions of Deadlocks: mutual exclusion, hold and wait, no preemption, circular wait

  • Preventing Deadlocks: using a proper resource allocation strategy, implementing timeouts, avoiding circular wait, using deadlock detection and recovery algorithms

  • Example: Two processes each holding a resource and waiting for the other to release the resource, causing a deadlo...read more

Add your answer
right arrow

Q26. Check whether linked list is Pallindrome or not

Ans.

To check if a linked list is a palindrome, compare the first half of the list with the reversed second half.

  • Traverse the linked list to find the middle element using slow and fast pointers.

  • Reverse the second half of the linked list.

  • Compare the first half with the reversed second half to check for palindrome.

Add your answer
right arrow

Q27. Write algo for reversing a linked list

Ans.

Algorithm to reverse a linked list

  • Create a new empty linked list

  • Traverse the original linked list and insert each node at the beginning of the new list

  • Return the new list

Add your answer
right arrow

Q28. What is DNS(Domain Name System)

Ans.

DNS is a system that translates domain names to IP addresses, allowing users to access websites using human-readable names.

  • DNS is like a phone book for the internet, translating domain names (e.g. google.com) to IP addresses (e.g. 172.217.3.206).

  • DNS servers store records that map domain names to IP addresses, helping users navigate the internet.

  • DNS also helps with email delivery by translating domain names in email addresses to IP addresses for routing purposes.

Add your answer
right arrow
Q29. How does AJAX work?
Ans.

AJAX allows for asynchronous communication between client and server without needing to reload the entire page.

  • AJAX stands for Asynchronous JavaScript and XML.

  • It allows for sending and receiving data from a server without reloading the entire page.

  • AJAX uses XMLHttpRequest object to make requests to the server.

  • It can update parts of a web page without requiring a full page reload.

  • Commonly used in web applications to provide a more seamless user experience.

Add your answer
right arrow

Q30. Design a traffic light system?

Ans.

A traffic light system controls the flow of traffic at intersections.

  • The system consists of three lights: red, yellow, and green.

  • Each light has a specific duration for which it stays on.

  • The system also includes sensors to detect the presence of vehicles and pedestrians.

  • The duration of each light can be adjusted based on traffic patterns.

  • The system can be connected to a central control system for remote monitoring and management.

Add your answer
right arrow
Contribute & help others!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos

Interview Process at MakeMyTrip Software Developer

based on 6 interviews
1 Interview rounds
Technical Round
View more
interview tips and stories logo
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Top Software Developer Interview Questions from Similar Companies

View all
Recently Viewed
INTERVIEWS
MakeMyTrip
5.6k top interview questions
INTERVIEWS
Sciative Solutions
No Interviews
INTERVIEWS
Analytics Quotient
No Interviews
INTERVIEWS
Sciative Solutions
No Interviews
INTERVIEWS
Nuvoco Vistas
No Interviews
INTERVIEWS
Nuvoco Vistas
No Interviews
INTERVIEWS
Analytics Quotient
No Interviews
INTERVIEWS
Sciative Solutions
No Interviews
INTERVIEWS
Nuvoco Vistas
No Interviews
INTERVIEWS
Salesforce
No Interviews
Share an Interview
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
75 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter