MakeMyTrip interview questions & answers

20 real MakeMyTrip interview questions with full model answers — Technical, Coding, Product & growth. Drawn from the same verified bank ChannelPulse drills from (60 MakeMyTrip questions in total).

CodingEasyMakeMyTripQA / SDET

1. Write a program to open a web page.

Model answer

const { chromium } = require('playwright');

async function openWebPage(url) {
  const browser = await chromium.launch({ headless: false });

  try {
    const page = await browser.newPage();
    await page.goto(url, { waitUntil: 'domcontentloaded' });
    console.log(`Opened: ${page.url()}`);
    console.log(`Title: ${await page.title()}`);

    // Keep the browser open until the user closes it.
    await page.waitForEvent('close');
  } finally {
    await browser.close();
  }
}

const url = process.argv[2] || 'https://www.makemytrip.com/';
openWebPage(url).catch((error) => {
  console.error('Could not open the page:', error.message);
  process.exitCode = 1;
});
  • Install the dependency with npm install playwright and install its browser with npx playwright install chromium.
  • Run with node open-page.js https://example.com; the MakeMyTrip homepage is the default.

Complexity: O(1) application memory, excluding the browser’s own resource use.

CodingEasyMakeMyTripQA / SDET

2. Can you write WebDriver drv = new WebDriver();?

Model answer

No. In Selenium’s Java API, WebDriver is an interface, so it cannot be instantiated with new WebDriver(); Java will reject that statement. Instantiate a concrete implementation and assign it to the interface type, for example: WebDriver drv = new FirefoxDriver();.

The JavaScript below illustrates the same idea: create a concrete driver implementation and use it through a shared contract.

// Java equivalent: WebDriver drv = new FirefoxDriver();
class FirefoxDriver {
  get(url) {
    console.log(`Navigating to ${url} with Firefox`);
  }
}

function createDriver(DriverImplementation) {
  return new DriverImplementation();
}

const drv = createDriver(FirefoxDriver);
drv.get("https://www.makemytrip.com");
  • WebDriver provides the contract; FirefoxDriver supplies the implementation.
  • In Java, instantiate the concrete driver, not the interface.
  • Complexity: O(1) time and O(1) space for this illustrative object creation.
CodingEasyMakeMyTripQA / SDET

3. Given an array containing the numbers 1 through 100 with one number missing, how would you find the missing number?

Model answer

function findMissingNumber(numbers) {
  const expectedCount = 100;
  const expectedSum = (expectedCount * (expectedCount + 1)) / 2;
  const actualSum = numbers.reduce((sum, value) => sum + value, 0);

  return expectedSum - actualSum;
}

// Example: 42 is missing from the input.
const numbers = Array.from({ length: 100 }, (_, index) => index + 1)
  .filter((value) => value !== 42);

console.log(findMissingNumber(numbers)); // 42
  • The sum of integers from 1 through 100 is 100 * 101 / 2; subtract the array sum to get the missing value.
  • This assumes the array contains distinct values from 1 through 100, with exactly one missing.

Complexity: Time O(n); space O(1) beyond the input.

CodingEasyMakeMyTripQA / SDET

4. Write a program to find the area of an equilateral triangle.

Model answer

// Read the side length from standard input and calculate the triangle's area.
const fs = require('fs');
const input = fs.readFileSync(0, 'utf8').trim();
const side = Number(input);

if (!Number.isFinite(side) || side < 0) {
  console.error('Enter a non-negative side length.');
  process.exit(1);
}

const area = (Math.sqrt(3) / 4) * side * side;
console.log(area);
  • Uses the equilateral-triangle formula: area = (√3 / 4) × side².
  • Provide the side length on standard input; the result is printed to standard output.
  • Complexity: O(1) time and O(1) space.
CodingMediumMakeMyTripQA / SDET

5. Write test cases for a lift.

Model answer

const test = require('node:test');
const assert = require('node:assert/strict');

// Small lift model used to make the expected behavior testable.
class Lift {
  constructor(minFloor = 0, maxFloor = 10, startFloor = 0) {
    if (startFloor < minFloor || startFloor > maxFloor) {
      throw new RangeError('Starting floor is out of range');
    }
    this.minFloor = minFloor;
    this.maxFloor = maxFloor;
    this.currentFloor = startFloor;
    this.requests = [];
    this.doorOpen = false;
  }

