Tip 1: Always spend enough time understanding the question before looking at the solution.
Tip 2: Ask for help from mentors or teaching assistants (TAs) when needed.
Tip 3: Make a note of any approaches where you initially struggled.
Tip 1: Clearly mention the projects you have worked on in your previous organization, along with the impact they had.
Tip 2: Emphasize the skills you bring to the company and how they align with the role.



For the given tree below,
Postorder traversal for the given tree will be [4, 5, 2, 3, 1]. Hence, the answer is [4, 5, 2, 3, 1].

I first solved it using recursion, then optimized it by using two stacks, and finally improved it further using just one stack.




I solved this problem using for loops and multiple if statements.
Low-level design for a library system in a city.
Tip 1: Write clean code. Use meaningful variable names and add parentheses wherever necessary.
Tip 2: Think out loud while solving the problem to explain your approach clearly.
Tip 3: Apply object-oriented programming concepts wherever possible to improve code structure.
High-level design related to a project I worked on at my previous organization.
Tip 1: Concepts related to Spring Boot were tested, so make sure you are well-prepared to explain and demonstrate anything you mention in your resume during the interview.
Tip 2: Practice writing code for building and consuming APIs.



1- Visit the root node.
2- Traverse all nodes in the left subtree of the root node.
3- Traverse all the nodes in the right subtree of the root node.
For the given tree below,
Preorder traversal for the given tree will be [1, 2, 4, 5, 3]. Hence, the answer is [1, 2, 4, 5, 3].

Elements are in the level order form. The input consists of values of nodes separated by a single space in a single line. In case a node is null, we take -1 in its place.
For example, the input for the tree depicted in the below image would be :

1
2 3
4 -1 5 6
-1 7 -1 -1 -1 -1
-1 -1
Explanation :
Level 1 :
The root node of the tree is 1
Level 2 :
Left child of 1 = 2
Right child of 1 = 3
Level 3 :
Left child of 2 = 4
Right child of 2 = null (-1)
Left child of 3 = 5
Right child of 3 = 6
Level 4 :
Left child of 4 = null (-1)
Right child of 4 = 7
Left child of 5 = null (-1)
Right child of 5 = null (-1)
Left child of 6 = null (-1)
Right child of 6 = null (-1)
Level 5 :
Left child of 7 = null (-1)
Right child of 7 = null (-1)
The first not-null node (of the previous level) is treated as the parent of the first two nodes of the current level.
The second not-null node (of the previous level) is treated as the parent node for the next two nodes of the current level and so on.
The input ends when all nodes at the last level are null (-1).
The above format was just to provide clarity on how the input is formed for a given tree.
The sequence will be put together in a single line separated by a single space. Hence, for the above-depicted tree, the input will be given as:
1 2 3 4 -1 5 6 -1 7 -1 -1 -1 -1 -1 -1
I started by explaining how these three traversals differ. I used a stack and a pair class to solve this problem, resulting in a time and space complexity of O(N).

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?