Tip 1 - Practice Atleast 250 Questions from coding ninjas
Tip 2 - Do atleast 2 good projects
Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume and be confident.
The round was of 70 min duration and consist of 3 coding problems on the Cocubes Platform. There were many sets of problems and most of the people get different problems.



1. A sequence [arr0, arr1,…, arr(n-1)] is called an Arithmetic progression if for each 'i' ( 0 ≤ i < n - 1) the value arr[i+1] − arr[i] is the same.
2. There is exactly one missing number in the given sequence.
3. All the numbers present in the sequence are distinct.
4. It is the guarantee that the first and last elements of the sequence are not missing elements.
The overall run time complexity should be O(log(N)).
The idea is to go to the middle element. Check if the difference between middle and next to middle is equal to diff or not, if not then the missing element lies between mid and mid+1. If the middle element is equal to n/2th term in Arithmetic Series (Let n be the number of elements in input array), then missing element lies in right half. Else element lies in left half.



Input: Let the binary tree be:

Output: [10, 4, 2, 1, 3, 6]
Explanation: Consider the vertical lines in the figure. The top view contains the topmost node from each vertical line.
The idea is to do something similar to vertical Order Traversal.
This round was held on skype, the interviewer was of a very friendly nature, he started with introducing himself and without my introduction. He asked me about my strong point, I mentioned Competitive Programming and DSA.
Detecting cycle in a directed graph
Detecting cycle in an undirected graph
Opps:
Inheritance
Polymorphism
Virtual Function
OS:
Deadlock
Paging
Segmentation
Semaphore



Depth First Traversal can be used to detect a cycle in a Graph



In the below graph, there exists a cycle between vertex 1, 2 and 3.

1. There are no parallel edges between two vertices.
2. There are no self-loops(an edge connecting the vertex to itself) in the graph.
3. The graph can be disconnected.
Input: N = 3 , Edges = [[1, 2], [2, 3], [1, 3]].
Output: Yes
Explanation : There are a total of 3 vertices in the graph. There is an edge between vertex 1 and 2, vertex 2 and 3 and vertex 1 and 3. So, there exists a cycle in the graph.
To detect if there is any cycle in the undirected graph or not, we will use the DFS traversal for the given graph. For every visited vertex v, when we have found any adjacent vertex u, such that u is already visited, and u is not the parent of vertex v. Then one cycle is detected.
This round was also held on skype. The interview was very friendly, starting with his introduction, and asked from where I am, he moved to the first problem :
Minimum cost to reach bottom-right corner starting from top-left of a matrix, where every cell represents a cost to cover that one
Given a string, it consists of only two types of characters 1 and 2 . Make a new string by replacing every 1 by 11 and two consecutive two to only single



Down: (row+1,col)
Right: (row, col+1)
Down right diagonal: (row+1, col+1)
The idea is to use recursion.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?