  requestFloor(floor) {
    if (!Number.isInteger(floor) || floor < this.minFloor || floor > this.maxFloor) {
      throw new RangeError('Requested floor is out of range');
    }

    if (floor === this.currentFloor && this.requests.length === 0) {
      this.doorOpen = true;
    } else if (!this.requests.includes(floor)) {
      this.requests.push(floor);
    }
  }

  advance() {
    if (this.doorOpen) throw new Error('Cannot move while doors are open');
    if (this.requests.length === 0) return;

    const target = this.requests[0];
    this.currentFloor += Math.sign(target - this.currentFloor);

    if (this.currentFloor === target) {
      this.requests.shift();
      this.doorOpen = true;
    }
  }

  closeDoor(obstructed = false) {
    if (obstructed) return false; // Safety: keep doors open if obstructed.
    this.doorOpen = false;
    return true;
  }
}

test('moves to a requested floor and opens the doors on arrival', () => {
  const lift = new Lift(0, 5, 0);
  lift.requestFloor(2);
  lift.advance();
  assert.equal(lift.currentFloor, 1);
  lift.advance();
  assert.equal(lift.currentFloor, 2);
  assert.equal(lift.doorOpen, true);
  assert.deepEqual(lift.requests, []);
});

test('rejects floors outside the building', () => {
  const lift = new Lift(0, 5, 0);
  assert.throws(() => lift.requestFloor(6), RangeError);
  assert.throws(() => lift.requestFloor(-1), RangeError);
});

test('does not move with doors open', () => {
  const lift = new Lift(0, 5, 0);
  lift.requestFloor(1);
  lift.advance(); // Arrives and opens the doors.
  assert.throws(() => lift.advance(), /doors are open/);
});

test('keeps doors open when an obstruction is detected', () => {
  const lift = new Lift(0, 5, 0);
  lift.requestFloor(0);
  assert.equal(lift.doorOpen, true);
  assert.equal(lift.closeDoor(true), false);
  assert.equal(lift.doorOpen, true);
  assert.equal(lift.closeDoor(false), true);
  assert.equal(lift.doorOpen, false);
});
  • These tests cover normal travel, floor boundaries, the door/movement interlock, and obstruction safety. In a real project, I would also test capacity limits, emergency stop, power failure, and concurrent requests against the lift controller interface.
  • Run with node --test lift.test.js.

Complexity: Each movement step is O(1); request de-duplication is O(n) in the number of pending requests. Space is O(n).

CodingMediumMakeMyTripSoftware Engineer

6. Maximum Sum Circular Subarray (LeetCode)

Model answer

The task

Find the largest sum obtainable from a non-empty contiguous portion of an array, where the portion may wrap from the end back to the beginning.

Key idea

A best portion either does not wrap, so ordinary Kadane’s algorithm finds it, or wraps, so it consists of the whole array minus a minimum-sum contiguous portion. If every value is negative, use the ordinary maximum instead of subtracting the minimum, which would incorrectly produce zero.

Approach

  1. Scan once, tracking the running total, the best non-wrapping sum, and the smallest contiguous sum.
  2. Use Kadane’s recurrence for both the maximum and minimum.
  3. If the maximum sum is negative, return it; otherwise return the larger of the non-wrapping maximum and total minus the minimum.
from typing import List

class Solution:
    def maxSubarraySumCircular(self, nums: List[int]) -> int:
        total = 0

        max_ending = min_ending = 0
        max_sum = float("-inf")
        min_sum = float("inf")

        for value in nums:
            total += value

            # Best ordinary subarray ending at this position.
            max_ending = max(value, max_ending + value)
            max_sum = max(max_sum, max_ending)

            # Smallest subarray ending at this position.
            min_ending = min(value, min_ending + value)
            min_sum = min(min_sum, min_ending)

        # If all values are negative, wrapping would select an empty remainder.
        if max_sum < 0:
            return max_sum

        # A wrapping subarray is the array with a minimum-sum portion removed.
        return max(max_sum, total - min_sum)

Complexity:

  • Time: O(n), one pass through the array.
  • Space: O(1), only a fixed number of running values.

