Myntra interview questions

160 questions from 21 interviews · updated from reports 2014-2024

Practise Myntra-style

About

Myntra is an Indian e-commerce platform for fashion and lifestyle products, including clothing, footwear, accessories, and beauty items. In India, it commonly hires Software Engineers, Software Engineering Interns, and Senior Software Engineers for product, backend, mobile, and data-related teams.

The roles that come up most are Software Engineer, Software Engineering Intern and Senior Software Engineer. This covers 21 candidate interviews reported from 2014 to 2024. The largest group sat it at entry level (8 of 20 that recorded a level), with 6 internship interviews alongside. Among the 9 that recorded either route, arrivals split between campus drives (8, 89%) and off-campus applications (1, 11%). Most questions fall under DSA and CS fundamentals.

Category
Difficulty
Round

Interview questions

Q. Find the minimum number of platforms required for a railway station given arrival and departure times

asked 2xmediumGreedyTechnical2020-2021

Ans. Use sorting and a two pointer sweep to find the maximum number of trains present at the station at the same time. Sort arrival times and departure times separately, then move through them: if the next arrival is before or at the next departure, need one more platform; otherwise free one. Time complexity is O(n log n).

Q. Merge k sorted arrays

asked 1xmediumArraysTechnical2019

Ans. Use a min heap to repeatedly take the smallest current element among the k arrays and append it to the result. Initially push the first element of each non-empty array with its array index and position. After popping one, push the next element from the same array. Time complexity is O(N log k), where N is total elements.

Q. Evaluate an infix expression.

asked 1xmediumStacksTechnical2016

Ans. Use two stacks: one for operands and one for operators. Scan left to right, push numbers, handle opening brackets, and before pushing an operator, apply any stacked operator with higher or equal precedence. On closing brackets, apply until the matching opening bracket. This evaluates the expression in O(n) time and O(n) space.

Q. Design and implement an LRU Cache.

asked 1xmediumDesignTechnical2020

Ans. Implement an LRU cache with a hash map from key to list node and a doubly linked list ordered by recent use. On get, return the value and move the node to the front. On put, update or insert at the front. If capacity is exceeded, remove the tail. Both operations are O(1).

Q. Find an element in a bitonic array

asked 1xmediumBinary searchTechnical2019

Ans. Find the peak using binary search, then binary search the increasing left half and the decreasing right half for the target. The key detail is that comparisons differ on each side: normal binary search on the left, reversed binary search on the right. This takes O(log n) time and O(1) space.

Q. Implement a min-heap using an array.

asked 1xmediumHeapTechnical2020

Ans. Use an array where the minimum element is always at index 0. For 0-based indexing, parent is (i - 1) / 2, left child is 2i + 1, and right child is 2i + 2. Insert by bubbling up. Remove min by swapping with the last element, deleting it, then heapifying down. Both take O(log n).

Q. Delete a node from a Binary Search Tree.

asked 1xmediumTreesTechnical2015

Ans. Delete by searching for the key, then handle three cases: leaf, one child, or two children. A leaf is removed directly, and a node with one child is replaced by that child. For two children, replace its value with the inorder successor or predecessor, then delete that replacement node. Time is O(h), space O(h) recursively.

Q. Find the k-th largest element in an array

asked 1xmediumArraysTechnical2016

Ans. Use a min-heap of size k: insert each element, and whenever the heap grows beyond k, remove the smallest. After processing the array, the heap root is the k-th largest element. This takes O(n log k) time and O(k) space, and handles duplicates naturally.

Q. Reverse a linked list in groups of size k

asked 1xmediumLinked listsTechnical2015

Ans. Reverse each block of k nodes by rewiring next pointers, then connect the previous block’s tail to the new head of the reversed block. Use three pointers to reverse a block in place, and first check that k nodes remain if partial groups should stay unchanged. Time complexity is O(n), space complexity is O(1).

Q. Explain different CPU scheduling algorithms

asked 1xmediumOperating systemsTechnical2015

