Tip 1 : Be thorough with Data Structures and Algorithms and also with your resume.
Tip 2 : Must do Previously asked Interview as well as Online Test Questions.
Tip 3 : Go through all the previous interview experiences from Codestudio and Leetcode.
Tip 4 : 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.
Myntra had conducted a coding test on campus before the start of the placement season with 2 questions, one on stack and other on DP.
Tips : For the test, the DP question asked was pretty standard, on Longest Common Subsequence. The question on stacks, I don't remember what it was but it was also pretty straight forward. For the test, I would recommend to solve problem from GFG. If they do come to resume shortlisting, they are looking for people who have done good projects and internships.



This problem can be solved using recursion. In this approach, we will start form last element of both the strings. If elements at the last matches then we will decrement length of both the string else we will decrement the length of either of the string.
lcs(s1, s2, n, m):
if n == 0 or m == 0:
return 0
if s1[n-1] == s2[m - 1]:
return 1 + lcs(s1, s2, n-1, m-1)
else:
return max(lcs(s1, s2, n-1, m), lcs(s1, s2, n, m-1))
But this approach would result in TLE for longer test cases. It can be optimized using dynamic programming.
In the top down approach, we make a table of size [m+1][n+1] where m and n are the length of the strings. The intermediate row and column of the table indicates what will be the value of the longest common subsequence if its called for the smaller inputs.
if s1[i - 1] == s2[j - 1]:
dp[i][j] = dp[i - 1][j - 1] + 1
else:
dp[i][j] = max(dp[i][j - 1], dp[i - 1][j])
The interview started off with questions on my general interest in Software Development. The first round had two coding questions, I was supposed to write the code on paper.
For the questions, they asked me to code the solution first. And then gave a specific input and asked me to demonstrate step by step in my code, how it would lead to the correct answer.
Tips: It's ok if you can't code a general solution, if you can write a code which works for the particular input they have given then also it's ok with them. But be thorough with Data structures.



If the first linked list is 1 -> 2 -> 3 -> 4 -> 5 -> NULL and the second linked list is 4 -> 5 -> NULL.
The two numbers represented by these two lists are 12345 and 45, respectively. So, adding these two numbers gives 12390.
So, the linked list representation of this number is 1 -> 2 -> 3 -> 9 -> 0 -> NULL.
This is a simple elementary addition problem.
Approach:
1. Traverse the two linked lists.
2. In each iteration, add the numbers in the nodes of the linked lists
3. If the sum of two digits is greater than 9, then we will have to find out the “carry ” : sum%10 to be added in the next iteration.
4. If the lists are unequal, then the smaller one will end before the longer. In this case, we will put only the remaining nodes of the longer list in the resultant list
The time complexity will be O(m+n) since we are iterating both the lists only once.
I wasn't asked to write any code in this interview. They asked me some questions on Machine Learning, because of my projects in them. Then they asked me if I knew graph algorithms. Since I knew BFS and DFS, I told them. They asked the difference between the two. Then they asked me if I knew how to find the shortest distance between two points in a graph. I didn't know Dijkstra's properly but I knew it worked on the greedy approach so was able to tell that. Then they asked me how would I find the second shortest path. I tried to answer it with the same greedy approach, but couldn't arrive at the complete solution.
Tips: They ask a tough theoretical question. It's ok if you don't know the answer, they only look for your approach.



The traversal should proceed from left to right according to the input adjacency list.
Adjacency list: { {1,2,3},{4}, {5}, {},{},{}}
The interpretation of this adjacency list is as follows:
Vertex 0 has directed edges towards vertices 1, 2, and 3.
Vertex 1 has a directed edge towards vertex 4.
Vertex 2 has a directed edge towards vertex 5.
Vertices 3, 4, and 5 have no outgoing edges.
We can also see this in the diagram below.
BFS traversal: 0 1 2 3 4 5

BFS is a traversing algorithm we start traversing from a selected node (starting node) and traverse the graph layer wise thus exploring the neighbor nodes (nodes which are directly connected to source node). And then move towards the next-level neighbor nodes.
Pseudocode :
BFS (G, s)
Q.push( s ) //Inserting s in queue Q until all its neighbor vertices are marked.
mark s as visited.
while ( Q is not empty)
//Removing that vertex from queue, whose neighbor will be visited now
u = Q.pop( )
//processing all the neighbors of u
for all neighbors v of u in Graph G
if v is not visited
Q.push( v ) //Stores v in Q to further visit its neighbor
mark w as visited.



V is the number of vertices present in graph G and vertices are numbered from 0 to V-1.
E is the number of edges present in graph G.
The Graph may not be connected i.e there may exist multiple components in a graph.
The DFS algorithm is a recursive algorithm based on the idea of backtracking. It starts with the initial node of the graph G, and then goes to deeper and deeper until we find the goal node or the node which has no children.
Pseudocode :
DFS(G, s):
mark s as visited
for all neighbors v of s in Graph G:
if v is not visited:
DFS-recursive(G, v)



Input:
4 5
0 1 5
0 2 8
1 2 9
1 3 2
2 3 6

In the given input, the number of vertices is 4, and the number of edges is 5.
In the input, following the number of vertices and edges, three numbers are given. The first number denotes node ‘X’, the second number denotes node ‘Y’ and the third number denotes the distance between node ‘X’ and ‘Y’.
As per the input, there is an edge between node 0 and node 1 and the distance between them is 5.
The vertices 0 and 2 have an edge between them and the distance between them is 8.
The vertices 1 and 2 have an edge between them and the distance between them is 9.
The vertices 1 and 3 have an edge between them and the distance between them is 2.
The vertices 2 and 3 have an edge between them and the distance between them is 6.
1. There are no self-loops(an edge connecting the vertex to itself) in the given graph.
2. There can be parallel edges i.e. two vertices can be directly connected by more than 1 edge.
Dijkstra's Algorithm basically starts at the source node and it analyzes the graph to find the shortest path between that node and all the other nodes in the graph.
The algorithm keeps track of the currently known shortest distance from each node to the source node and it updates these values if it finds a shorter path.
Once the shortest path between the source node and another node is found, that node is marked as "visited" and added to the path.
The process continues until all the nodes in the graph have been added to the path. This way, we have a path that connects the source node to all other nodes following the shortest path possible to reach each node.
To implement Dijkstra, priority queue can be used.
They asked me to code one question which was on stacks, I don't remember the question, but it was also not difficult, and I wrote the code for that. Then they started to drill me on my resume, on every project that I had done, every miniscule detail.
Tips: Be very thorough with your resume. It's a clear red flag for them if you can't explain something you have written on your resume.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?