Tip 1 : Be strong at your basics.
Tip 2 : Brush up fundamental concepts deeply
Tip 3 : Do at least 2 projects and ask to find answers like why are you choosing this tech stack? why did not you choose its alternatives Know your project in and out because they might ask you for a modification in your project?
Tip 1 : Have some projects on your resume.
Tip 2 : Do not put false things on your resume.
Tip 3 : Try to keep a single-page resume.
There were around 50 MCQ's on C/C++/DSA concepts.
There was no negative marking though.
It was a coding round.
The diameter of a binary tree is the length of the longest path between any two end nodes in a tree.
The number of edges between two nodes represents the length of the path between them.
Input: Consider the given binary tree:
Output: 6
Explanation:
Nodes in the diameter are highlighted. The length of the diameter, i.e., the path length, is 6.
It was an online coding round.
1. Buying a stock and then selling it is called one transaction.
2. You are not allowed to do multiple transactions at the same time. This means you have to sell the stock before buying it again.
Input: ‘n’ = 7, ‘prices’ = [3, 3, 5, 0, 3, 1, 4].
Output: 6
Explanation:
The maximum profit can be earned by:
Transaction 1: Buying the stock on day 4 (price 0) and then selling it on day 5 (price 3).
Transaction 2: Buying the stock on day 6 (price 1) and then selling it on day 6 (price 4).
Total profit earned will be (3 - 0) + ( 4 - 1) = 6.
Height of a tree is the maximum number of nodes in a path from the node to the leaf node.
An empty tree is a height-balanced tree. A non-empty binary tree is a height-balanced binary tree if
1. The left subtree of a binary tree is already the height-balanced tree.
2. The right subtree of a binary tree is also the height-balanced tree.
3. The difference between heights of left subtree and right subtree must not more than ‘1’.
Input: Consider the binary tree given below:
Output: 'true'
Explanation:
Consider subtree at Node ( 7 )
Left subtree height is ‘0’ and right subtree height is ‘0’, the absolute height difference is ‘0-0 = 0’ and ‘0’ is not more than ‘1’ so subtree at Node ( 7 ) is a height-balanced binary tree.
Same for subtrees at Nodes ( 5, 6 ).
Consider subtree at Node ( 4 )
Left subtree height is ‘1’ and right subtree height is ‘0’, the absolute height difference is ‘1-0 = 1’ and ‘1’ is not more than ‘1’ so subtree at Node ( 4 ) is a height-balanced binary tree.
Same for subtree at Node ( 3)
Consider subtree at Node ( 2 )
Left subtree height is ‘2’ and right subtree height is ‘1’, the absolute height difference is ‘2-1 = 1’ and ‘1’ is not more than ‘1’ so subtree at Node ( 2 ) is a height-balanced binary tree.
Consider subtree at Node ( 1 )
Left subtree height is ‘3’ and right subtree height is ‘2’, the absolute height difference is ‘3-2 = 1’ and ‘1’ is not more than ‘1’ so subtree at Node ( 1 ) is a height-balanced binary tree.
Because the root node ( 1 ) is a height-balanced binary tree, so the complete tree is height-balanced.
In this round, three questions were asked and all of them were based on DSA.
1
/ \
2 3
The root to leaf path 1->2 represents the number 12.
The root to leaf path 1->3 represents the number 13.
The total sum of all the possible root to leaf paths is 12+13 = 25
The output may be very large, return the answer after taking modulus with (10^9+7).
A subsequence of an array/list is obtained by deleting some number of elements (can be zero) from the array/list, leaving the remaining elements in their original order.
If the given linked list is 1 -> 2 -> 3 -> 4 -> 5 -> NULL.
Then rearrange it into 1 -> 5 -> 2 -> 4 -> 3 -> NULL.
In this round, three questions were asked and all of them were based on DSA and a little bit about projects.
Input: Let the binary be as shown in the figure:
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.
Basic questions from Javatpoint.
A recent project that you worked on.
It was on the next day of the last technical round, I was on the same site as the technical interview round.
What is your Expectation from this job role?
Tip 1: Be yourself
Tip 2: Speak after think
Tip 3: Speak in positive ways.
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which SQL keyword removes duplicate records from a result set?