Ans. CPU scheduling algorithms decide which ready process runs next. Common ones are First Come First Served, Shortest Job First, Priority Scheduling, Round Robin, and Multilevel Queue. The key trade-off is between fairness, response time, throughput, and starvation. Preemptive algorithms can interrupt running processes, while non-preemptive ones wait until completion or blocking.

Q. Add two numbers represented by linked lists.

asked 1xmediumLinked listsTechnical2016

Ans. Use a dummy head and add corresponding digits while carrying overflow, creating one result node per digit. Traverse both lists together, treating missing digits as zero, and continue while either list has nodes or carry remains. This handles different lengths and final carry. Time is O(max(m, n)); extra space is the output list.

Q. Find the point where maximum intervals overlap

asked 1xmediumArraysTechnical2019

Ans. Use a sweep line: turn each interval into two events, start adds 1 and end subtracts 1, then sort events by position and scan while tracking the current and maximum count. For closed intervals, process starts before ends at the same coordinate. The position where the maximum is first reached is the answer. Time is O(n log n).

Q. Rotate a square matrix by 90 degrees clockwise.

asked 1xmediumArraysTechnical2021

Ans. Transpose the matrix, then reverse each row to rotate it 90 degrees clockwise. The transpose swaps matrix[i][j] with matrix[j][i] across the main diagonal, and reversing each row moves columns into their final rotated positions. This uses the existing 2D array in place, with O(n²) time and O(1) extra space.

Q. Check whether two given line segments intersect.

asked 1xmediumGeometryTechnical2020

Ans. Use orientation tests on the two endpoints of each segment. Segments AB and CD intersect if C and D lie on different sides of AB and A and B lie on different sides of CD. The key detail is handling collinear cases separately by checking whether a collinear point lies within the other segment’s bounding box. Time is O(1).

Q. Find the Longest Bitonic Subsequence in an array

asked 1xmediumDynamic programmingTechnical2019

Ans. Compute the longest increasing subsequence ending at each index and the longest decreasing subsequence starting at each index, then maximise LIS[i] + LDS[i] - 1. The subtraction avoids counting the peak twice. Using dynamic programming with nested loops takes O(n²) time and O(n) space; binary search optimisation is possible but more complex.

Q. Design and build the logic for a chess application

asked 1xmediumApplication designSystem design2021

Ans. Model the board as 64 squares holding pieces, with a game state tracking side to move, castling rights, en passant target, move clocks and history. Generate pseudo-legal moves per piece, then filter moves that leave the king in check. This handles checkmate, stalemate, promotion, castling and en passant correctly. Move generation is roughly constant bounded work per turn.

Q. Print all ancestors of a given node in a binary tree.

asked 1xmediumTreesTechnical2014

Ans. Use a depth first search from the root, and print a node when the target is found in either its left or right subtree. The recursion returns true if the target exists below the current node. This uses the call stack only, takes O(n) time, and O(h) space.

Q. Find the Lowest Common Ancestor (LCA) in a Binary Tree

asked 1xmediumTreesTechnical2021

Ans. Use a recursive DFS: if the current node is null, p, or q, return it. Recurse into left and right. If both sides return non-null, the current node is the LCA. Otherwise return the non-null side. This uses the call stack and runs in O(n) time, with O(h) space.

Q. Write a C program to implement the Heap Sort algorithm

asked 1xmediumSortingTechnical2016

Ans. Implement Heap Sort in C by storing the elements in an array, building a max heap, then repeatedly swapping the root with the last unsorted element and heapifying the reduced heap. The key detail is maintaining the heap property after each swap. Time complexity is O(n log n), with O(1) extra space.

Q. Design and implement Google Auto-Suggest functionality.

asked 1xmediumTrieTechnical2014

Ans. Use a distributed trie or prefix index where each node stores the top K ranked suggestions for that prefix. On each query, fetch the prefix node and return cached results in O(length of prefix). Build rankings from query frequency, freshness, location and personalisation. Shard by prefix, cache hot prefixes, and update scores asynchronously from logs.

