Tip 1: Practice at least 500+ questions.
Tip 2: Revise your concepts.
Tip 3: Do at least 2-3 projects.
Tip 1: Make it a one-pager.
Tip 2: Include only relevant information.



Consider the given binary tree:
For the given tree the leaf nodes are 5, 4, 7, 6. All these nodes are on the same level. So the output will be True.



Input: ‘n’ = 5, ‘arr’ = [50, 3, 90, 60, 80].
Output: 2
Explanation:
In this array, the longest increasing subsequences are [50, 60, 80] and [3, 60, 80].
There are other increasing subsequences as well, but we need the number of the longest ones. Hence the answer is 2.



A binary tree is a tree in which each node has at most 2 children.
For Example, the root node is given as follows :
‘ROOT’ = 1 2 3 4 -1 -1 5 -1 -1 -1 -1 and ‘K’ = 2, Then the sum of all nodes at K-level will be 5. This is because 2 and 3 are present at level 2 and 2 + 3 = 5. Therefore 5 is the answer.
[ ] [ ]
[ ] [ ] [ ] [ ]
[ ] [ ]
He asked me to fill the numbers from 1 to 8 in these 8 boxes, one number exactly once, such that no two consecutive elements are
adjacent (diagonally, horizontally or vertically) to each other.



1. Constructor: It initializes the data members as required.
2. enqueue(data): This function should take one argument of type integer. It enqueues the element into the queue.
3. dequeue(): It dequeues/removes the element from the front of the queue and in turn, returns the element being dequeued or removed. In case the queue is empty, it returns -1.
4. front(): It returns the element being kept at the front of the queue. In case the queue is empty, it returns -1.
5. isEmpty(): It returns a boolean value indicating whether the queue is empty or not.
Query-1(Denoted by an integer 1): Enqueues integer data to the queue.
Query-2(Denoted by an integer 2): Dequeues the data kept at the front of the queue and returns it to the caller, return -1 if no element is present in the queue.
Query-3(Denoted by an integer 3): Fetches and returns the data being kept at the front of the queue but doesn't remove it, unlike the dequeue function, return -1 if no element is present in the queue.
Query-4(Denoted by an integer 4): Returns a boolean value denoting whether the queue is empty or not.

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?