Common follow-ups

  • How would you return the actual subarray boundaries? Track the start and end indices during Kadane’s scans, including the removed minimum segment.
  • What if the array is updated repeatedly? A segment tree can maintain maximum and minimum subarray information for range updates or queries.
  • Can this be solved with a monotonic queue? Yes; prefix sums over a doubled array can find a maximum-length-limited circular segment, with a deque maintaining candidate prefix minima.
CodingMediumMakeMyTripSoftware Engineer

7. Multiply Strings (LeetCode)

Model answer

The task

Return the product of two non-negative integers given as digit strings. Compute the result without converting either entire string to a built-in integer.

Key idea

Simulate grade-school multiplication, storing each digit’s contribution in an array of length len(num1) + len(num2). For each digit pair, add its product to the appropriate positions and propagate the carry.

Approach

  1. If either string represents zero, return "0".
  2. Create an array to hold the product digits.
  3. Visit digit pairs from right to left, adding each product and existing value at that position.
  4. Store the ones digit and add the carry to the preceding position.
  5. Skip leading zeroes in the result and join the remaining digits.
class Solution:
    def multiply(self, num1: str, num2: str) -> str:
        if num1 == "0" or num2 == "0":
            return "0"

        n, m = len(num1), len(num2)
        result = [0] * (n + m)

        # Multiply each pair of digits, moving from right to left.
        for i in range(n - 1, -1, -1):
            digit1 = ord(num1[i]) - ord("0")

            for j in range(m - 1, -1, -1):
                digit2 = ord(num2[j]) - ord("0")
                position = i + j + 1

                total = digit1 * digit2 + result[position]
                result[position] = total % 10
                result[position - 1] += total // 10

        # Remove leading zeroes before building the output string.
        start = 0
        while start < len(result) - 1 and result[start] == 0:
            start += 1

        return "".join(str(digit) for digit in result[start:])

Complexity:

  • Time: O(nm), for every pair of digits.
  • Space: O(n + m), for the result array.

Common follow-ups

  • How would you support negative numbers? Track the signs separately, multiply absolute values, then apply the result sign.
  • How would you handle decimal strings? Track decimal places, multiply the digit sequences, then place the decimal point.
  • Can very long numbers be multiplied faster? For sufficiently large inputs, use divide-and-conquer methods such as Karatsuba multiplication.
CodingMediumMakeMyTripSoftware Engineer

8. House Robber II (LeetCode)

Model answer

The task

Choose non-adjacent houses to maximize the amount collected, with the first and last houses also considered adjacent because the street is circular.

Key idea

A valid selection cannot include both ends of the circle. Solve two linear versions: one that excludes the first house, and one that excludes the last. For each version, use the standard linear house-robber recurrence.

Approach

  1. If there are no houses, return 0.
  2. If there is only one house, return its value.
  3. Define a helper that finds the best total in a half-open range using two rolling values.
  4. Run the helper on the ranges excluding the first and last houses, respectively.
  5. Return the larger result.
class Solution:
    def rob(self, nums: list[int]) -> int:
        if not nums:
            return 0
        if len(nums) == 1:
            return nums[0]

        def rob_range(start: int, end: int) -> int:
            # prev_two: best total before the previous house
            # prev_one: best total through the previous house
            prev_two = 0
            prev_one = 0

            for i in range(start, end):
                current = max(prev_one, prev_two + nums[i])
                prev_two, prev_one = prev_one, current

            return prev_one

        # Exclude the first house, or exclude the last house.
        return max(
            rob_range(1, len(nums)),
            rob_range(0, len(nums) - 1),
        )

Complexity:

  • Time: O(n), since each of the two ranges is processed once.
  • Space: O(1), using only a fixed number of rolling values.

Common follow-ups

  • What if the houses form a line instead of a circle? Run the linear recurrence once over the entire list.
  • Can you return which houses to rob? Store decisions during the recurrence, then backtrack to reconstruct the chosen indices.
  • What if values can be negative? If robbing no houses is allowed, initialize the result so choosing nothing remains an option.
CodingMediumMakeMyTripSoftware Engineer

9. Reachable Nodes With Restrictions (LeetCode)

Model answer

The task

Given a tree with nodes numbered from 0 to n - 1, count how many nodes can be reached from node 0 without entering any restricted node.

Key idea

Build an adjacency list and traverse the tree from node 0. Skip restricted nodes, and count each allowed node the first time it is visited.

Approach

  1. Convert the edge list into an adjacency list.
  2. Put the restricted node labels in a set for quick lookup.
  3. Start a depth-first traversal at node 0, unless it is restricted.
  4. Mark each visited node and add its neighbors to the traversal only if they are not restricted or already visited.
  5. Return the number of visited nodes.
from typing import List

class Solution:
    def reachableNodes(
        self, n: int, edges: List[List[int]], restricted: List[int]
    ) -> int:
        graph = [[] for _ in range(n)]
        for a, b in edges:
            graph[a].append(b)
            graph[b].append(a)

        blocked = set(restricted)
        if 0 in blocked:
            return 0

        visited = {0}
        stack = [0]

        while stack:
            node = stack.pop()
            for neighbor in graph[node]:
                if neighbor not in blocked and neighbor not in visited:
                    visited.add(neighbor)
                    stack.append(neighbor)

        return len(visited)

Complexity:

  • Time: O(n + r), where r is the number of restricted nodes; building and traversing the tree takes O(n).
  • Space: O(n + r) for the adjacency list, visited set, and restricted set.

Common follow-ups

  • Can this use breadth-first search instead? Yes; replace the stack with a queue.
  • What if the graph is not a tree? A visited set still prevents revisiting nodes; traversal counts reachable allowed nodes.
  • What if node 0 is restricted? No node is reachable under the rule, so return 0.
  • Can restricted-node lookups be faster than scanning the list? Store them in a hash set, as above.
CodingMediumMakeMyTripSoftware Engineer

10. Merge Intervals (LeetCode)

Model answer

The task

Given a collection of intervals, combine every pair that overlaps and return the resulting non-overlapping intervals. The result should be ordered by starting point.

Key idea

Sort intervals by their start. Then scan once, keeping the most recently merged interval; each next interval either extends it or starts a new one.

Approach

  1. Sort the intervals by their start value.
  2. Initialize the result with the first interval, if any.
  3. For each remaining interval, compare its start with the end of the last result interval.
  4. If they overlap, update that end to the larger of the two ends.
  5. Otherwise, append the interval as a new result.
from typing import List

class Solution:
    def merge(self, intervals: List[List[int]]) -> List[List[int]]:
        if not intervals:
            return []

        intervals.sort(key=lambda interval: interval[0])
        merged = [intervals[0]]

        for start, end in intervals[1:]:
            # The intervals overlap, so extend the last merged interval.
            if start <= merged[-1][1]:
                merged[-1][1] = max(merged[-1][1], end)
            else:
                # No overlap: this interval begins a new merged range.
                merged.append([start, end])

        return merged

Complexity: Time: O(n log n), dominated by sorting n intervals.

Complexity: Space: O(n) for the merged result; sorting may also use up to O(n) space.

Common follow-ups

  • What if intervals that only touch at an endpoint should remain separate? Use start < merged[-1][1] as the overlap test.
  • How would you merge intervals as they arrive in sorted order? Skip sorting and apply the same scan, processing each interval once.
  • What if intervals are inserted one at a time into an already merged collection? Use binary search to find the insertion point, then merge neighboring overlaps.
Product & growthMediumMakeMyTripQA / SDET

11. How can you see the same ads on multiple sites—for example, after visiting Amazon.com and adding a product to your cart, seeing that product advert…

The full question

How can you see the same ads on multiple sites—for example, after visiting Amazon.com and adding a product to your cart, seeing that product advertised on Facebook?

Model answer

Clarify & scope

I’d explain this as retargeting: an advertiser tries to show relevant ads to people who previously interacted with its site. The exact product a person sees depends on available identifiers, consent, ad inventory, and the platform’s policies; it is not necessarily Amazon directly sending Facebook a list of shoppers.

User segments & pain points

The relevant segment is a shopper who viewed or added an item to a cart but did not purchase. The advertiser wants to remind them about the item, while the shopper may find repeated ads intrusive or be concerned about how their activity was linked.

Goals & success metrics