Q. Explain the basic idea behind Google's ranking algorithm.

asked 1xmediumSearchSystem design2014

Ans. Google’s basic ranking idea, PageRank, is to rank pages by both relevance to a query and the authority implied by links from other pages. A link acts like a vote, but votes from important pages count more. In practice, Google also uses many other signals such as content quality, freshness, location and user intent.

Q. Find the sum of all the deepest leaf nodes in a binary tree.

asked 1xmediumTreesTechnical2021

Ans. Use level order traversal and keep replacing the sum with the sum of the current level, so the last recorded sum is the answer. Store nodes in a queue, process one level at a time, and add only that level’s node values. This takes O(n) time and O(w) space, where w is maximum width.

Q. Design APIs to find a parking slot for a given vehicle number

asked 1xmediumApi designSystem design2019

Ans. Expose an API like GET /parking/vehicles/{vehicleNumber}/slot that returns the current slot, level, status, and entry time for that vehicle. Maintain a vehicleNumber to activeTicket or slot mapping, updated on park and exit APIs. The key detail is indexing vehicle number for constant time lookup, rather than scanning all slots.

Q. Design an API to dynamically position components on a web page

asked 1xmediumApi designSystem design2021

Ans. Expose a layout API where clients send component IDs, sizes, constraints and viewport, and receive absolute or grid positions plus z-index. Model the page as a tree of containers with flex, grid or anchor rules. The key detail is deterministic conflict resolution, so overlapping, resizing and responsive breakpoints produce stable, cacheable layouts.

Q. Count all distinct pairs in an array with a given difference k.

asked 1xmediumArraysTechnical2020

Ans. Use a hash set or frequency map and count value pairs, not index pairs. For k greater than 0, insert all values, then count each distinct x where x + k exists. For k equal to 0, count values with frequency at least two. This runs in O(n) time and O(n) space.

Q. Design a way to find all parking slots for a given vehicle color

asked 1xmediumData modelingSystem design2019

Ans. Maintain an index from vehicle colour to a set of occupied parking slot IDs. When a vehicle parks, add its slot to the colour’s set; when it leaves, remove it. Store colours in a normalised form, such as lowercase. Lookup returns the set in constant time, plus time to output results.

Q. Explain how auto-suggest and auto-correct work in mobile phones.

asked 1xmediumStringsSystem design2014

Ans. Auto-suggest predicts likely next words or completions from the typed prefix, while auto-correct replaces probable mistakes with the closest intended word. Phones use dictionaries, often stored in tries for fast prefix lookup, plus language models that rank candidates using context, frequency and personal habits. Corrections commonly use edit distance and keyboard-neighbour errors.

Q. Find the first non-repeating character in a stream of characters

asked 1xmediumStringsTechnical2019

Ans. Use a frequency map and a queue of candidate characters, updating both as each stream character arrives. Increment the character’s count, push it into the queue if first seen, then remove queue front items whose count is greater than one. The queue front is the current first non-repeating character. Each update is O(1) amortised time.

Q. Perform zig-zag (spiral) level order traversal of a binary tree.

asked 1xmediumTreesTechnical2014

Ans. Use breadth first search with a queue, processing the tree level by level and reversing the direction after each level. Store values for the current level in a list, append left to right or right to left depending on a flag, then flip it. Time complexity is O(n), space is O(n).

Q. Given a stream of integers, find the median at any point in time.

asked 1xmediumHeapsTechnical2014

Ans. Use two heaps: a max heap for the lower half of numbers and a min heap for the upper half. Keep their sizes equal, or let one heap have one extra element. The median is the top of the larger heap, or the average of both tops. Insertion is O(log n), median lookup is O(1).

Q. Write a C program to detect a loop in a linked list and remove it

asked 1xmediumLinked listsTechnical2016

