Myntra pvt ltd interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Myntra pvt ltd
upvote
share-icon
2 rounds | 3 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 10 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practice on coding platforms like Leetcode, GFG etc.
Tip 2 : Have a clear understanding of all core subjects.
Tip 3 : Do atleast 2 projects.

Application process
Where: Company Website
Eligibility: Above 7 CGPA
Resume Tip
Resume tip

Tip 1 : Make a short 1 page resume.
Tip 2 : Focus more on work experience, projects and skills.

Interview rounds

01
Round
Medium
Video Call
Duration60 minutes
Interview date14 Sep 2021
Coding problem2

The interviewer started with basic introduction and then moved to discussing 2 coding problems.

1. Trapping Rain Water

Moderate
15m average time
80% success
0/80
Asked in companies
HCL TechnologiesCiti BankAtlassian

You have been given a long type array/list 'arr’ of size 'n’.


It represents an elevation map wherein 'arr[i]’ denotes the elevation of the 'ith' bar.



Note :
The width of each bar is the same and is equal to 1.
Example:
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].

Output: 10

Explanation: Refer to the image for better comprehension:

Alt Text

Note :
You don't need to print anything. It has already been taken care of. Just implement the given function.
Problem approach

Basic Insight: 
An element of the array can store water if there are higher bars on the left and right. The amount of water to be stored in every element can be found out by finding the heights of bars on the left and right sides. The idea is to compute the amount of water that can be stored in every element of the array.
Algorithm: 
Create two arrays left and right of size n. create a variable max_ = INT_MIN.
Run one loop from start to end. In each iteration update max_ as max_ = max(max_, arr[i]) and also assign left[i] = max_
Update max_ = INT_MIN.
Run another loop from end to start. In each iteration update max_ as max_ = max(max_, arr[i]) and also assign right[i] = max_
Traverse the array from start to end.
The amount of water that will be stored in this column is min(a,b) – array[i],(where a = left[i] and b = right[i]) add this value to total amount of water stored
Print the total amount of water stored.

Try solving now

2. Longest Substring Without Repeating Characters

Moderate
20m average time
80% success
0/80
Asked in companies
AmazonInfo Edge India (Naukri.com)Oracle

Given a string 'S' of length 'L', return the length of the longest substring without repeating characters.

Example:

Suppose given input is "abacb", then the length of the longest substring without repeating characters will be 3 ("acb").
Problem approach

The brute force approach would be to consider all substrings one by one and check for each substring whether it contains all unique characters or not. There will be n*(n+1)/2 substrings. Time complexity of this solution would be O(n^3).

For an efficient solution, a hashmap can be used. Maintain a hashmap which stores the characters in string as keys and their indexes(positions) as values, and keep two pointers which define the max substring. move the right pointer to traverse through the string, and meanwhile update the hashmap. If the character is already in the hashmap, then move the left pointer to the right of the same character last found. Keep updating the max length Non-Repeating Character Substring seen so far.

Try solving now
02
Round
Medium
Video Call
Duration40 minutes
Interview date14 Sep 2021
Coding problem1

This was also a data structure based round. A long discussion went on the first question. However, I was not able to solve the complete question.

1. Flatten Binary Tree to Linked List

Moderate
25m average time
70% success
0/80
Asked in companies
AppleMicrosoftSalesforce

You are given a binary tree consisting of 'n' nodes.


Convert the given binary tree into a linked list where the linked list nodes follow the same order as the pre-order traversal of the given binary tree.


Use the right pointer of the binary tree as the “next” pointer for the linked list and set the left pointer to NULL.


Use these nodes only. Do not create extra nodes.


Example :
Input: Let the binary be as shown in the figure:

Example Tree

Output: Linked List: 15 -> 40 -> 62 -> 10 -> 20 -> NULL

Explanation: As shown in the figure, the right child of every node points to the next node, while the left node points to null.

Also, the nodes are in the same order as the pre-order traversal of the binary tree.
Problem approach

I was not able to solve this question.

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

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
SDE - 1
4 rounds | 11 problems
Interviewed by Myntra pvt ltd
1974 views
0 comments
0 upvotes
SDE - 1
2 rounds | 4 problems
Interviewed by Myntra pvt ltd
2099 views
0 comments
0 upvotes
SDE - 1
3 rounds | 5 problems
Interviewed by Myntra pvt ltd
2319 views
0 comments
0 upvotes
SDE - 1
3 rounds | 3 problems
Interviewed by Myntra pvt ltd
2728 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58237 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes