i
Myntra
Work with us
Filter interviews by
Use stack to keep track of indices of opening parentheses, update max length when closing parentheses found
Use a stack to keep track of indices of opening parentheses
When a closing parentheses is found, update max length by calculating the difference between current index and top of stack
Handle edge cases like extra closing parentheses or unmatched opening parentheses
Example: Input: "(()()", Output: 4 (for "()()")
Find the longest palindromic substring in a given string.
Use dynamic programming to check for palindromes within the string.
Start by checking for palindromes of length 1 and 2, then expand to longer substrings.
Keep track of the longest palindrome found so far.
LeetCode 1443 involves finding the minimum cost to collect apples from trees with given constraints.
Understand the problem: You need to collect apples from trees with a cost associated with each tree.
Use a greedy approach: Start from the last tree and move towards the first, minimizing costs.
Example: If costs are [1, 2, 3] and apples are [2, 3, 1], calculate the total cost based on the path taken.
Consider edge cas...
LRU cache is a data structure that stores the most recently used items, discarding the least recently used items when full.
Use a combination of a doubly linked list and a hashmap to efficiently implement LRU cache.
When an item is accessed, move it to the front of the linked list to mark it as the most recently used.
When adding a new item, check if the cache is full. If so, remove the least recently used item from ...
Indexing in MySQL improves the performance of database queries by creating a data structure that allows for faster data retrieval.
Indexes are created on one or more columns of a table.
They help in speeding up the search, sorting, and joining of data.
Indexes can be created using the CREATE INDEX statement.
Common types of indexes include B-tree, hash, and full-text indexes.
Indexes should be used judiciously as they ...
Yes, a constructor can be declared as private.
Declaring a constructor as private restricts its accessibility to only the class itself.
This can be useful in scenarios where you want to control the creation of objects of that class.
Private constructors are commonly used in singleton design pattern implementations.
Example: private constructor in a singleton class:
class Singleton { private Singleton() {} }
Triggers in MySQL are database objects that are automatically executed in response to specified events.
Triggers are used to enforce business rules, maintain data integrity, and automate tasks.
They can be defined to execute before or after an INSERT, UPDATE, or DELETE operation.
Triggers can be written in SQL or in a programming language like PL/SQL.
Examples of trigger events include inserting a new record, updating...
Session in PHP is a way to store and retrieve data for a user across multiple requests.
Sessions are used to maintain user-specific data on the server side.
A session is created for each user and is identified by a unique session ID.
Session data can be stored in server files or in a database.
Session variables can be accessed and modified throughout the user's session.
Sessions can be used to implement features like u...
GET is used to retrieve data from a server, while POST is used to send data to a server.
GET requests are idempotent, meaning they can be repeated without changing the result
POST requests are not idempotent and can have side effects on the server
GET requests can be cached by the browser, while POST requests cannot
GET requests have limitations on the amount of data that can be sent, while POST requests have no limit...
Static classes and variables are used to share data and methods across instances without needing to create an object.
Static Class: A class that cannot be instantiated and can only contain static members.
Example: In C#, a static class can be defined using 'static class ClassName {}'
Static Variable: A variable that retains its value across multiple instances of a class.
Example: In Java, a static variable is declared...
I applied via Job Fair and was interviewed in Dec 2024. There were 3 interview rounds.
OA test 3 Dsa questions 2 medium 1 hard you have to solve 1.5 questions in 120 minutes
Asteroid collision problem involves simulating the collision of asteroids moving in a line.
Asteroids are represented by integers, where positive values move right and negative values move left.
When two asteroids collide, the larger one survives; if they are equal, both are destroyed.
Example: [5, 10, -5] results in [5, 10] as -5 collides with 10 and is destroyed.
Example: [8, -8] results in [] as both asteroids are equal...
DSA 2 question
1 -> Find Lca and traverse a tree path available on GFG
2 -> LinkedList pallindrome check (you have to solve that in 0(1) space complexity)
I applied via Campus Placement and was interviewed in Aug 2024. There were 3 interview rounds.
Simple DSA ques. and some mcqs. were easy if you are a cp guy
Use stack to keep track of indices of opening parentheses, update max length when closing parentheses found
Use a stack to keep track of indices of opening parentheses
When a closing parentheses is found, update max length by calculating the difference between current index and top of stack
Handle edge cases like extra closing parentheses or unmatched opening parentheses
Example: Input: "(()()", Output: 4 (for "()()")
LeetCode 1443 involves finding the minimum cost to collect apples from trees with given constraints.
Understand the problem: You need to collect apples from trees with a cost associated with each tree.
Use a greedy approach: Start from the last tree and move towards the first, minimizing costs.
Example: If costs are [1, 2, 3] and apples are [2, 3, 1], calculate the total cost based on the path taken.
Consider edge cases: W...
Find the longest palindromic substring in a given string.
Use dynamic programming to check for palindromes within the string.
Start by checking for palindromes of length 1 and 2, then expand to longer substrings.
Keep track of the longest palindrome found so far.
Lexiography string manipulation
I was asked questions related to dynamic programming, strings, and one question about graphs.
The right view of a tree shows the nodes that are visible when looking at the tree from the right side.
The right view of a tree can be obtained by performing a level order traversal and keeping track of the rightmost node at each level.
Example: For a tree with nodes 1, 2, 3, 4, 5, the right view would be 1, 3, 5.
I applied via Referral and was interviewed before May 2023. There were 4 interview rounds.
3 sum and trapping rain water are common coding interview questions that test problem-solving skills.
3 sum problem involves finding three numbers in an array that add up to a target sum.
Trapping rain water problem involves calculating the amount of water that can be trapped between bars in an elevation map.
Both problems require efficient algorithms to solve.
A linked list can be implemented in a binary tree by using the left child as the next node and the right child as the previous node.
Each node in the binary tree will have a left child pointer and a right child pointer.
Traversal of the linked list can be done by following the left child pointers.
Example: In a binary tree, the left child of a node can point to the next node in the linked list.
LRU cache is a data structure that stores the most recently used items, discarding the least recently used items when full.
Use a combination of a doubly linked list and a hashmap to efficiently implement LRU cache.
When an item is accessed, move it to the front of the linked list to mark it as the most recently used.
When adding a new item, check if the cache is full. If so, remove the least recently used item from the e...
I appeared for an interview in Jul 2021.
Round duration - 60 minutes
Round difficulty - Easy
This was a online coding interview where I was asked coding questions.
Given an array PREORDER
representing the preorder traversal of a Binary Search Tree (BST) with N
nodes, construct the original BST.
Each element in the given...
Given preorder traversal of a BST, construct the BST and return its inorder traversal.
Create a binary search tree from the preorder traversal array
Return the inorder traversal of the constructed BST
Ensure each element in the array is distinct
Given a sorted array of length N
, your task is to construct a balanced binary search tree (BST) from the array. If multiple balanced BSTs are possible, you ca...
Construct a balanced binary search tree from a sorted array.
Create a function that recursively constructs a balanced BST from a sorted array.
Ensure that the left and right subtrees of each node differ in height by no more than 1.
Check if the constructed tree is a valid BST by verifying the properties of a BST.
Return 1 if the constructed tree is correct, otherwise return 0.
Round duration - 60 minutes
Round difficulty - Easy
This was a technical round. Programming based questions and oops/dbms based were asked.
Some questions were :
1. How many types of trigger?
Ans. In SQL, there are 3 types of triggers :
DML (data manipulation language) triggers – Eg.– INSERT, UPDATE, and DELETE
DDL (data definition language) triggers Eg.– CREATE, ALTER, and DROP
Logon triggers –This type reacts to LOGON events
2. Can trigger be used with select statement?
Ans. No, triggers cannot be used with select statements. They can only be used with Insert, update or delete statements.
3. Indexing in mysql? How many types of indexing in mysql?
Ans. Indexes are used to find rows with specific column values quickly. It helps to determine the position to seek to in the middle of the data file without having to look at all the data. It performs much faster than reading every row sequentially.
4. Engines in mysql?
Ans. So, in mysql, storage engine is a software module that a database management system uses to create, read, update data from a database. There are two types of storage engines: transactional and non-transactional.
5. Singleton pattern?
Ans. Singleton is a creational design pattern that ensured that a class has only one instance, while providing a global access point to this instance.
You are given an integer array 'ARR' of size 'N' and an integer 'S'. Your task is to find and return a list of all pairs of elements where each sum of a pair equals 'S'.
Find pairs of elements in an array that sum up to a given value, sorted in a specific order.
Iterate through the array and use a hashmap to store the difference between the target sum and each element.
Check if the difference exists in the hashmap, if so, add the pair to the result list.
Sort the result list based on the criteria mentioned in the problem statement.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
I appeared for an interview before Dec 2020.
Round duration - 120 minutes
Round difficulty - Easy
This was a 2 hour round consisting of 5 mcqs and 2 codes. The mcqs were pretty much simple based on DS, DBMS, OS, OOP, and C language.
Transform a given Binary Tree into a Doubly Linked List.
Ensure that the nodes in the Doubly Linked List follow the Inorder Traversal of the Binary Tree.
The fi...
Convert a Binary Tree into a Doubly Linked List following Inorder Traversal.
Perform Inorder Traversal of the Binary Tree to get the nodes in order.
Create a Doubly Linked List by connecting the nodes in the order obtained from Inorder Traversal.
Return the head of the Doubly Linked List.
Given a binary tree with N
nodes, determine whether the tree is a Binary Search Tree (BST). If it is a BST, return true
; otherwise, return false
.
A binary search tree (BST)...
Validate if a given binary tree is a Binary Search Tree (BST) or not.
Check if the left subtree of a node contains only nodes with data less than the node's data.
Check if the right subtree of a node contains only nodes with data greater than the node's data.
Ensure that both the left and right subtrees are also binary search trees.
Round duration - 60 minutes
Round difficulty - Easy
3 coding questions were asked in this round.
You are given an unsorted array ARR
. Your task is to sort it so that it forms a wave-like array.
The first line contains an integer 'T', the number of test cases.
For ea...
Sort an array in a wave-like pattern where each element is greater than or equal to its neighbors.
Iterate through the array and swap elements to form the wave pattern.
Start by sorting the array in non-decreasing order.
Then, swap adjacent elements to form the wave pattern.
Return the modified array as the output.
Given a sorted array that has been rotated clockwise by an unknown amount, you need to answer Q
queries. Each query is represented by an integer Q[i]
, and you must ...
Search for integers in a rotated sorted array efficiently.
Given a rotated sorted array, perform binary search for each query integer.
Maintain left and right pointers to search efficiently.
Return the index of the integer if found, else return -1.
Given a stream of integers, calculate and print the median after each new integer is added to the stream.
Output only the integer part of the median.
N = 5
Stre...
Calculate and print the median after each new integer is added to the stream of integers.
Use a min heap to store the larger half of the numbers and a max heap to store the smaller half.
Keep the sizes of the two heaps balanced to efficiently calculate the median.
When a new integer is added, adjust the heaps accordingly and calculate the median.
Output only the integer part of the median after each new integer is added.
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
I appeared for an interview before Dec 2020.
Round duration - 60 minutes
Round difficulty - Medium
It was a 60 minute online coding interview where programming questions were discussed.
Given a singly linked list of integers, return the head of the reversed linked list.
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed link...
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 instead of the next node.
Use three pointers to 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 the reversal process.
Given an array ARR
consisting of N
integers, rearrange the elements such that all negative numbers are located before all positive numbers. The orde...
Yes, this can be achieved by using a two-pointer approach to rearrange the array in-place with O(1) auxiliary space.
Use two pointers, one starting from the beginning and one from the end of the array.
Move the left pointer to the right until it encounters a positive number, and the right pointer to the left until it encounters a negative number.
Swap the elements at the left and right pointers, and continue this process ...
Round duration - 60 minutes
Round difficulty - Easy
Questions based on data structures , OOPS , Java and operating systems were discussed.
Given a binary tree of integers, convert it to a sum tree where each node is replaced by the sum of the values of its left and right subtrees. Set leaf nodes to zero.
...Convert a binary tree to a sum tree by replacing each node with the sum of its left and right subtrees, setting leaf nodes to zero.
Traverse the tree in postorder fashion to calculate the sum of left and right subtrees for each node.
Set leaf nodes to zero and update the value of each node to the sum of its children.
Return the level order traversal of the modified tree.
String pool in Java is a special memory area where String literals are stored to optimize memory usage. Garbage collection in Java is a process of reclaiming memory occupied by objects that are no longer in use.
String pool is a special area in Java heap memory where String literals are stored to avoid duplicate objects.
When a new String is created using double quotes, Java first checks the String pool to see if an iden...
You can synchronize a HashMap in Java using the synchronizedMap() method from the Collections class.
Use synchronizedMap() method to create a synchronized HashMap: Map<String, String> syncMap = Collections.synchronizedMap(new HashMap<>());
Alternatively, you can use ConcurrentHashMap which is thread-safe and does not require external synchronization.
Ensure proper synchronization to avoid concurrent modificati...
Round duration - 45 minutes
Round difficulty - Medium
This was CTO round, if you make this round…you are doing pretty good.
He asked a lot on what I worked on and asked questions relevant to that. Process thread, stacks heaps. A minor system design on component in their system. How they are shared between and trade-off. We discussed about scalability and challenge.
One-to-one mapping involves a single relationship between two entities, while one-to-many mapping involves a single entity being related to multiple entities.
One-to-one mapping: each record in one table is related to only one record in another table.
One-to-many mapping: each record in one table can be related to multiple records in another table.
In one-to-one mapping, a foreign key is used to establish the relationship...
A process is an independent entity that contains its own memory space and resources, while a thread is a subset of a process that shares the same memory space and resources.
A process has its own memory space, while threads within a process share the same memory space.
Processes are independent entities, while threads are subsets of processes.
Processes have their own resources like file descriptors and sockets, while thr...
Tip 1 : Must do Previously asked Interview as well as Online Test Questions.
Tip 2 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 3 : Do at-least 2 good projects and you must know every bit of them.
Tip 1 : Have at-least 2 good projects explained in short with all important points covered.
Tip 2 : Every skill must be mentioned.
Tip 3 : Focus on skills, projects and experiences more.
Top trending discussions
Some of the top questions asked at the Myntra Software Developer interview -
based on 7 interview experiences
Difficulty level
Duration
based on 7 reviews
Rating in categories
Data Analyst
284
salaries
| ₹6 L/yr - ₹14 L/yr |
Senior Manager
213
salaries
| ₹19.2 L/yr - ₹32 L/yr |
Manager
209
salaries
| ₹11 L/yr - ₹18.4 L/yr |
Senior Assistant
206
salaries
| ₹1.4 L/yr - ₹5.3 L/yr |
Associate
199
salaries
| ₹6 L/yr - ₹11.8 L/yr |
Flipkart
Amazon
Meesho
LimeRoad