Ans. Use Floyd’s slow and fast pointer method to detect a loop, then find the loop start and set the last node in the loop to NULL. After slow and fast meet, move one pointer to head and advance both one step until they meet. Then traverse the loop to find its previous node. Time is O(n), space is O(1).

Q. Given an array of numbers, arrange them to form the biggest number

asked 1xmediumSortingTechnical2021

Ans. Sort the numbers as strings using a custom comparator: for two values a and b, put a before b if the concatenation ab is larger than ba. Then join the sorted strings. The key detail is handling all zeros, where the result should be “0”. Time complexity is O(n log n) comparisons.

Q. How do you choose between relational and non-relational databases?

asked 1xmediumDBMSSystem design2019

Ans. Choose a relational database when the data is structured, relationships matter, and you need strong consistency, joins, and transactions. Choose a non-relational database when the data shape changes often, scale-out and high write throughput are more important, or the access pattern fits documents, key-value, wide-column, or graph storage.

Q. Populate next right pointers in a binary tree using O(1) extra space.

asked 1xmediumTreesTechnical2020

Ans. Use the already populated next pointers to traverse each level, while building the next level’s links with a dummy head and tail pointer. For each node on the current level, attach its left and right children to tail. Move to dummy.next for the next level. Time is O(n), extra space is O(1).

Q. Count the number of nodes present at the maximum depth in an N-ary tree

asked 1xmediumTreesTechnical2021

Ans. Use level order traversal and return the size of the last level visited. Keep a queue of nodes, process the tree level by level, and store the number of nodes in the current level before expanding their children. When the queue becomes empty, that last stored count is the answer. Time is O(n), space is O(w).

Q. Design a bus reservation system, defining classes and member functions.

asked 1xmediumObject oriented designSystem design2015

Ans. Define classes Bus, Route, Trip, Seat, Passenger, Booking and Payment, with services SearchService, BookingService and PaymentService. Key functions are searchTrips(source, destination, date), getAvailableSeats(tripId), holdSeats(user, seats), confirmBooking(holdId, payment), cancelBooking(bookingId) and issueRefund. The critical detail is concurrency: seat holds must be atomic with expiry to prevent double booking.

Q. Construct a Binary Search Tree given its preorder and inorder traversals.

asked 1xmediumTreesTechnical2015

Ans. Build the tree by taking the next preorder value as the root, finding it in inorder, then recursively building the left and right subtrees from the inorder split. Use a hashmap from value to inorder index and a shared preorder pointer. This gives O(n) time and O(n) extra space.

Q. Search for a target element in a rotated sorted array using binary search.

asked 1xmediumBinary searchTechnical2021

Ans. Use modified binary search: compare the middle element with the ends to decide which half is sorted, then check whether the target lies inside that sorted half and discard the other half. Repeat until found or range is empty. It uses the array in place, runs in O(log n) time and O(1) space.

Q. Given a sorted array that has been rotated, find a given element in the array.

asked 1xmediumBinary searchTechnical2014

Ans. Use a modified binary search to find the element in O(log n) time and O(1) space. At each step, compare the middle value with the ends to identify which half is sorted, then decide whether the target lies in that half or the other half.

Q. Explain the CAP Theorem in the context of systems with multiple entries and exits

asked 1xmediumDistributed systemsSystem design2019

Ans. CAP says a distributed system with multiple nodes handling reads and writes cannot guarantee consistency, availability, and partition tolerance all at once during a network split. The key detail is that partition tolerance is unavoidable in real distributed systems, so designers usually choose between consistent but sometimes unavailable, or available but sometimes stale responses.

Q. Given a string containing HTML tags, remove all substrings enclosed within < and >

asked 1xmediumStringsTechnical2016

Ans. Scan the string once and build a result containing only characters outside tags. Use a boolean flag, initially false; set it true when you see <, set it false after >, and append characters only when the flag is false. This uses a string builder and runs in O(n) time.

Q. Design a stack that supports O(1) insertion, deletion, and find minimum operations.

asked 1xmediumStacksTechnical2015