The advertiser’s goal is incremental purchases, measured through conversion lift against a control group—not just clicks or impressions. Guardrails include frequency per person, opt-out and complaint rates, privacy-policy compliance, and avoiding ads for items already purchased.

Solutions

  • Site tracking: Amazon, or an advertiser using a similar setup, can record an event such as add_to_cart through a site tag or server-side integration. A browser identifier may help associate later ad requests with that activity, subject to browser restrictions and user consent.
  • Audience matching: The advertiser can make an eligible audience available to an ad platform. Depending on permissions and platform rules, matching may use a browser identifier or privacy-protected account matching; the platform then selects an ad when that person visits a participating surface.
  • Ad delivery: The ad can be personalized to the product or category, and a frequency cap can limit how often it appears. Purchases or opt-outs should remove or suppress the shopper from the audience where supported.
flowchart LR
  A[Shopper visits store] --> B[Eligible activity recorded]
  B --> C[Audience matched under platform rules]
  C --> D[Shopper visits another site]
  D --> E[Ad auction selects relevant ad]
Diagram

Recommendation: Describe it as consent- and policy-governed audience matching plus ad selection, rather than as one site simply following a person everywhere. Tracking can be limited by cookie controls, private browsing, ad blockers, or platform restrictions.

Prioritization & trade-offs

I’d prioritize clear consent, purchase suppression, and frequency caps before increasing personalization. More data may improve relevance, but it also increases privacy risk and can reduce user trust.

MVP, measurement & rollout

Start with a consented audience and a small holdout group. Compare incremental conversion and revenue per eligible shopper, then review frequency, opt-outs, complaints, and policy compliance before expanding.

TechnicalEasyMakeMyTripQA / SDET

12. What are the different types of waits in Selenium?

Model answer

The main Selenium wait types are:

  1. Implicit wait — A session-wide timeout for finding elements. Selenium retries element lookup until the element appears or the timeout expires. ``java driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5)); ``
  2. Explicit wait — Waits for a specific condition, such as visibility, clickability, or a URL change. It is usually the clearest choice for synchronizing with a UI state. ``java WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); wait.until(ExpectedConditions.elementToBeClickable(By.id("continue"))).click(); ``
  3. Fluent wait — A configurable explicit wait: set the polling interval and exceptions to ignore. WebDriverWait is a specialized FluentWait<WebDriver>.
  4. Static wait (Thread.sleep) — Pauses for a fixed duration. It is not a Selenium wait and is generally a poor choice: it can waste time when the page is ready early and still fail when it is not ready after the pause.

Selenium also provides timeout settings for page loads and asynchronous scripts; these are separate from the element-wait types above. In most UI tests, prefer explicit waits for the exact condition and avoid mixing implicit and explicit waits.

TechnicalEasyMakeMyTripQA / SDET

13. What are fluent waits in Selenium?

Model answer

A fluent wait repeatedly checks a condition until it succeeds or a timeout expires. It lets you configure the total timeout, polling interval, and exceptions to ignore.

In Java, Selenium’s FluentWait<WebDriver> is the general-purpose implementation; WebDriverWait extends it and is commonly used with ExpectedConditions.

Wait<WebDriver> wait = new FluentWait<>(driver)
    .withTimeout(Duration.ofSeconds(15))
    .pollingEvery(Duration.ofMillis(500))
    .ignoring(NoSuchElementException.class);

WebElement result = wait.until(d -> {
    WebElement element = d.findElement(By.id("search-result"));
    return element.isDisplayed() ? element : null;
});

The wait polls every 500 ms, ignores a missing-element exception while polling, and returns the element when the condition is true. If the timeout expires, it throws a timeout exception.

Use fluent waits for UI states that can take a variable amount of time, such as search results loading. Avoid combining implicit and explicit waits, as their timeout behavior can become unpredictable.

TechnicalEasyMakeMyTripQA / SDET

14. What is the difference between a cache and cookies?

Model answer

