i
Myntra
Filter interviews by
I was interviewed in Sep 2021.
Round duration - 60 Minutes
Round difficulty - Easy
You are given the head node of a singly linked list. Your task is to return a pointer pointing to the middle of the linked list.
If there is an odd number of elements, return the ...
Given the head node of a singly linked list, return a pointer to the middle node. If there are an odd number of elements, return the middle element. If there are even elements, return the one farther from the head node.
Traverse the linked list using two pointers, one moving one node at a time and the other moving two nodes at a time.
When the fast pointer reaches the end of the list, the slow pointer will be at the midd...
Given an array ARR
of integers containing 'N' elements where each element denotes the frequency of a character in a message composed of 'N' alphabets of an alien language, your ta...
The task is to find the Huffman codes for each alphabet in an encoded message based on their frequencies.
The Huffman code is a binary string that uniquely represents each character in the message.
The total number of bits used to represent the message should be minimized.
If there are multiple valid Huffman codes, any of them can be printed.
The input consists of multiple test cases, each with an array of frequencies.
Impl...
Round duration - 60 Minutes
Round difficulty - Medium
You are given a long type array/list ARR
of size N
, representing an elevation map. The value ARR[i]
denotes the elevation of the ith
bar. Your task is to determine th...
The question asks to find the total amount of rainwater that can be trapped in the given elevation map.
Iterate through the array and find the maximum height on the left and right of each bar.
Calculate the amount of water that can be trapped at each bar by subtracting its height from the minimum of the maximum heights on the left and right.
Sum up the amount of water trapped at each bar to get the total amount of rainwat
You are provided with a directed graph and two nodes, 'S' and 'D'. Your objective is to determine the minimum number of edges that need to be reversed to establish a path ...
The task is to find the minimum number of edges that need to be reversed in a directed graph to find the path from a start node to an end node.
The problem can be solved using graph traversal algorithms like Breadth First Search (BFS) or Depth First Search (DFS).
Start by creating an adjacency list representation of the directed graph.
Perform a BFS or DFS from the start node to the end node, keeping track of the number o...
Given an array or list ARR
consisting of N
integers, your task is to identify all distinct triplets within the array that sum up to a specified number K
.
A t...
The task is to find all distinct triplets in an array that add up to a given sum.
Iterate through the array and fix the first element of the triplet.
Use two pointers approach to find the other two elements that sum up to the remaining target.
Handle duplicates by skipping duplicate elements while iterating.
Return the list of valid triplets.
Round duration - 25 Minutes
Round difficulty - Easy
Tip 1 : Emphasizing on the importance of proficiency in data structures and algorithms for acing the interviews, which is true in any case.
Tip 2 : Do some good projects. (3 projects are more than sufficient)
Tip 3 : Create your resume of only one page.
Tip 1 : Mention Projects
Tip 2 : Highlight Ranks in Competitive Programming
Top trending discussions
Algorithm to find LCM of all numbers from 1 to n and its time complexity
Find prime factors of all numbers from 1 to n
For each prime factor, find the highest power it appears in any number from 1 to n
Multiply all prime factors raised to their highest power to get LCM
Time complexity: O(n*log(log(n)))
NoSQL databases are flexible, scalable, and can handle large amounts of unstructured data.
NoSQL databases are schema-less, allowing for easy and flexible data modeling.
They can handle large amounts of unstructured data, making them suitable for big data applications.
NoSQL databases are highly scalable and can easily handle high traffic and large user bases.
They provide horizontal scalability by distributing data across...
The question asks to find the count of words in a dictionary that can be formed by a given number.
Iterate through each word in the dictionary
Check if the characters in the word can be formed using the given number
Increment the count if the word can be formed
Finding lowest common ancestor of two nodes in binary tree
Traverse the tree from root to both nodes and store the paths in separate arrays
Compare the paths to find the last common node
Return the last common node as the lowest common ancestor
Use recursion to traverse the tree efficiently
To find the merging point of two linked lists
Traverse both linked lists and find their lengths
Move the pointer of the longer list by the difference in lengths
Traverse both lists simultaneously until they meet at the merging point
Reverse a linked list iteratively
Create three pointers: prev, curr, and next
Initialize prev to null and curr to head
Loop through the list and set next to curr's next node
Set curr's next node to prev
Move prev and curr one step forward
Return prev as the new head
The number of rectangles in an MxN matrix can be calculated using a formula.
The formula is (M * (M + 1) * N * (N + 1)) / 4
The matrix can be divided into smaller sub-matrices to count the rectangles
The number of rectangles can also be calculated by counting all possible pairs of rows and columns
The number is 7744.
The number must end in 00 or 44.
The square root of the number must be a whole number.
The only possible number is 7744.
I am a software developer with experience in multiple programming languages and a passion for problem-solving.
Proficient in Java, Python, and C++
Experience with web development using HTML, CSS, and JavaScript
Familiarity with agile development methodologies
Strong problem-solving and analytical skills
Passionate about learning new technologies and staying up-to-date with industry trends
Java function to return subnet mask of IP and URL after www.
Read the file and store IP addresses and URLs in separate arrays
Use regex to extract subnet mask from IP address
Use substring to extract URL after www.
Return subnet mask and URL as separate strings
Inner join returns only the matching rows between two tables, while outer join returns all rows from one table and matching rows from the other.
Inner join combines rows from two tables based on a matching column.
Outer join returns all rows from one table and matching rows from the other.
Left outer join returns all rows from the left table and matching rows from the right table.
Right outer join returns all rows from the...
To find the length of non-looped linked list, we need to traverse the list and count the number of nodes.
Traverse the linked list using a pointer and count the number of nodes until the end of the list is reached.
If a loop is encountered, break out of the loop and continue counting until the end of the list.
Return the count as the length of the non-looped linked list.
A program to check if a number is a palindrome or not.
Convert the number to a string
Reverse the string
Compare the original and reversed string
If they are the same, the number is a palindrome
For Snapdeal's shoe section, I would design a DBMS with separate entities for Sports and Casual Shoes.
Create a main entity for shoes with attributes like brand, size, color, etc.
Create separate entities for Sports and Casual Shoes with attributes specific to each category.
Link the Sports and Casual Shoe entities to the main Shoe entity using a foreign key.
Use indexing and normalization techniques to optimize performanc...
DNS servers translate domain names into IP addresses to enable communication between devices on the internet.
DNS servers act as a phone book for the internet, translating domain names into IP addresses.
When a user types a domain name into their browser, the browser sends a request to a DNS server to resolve the domain name into an IP address.
DNS servers operate in a hierarchical system, with root servers at the top, fo...
Merge two sorted arrays into one sorted array of larger size
Create a new array of size m+n
Compare the last elements of both arrays and insert the larger one at the end of the new array
Repeat until all elements are merged
If any elements are left in the smaller array, insert them at the beginning of the new array
Time complexity: O(m+n)
Example: arr1=[1,3,5,7,0,0,0], arr2=[2,4,6], output=[1,2,3,4,5,6,7]
To find square root of a number, use Math.sqrt() function in JavaScript.
Use Math.sqrt() function in JavaScript to find square root of a number.
For example, Math.sqrt(16) will return 4.
If the number is negative, Math.sqrt() will return NaN.
I was interviewed before Apr 2021.
Round duration - 60 minutes
Round difficulty - Easy
Technical Interview round with questions based on DSA.
You are given a binary tree consisting of distinct integers and two nodes, X
and Y
. Your task is to find and return the Lowest Common Ancestor (LCA) of these two nodes...
Find the Lowest Common Ancestor (LCA) of two nodes in a binary tree.
Traverse the binary tree to find the paths from the root to nodes X and Y.
Compare the paths to find the last common node, which is the LCA.
Handle cases where one node is an ancestor of the other.
Consider edge cases like when X or Y is the root node.
Implement a recursive or iterative solution to find the LCA efficiently.
You are given a Singly Linked List of integers. Your task is to reverse the Linked List by changing the links between nodes.
The first line of input contai...
Reverse a given singly linked list by changing the links between nodes.
Iterate through the linked list and reverse the links between nodes.
Keep track of the previous, current, and next nodes while reversing the links.
Update the head of the linked list to point to the last node after reversal.
Determine if a given singly linked list of integers forms a cycle.
A cycle in a linked list occurs when a node's next reference points back to a previous node in...
Detect if a singly linked list forms a cycle by checking if a node's next reference points back to a previous node.
Use two pointers, one moving at double the speed of the other, to detect a cycle.
If the two pointers meet at any point, there is a cycle in the linked list.
If one of the pointers reaches the end of the list (null), there is no cycle.
Round duration - 45 minutes
Round difficulty - Medium
Technical round with questions on DSA and DBMS.
Inner Join is a SQL operation that combines rows from two tables based on a related column between them.
Inner Join returns only the rows that have matching values in both tables.
It is used to retrieve data that exists in both tables.
Example: SELECT * FROM table1 INNER JOIN table2 ON table1.column = table2.column;
An outer join combines rows from two tables even if there is no match between the columns being joined.
Returns all rows from both tables, filling in missing values with NULL
Useful for finding unmatched rows between two tables
Types of outer joins include LEFT OUTER JOIN, RIGHT OUTER JOIN, and FULL OUTER JOIN
Given a grid with 'M' rows and 'N' columns, calculate the total number of unique rectangles that can be formed within the grid using its rows and columns.
The firs...
Calculate the total number of unique rectangles that can be formed within a grid using its rows and columns.
Iterate through all possible combinations of rows and columns to calculate the number of unique rectangles
Use the formula (M * (M + 1) / 2) * (N * (N + 1) / 2) to find the total number of rectangles
Return the total number of unique rectangles for each test case
Round duration - 40 minutes
Round difficulty - Easy
Technical round with questions on DSA and Puzzles.
Given a string STR
and a non-empty string PTR
, your task is to identify all starting indices of PTR
’s anagrams in STR
.
An anagram of a string is another string...
Identify all starting indices of anagrams of a given string in another string.
Iterate through the main string using a sliding window approach.
Use a hashmap to keep track of characters in the anagram string.
Compare the hashmap of the anagram string with the current window of characters in the main string.
If the hashmaps match, add the starting index of the window to the result array.
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.
Data Analyst
209
salaries
| ₹0 L/yr - ₹0 L/yr |
Manager
207
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Assistant
193
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Officer
184
salaries
| ₹0 L/yr - ₹0 L/yr |
Senior Manager
178
salaries
| ₹0 L/yr - ₹0 L/yr |
Flipkart
Amazon
Meesho
LimeRoad