Ans. Use two stacks: a normal stack for values and an auxiliary stack for current minimums. On push, also push the value to the min stack if it is less than or equal to the current minimum. On pop, remove from the min stack if the popped value equals its top. Push, pop, and getMin are O(1).

Q. Find the second largest element in an array and explain the approach using heap sort

asked 1xmediumSortingTechnical2015

Ans. Build a max heap from the array, remove the largest element once, and the new heap root is the second largest element. This uses the heap structure from heap sort without fully sorting the array. Building the heap takes O(n), removing the maximum takes O(log n), and space is O(1) if done in place.

Q. Implement insert and delete operations in a binary tree and explain all delete cases.

asked 1xmediumTreesTechnical2014

Ans. Insert in a binary search tree by comparing keys and walking left or right until a null child is found. Delete has three cases: remove a leaf directly, replace a node with its only child, or for two children replace its value with the inorder successor or predecessor, then delete that node. Time is O(h).

Q. Given a biased coin of unknown bias, how would you make an unbiased decision using it?

asked 1xmediumProbabilityManagerial2015

Ans. Toss the coin twice. If the result is heads then tails, choose option A. If it is tails then heads, choose option B. If it is heads heads or tails tails, ignore it and try again. This is fair because heads tails and tails heads both have probability p(1-p).

Q. Search for a given number in a sorted array that has been rotated at an unknown pivot.

asked 1xmediumBinary searchTechnical2016

Ans. Use a modified binary search. At each step, compare the middle element with the left and right ends to find which half is sorted, then check whether the target lies inside that sorted half and discard the other half. This keeps the search in O(log n) time and O(1) space for distinct elements.

Q. Convert a string into zigzag pattern given a number of rows and then read line by line.

asked 1xmediumStringsOnline test2020

Ans. Simulate writing the characters row by row while moving down and then up between the rows, then join the rows in order. Use an array of strings, one per row, and a direction flag that flips at the top and bottom rows. This runs in O(n) time and uses O(n) space.

Q. Find the length of the longest substring in a given string without repeating characters.

asked 1xmediumStringsTechnical2024

Ans. Use a sliding window with two pointers and a map from character to its last seen index. Move the right pointer through the string, and when a repeated character appears inside the current window, move the left pointer just after its previous position. Track the maximum window length. This runs in O(n) time.

Q. Explain differences between C and C# with emphasis on executable files and runtime behavior

asked 1xmediumOOPSystem design2015

Ans. C is usually compiled directly into a native executable for a specific platform, while C# is compiled into intermediate language in a .NET assembly that runs under the CLR. At runtime, C# depends on the .NET runtime for JIT compilation, garbage collection, type safety and exception handling, whereas C has minimal runtime support.

Q. Print all leaf nodes of a binary tree where leaf nodes are connected as a doubly linked list.

asked 1xmediumTreesTechnical2014

Ans. Traverse the binary tree and, whenever a node has no left or right child, print it or append it to the leaf doubly linked list. Keep two pointers, head and previous, to connect leaves in order. An inorder traversal prints leaves from left to right. Time complexity is O(n), with O(h) recursion space.

Q. Find the minimum number of platforms required for a railway/bus station so that no train waits

asked 1xmediumGreedyTechnical2021

Ans. Sort all arrival times and departure times separately, then scan them with two pointers, counting active trains. If the next arrival is before or at the next departure, one more platform is needed; otherwise one is freed. Track the maximum active count. This uses arrays only and runs in O(n log n) time.

Q. Given stock prices, find the maximum profit that can be achieved by buying and selling stocks.

asked 1xmediumArraysTechnical2020

Ans. Track the lowest price seen so far and the best profit from selling at each current price. For each day, update the minimum buy price, then update maximum profit using current price minus that minimum. No extra data structure is needed beyond two variables. Time complexity is O(n), space complexity is O(1).

Q. Write a program to compute 100! and explain how to store such a large number and its data type

asked 1xmediumLogical reasoningTechnical2016

Ans. Compute 100! by multiplying numbers 1 to 100 while storing the result in an arbitrary precision integer. Primitive types like int, long or double cannot store all 158 digits exactly. Use BigInteger in languages that provide it, or store digits in an array or vector and implement multiplication with carry. Time complexity is O(n × d).

Q. Design a program that reads a book from a file and generates an audio version of the entire book

asked 1xmediumApplication designSystem design2021

Ans. Build a pipeline that ingests the book file, extracts and normalises text, splits it into speech-sized chunks, sends each chunk to a text-to-speech engine, then concatenates the audio files into chapters or one final audiobook. The key detail is chunking with stable ordering and metadata, so failures can be retried without regenerating everything.

Q. Find the minimum number of steps required to reach a target position by a knight on a chessboard

asked 1xmediumGraphsTechnical2019

Ans. Use breadth first search from the knight’s start position, because each knight move has equal cost and BFS finds the shortest path in an unweighted graph. Put positions and their distance in a queue, mark visited squares, and try all eight knight moves. Time is O(rows × columns), with the same space for visited.

Q. Given an array and a maximum jump length K, find the maximum score to reach the end of the array.

asked 1xmediumDynamic programmingOnline test2020

Ans. Use dynamic programming with a monotonic deque to keep the best reachable score from the last K positions. Let dp[i] be nums[i] plus the maximum dp value among valid previous indices. The deque stores indices with decreasing dp values, removing expired indices. This runs in O(n) time and O(k) space.

Q. Given a non-transparent cylindrical glass of water with no measuring instruments, how can you determine whether it is more than half-filled or less than half-filled without adding or spilling water?

asked 1xmediumLogical reasoningManagerial2015

Ans. Tilt the cylindrical glass slowly until the water just reaches the rim but does not spill. Look at the bottom inside the glass. If any part of the bottom is exposed, it is less than half full. If the bottom remains covered, it is more than half full. At exactly half, the water plane reaches the rim and the opposite bottom edge.

Q. Probability problem with two players A and B having m and n cards respectively out of m+n+1 cards, one card left out. Players alternately guess the left-out card. What is the probability that player A wins? Output probability accurate to 9 decimal places.

asked 1xhardProbabilityOnline test2017

Ans. Assume A guesses first. Fix random orders in which A would try his n+1 possible cards and B his m+1 possible cards. The hidden card’s positions are independent uniform values i and j. A wins iff i <= j. Therefore compute P(i <= j), then print to 9 decimals using the closed form or summation.

Q. Reverse a linked list

asked 1xeasyLinked listsTechnical2016

Ans. Reverse a linked list by iterating through it and changing each node’s next pointer to point to the previous node. Keep three pointers: previous, current, and next, so you do not lose the rest of the list. At the end, previous is the new head. Time complexity is O(n), space complexity is O(1).

Q. What defines a good team versus a bad team?

asked 1xunknownTeamworkHR2020

Ans. A strong answer defines good teams by trust, clear goals, accountability, respectful challenge, and shared ownership. Pick a real team experience where behaviours affected results. Emphasise how communication, decision making, and handling conflict shaped outcomes. Interviewers listen for self-awareness, collaboration, and whether you recognise that culture is built through daily actions.

Showing 60 of 160 questions. Ranked by how often the same question came back across interviews.

Practise a Myntra-style interview

A spoken interview built from these questions, scored when you finish; the feedback is yours.

Start practising

When you are ready, record The One: a single interview hiring teams watch, so you stop repeating first rounds.

Common questions

What questions does Myntra ask?

Candidate interviews most often cover DSA (71%) and CS fundamentals (13%).

How many rounds does Myntra interview have?

Candidate interviews show an average of 3.6 rounds per experience, with a typical sequence of Online test → Technical → Technical. Individual interview paths can vary.

Is the Myntra interview hard?

Among questions with a recorded difficulty, the mix is easy 28%, medium 55%, hard 16%.