A cache stores data temporarily so it can be reused without fetching or computing it again. Cookies are small pieces of data a website stores in a browser, commonly to maintain a session or remember preferences.

  • Purpose: Caches improve performance; cookies carry client-related state or identifiers.
  • Where they live: Browser caches may store files such as images and scripts. Cookies are stored by the browser and sent to matching servers with HTTP requests, subject to their scope and security settings.
  • Lifetime and control: Cache entries are governed by cache policies such as Cache-Control and validators such as ETag. Cookies have attributes such as Expires or Max-Age, Secure, HttpOnly, and SameSite.
  • Example: A MakeMyTrip logo image may be cached to load quickly; a session cookie may help the site recognize a signed-in user.

A cookie is not itself a cache, though browsers may cache responses that set cookies according to HTTP caching rules.

TechnicalEasyMakeMyTripQA / SDET

15. What is the difference between a class and an interface in Java?

Model answer

A class provides an implementation and can hold state; an interface defines a contract that implementing types agree to follow.

  • A class can have instance fields, constructors, and concrete methods. It can extend one class.
  • An interface cannot be instantiated and has no constructors. Its fields are implicitly public static final; it can declare abstract methods and, in modern Java, default, static, and private methods.
  • A class uses extends to inherit from a class and implements to fulfill interfaces. It can implement multiple interfaces, which supports multiple contracts without multiple class inheritance.
  • Use a class when modeling an implementation with state or shared behavior; use an interface when defining a capability that different classes can implement.

For example, PaymentProvider could be an interface implemented by separate card and wallet payment classes.

TechnicalEasyMakeMyTripQA / SDET

16. How would you replace all occurrences of a word in a Unix file?

Model answer

Use sed with the global substitution flag:

sed -i 's/old_word/new_word/g' file.txt

g replaces every match on each line. To avoid modifying the original, write to a temporary file and then replace it:

sed 's/old_word/new_word/g' file.txt > file.txt.tmp && mv file.txt.tmp file.txt

This treats the search text as a pattern. If you need to match a whole word only, use word-boundary syntax supported by your sed implementation, or use a tool such as Perl. Be careful with replacement text containing / or &; those characters need escaping in sed.

TechnicalEasyMakeMyTripQA / SDET

17. What is an entry set?

Model answer

entrySet() is a method on Java’s Map interface. It returns a Set<Map.Entry<K, V>> containing the map’s key-value pairs.

Map<String, Integer> counts = Map.of("flight", 3, "hotel", 5);

for (Map.Entry<String, Integer> entry : counts.entrySet()) {
    System.out.println(entry.getKey() + "=" + entry.getValue());
}

It is useful when you need both the key and value while iterating. The returned set is generally backed by the map, so changes to the map are reflected in it; whether entries can be modified depends on the map implementation.

TechnicalEasyMakeMyTripQA / SDET

18. What is the purpose of the top command?

Model answer

  1. top is an interactive, real-time view of processes running on a Unix-like system. It helps inspect system load and identify processes consuming resources.
  2. The summary typically shows uptime, load averages, CPU usage, memory, and swap. The process table commonly includes PID, user, CPU and memory usage, state, and command.
  3. It refreshes periodically; common keys include q to quit, P to sort by CPU, and M to sort by memory. It is useful for diagnosing high CPU or memory usage, but is a snapshot rather than a historical monitoring tool.
TechnicalEasyMakeMyTripQA / SDET

19. What are the purposes of the df and du commands?

Model answer

  • df reports filesystem-level disk space usage: total, used, and available capacity for mounted filesystems. For readable units, use df -h.
  • du estimates how much disk space files or directories consume. For example, du -sh directory/ gives a readable summary for that directory.

In short, use df to check space available on a filesystem and du to find which files or directories are using space.

TechnicalEasyMakeMyTripQA / SDET

20. Can WHERE and HAVING clauses be used in the same SQL query?

Model answer

Yes. WHERE filters individual rows before grouping and aggregation; HAVING filters the resulting groups after aggregation.

SELECT department_id, AVG(salary) AS average_salary
FROM employees
WHERE status = 'ACTIVE'
GROUP BY department_id
HAVING AVG(salary) > 50000;

This considers only active employees, groups them by department, then returns departments whose average salary exceeds 50,000.

Practice these out loud, don't memorise them

Reading an answer is not the same as being able to give one under pressure. ChannelPulse plays the interviewer, asks the follow-ups, and scores each answer with feedback and a model answer so you can hear the gap between what you said and what lands.

Get ChannelPulse Browse all questions