Tip 1 : If you are applying for a company go through their previous asked questions.
Tip 2 : Be regular while practicing questions from online coding platform
Tip 3 : Need to have a better understanding of everything you mentioned in the resume.
Tip 1 : Keep it short and precise
Tip 2 : Mention in figures like how your contribution improved the existing system
It was a DS and Algo round.




1. For a rectangle, its top left and bottom right coordinates are given.
2. Coordinates of the rectangles are integer values.
3. Edges of the given rectangles will always be parallel to the X and Y coordinate axes of the cartesian plane.
4. It is guaranteed that both the rectangles will have at least a unit area.
Two rectangles do not overlap if one of the following conditions is true.
1) One rectangle is above top edge of other rectangle.
2) One rectangle is on left side of left edge of other rectangle.



Try to solve the problem in 'Single Scan'. ' Single Scan' refers to iterating over the array/list just once or to put it in other words, you will be visiting each element in the array/list just once.
1.Keep three indices low = 1, mid = 1 and high = N and there are four ranges, 1 to low (the range containing 0), low to mid (the range containing 1), mid to high (the range containing unknown elements) and high to N (the range containing 2).
2.Traverse the array from start to end and mid is less than high. (Loop counter is i)
3.If the element is 0 then swap the element with the element at index low and update low = low + 1 and mid = mid + 1
4.If the element is 1 then update mid = mid + 1
5.If the element is 2 then swap the element with the element at index high and update high = high – 1 and update i = i – 1. As the swapped element is not processed
6.Print the array.
DS and Algo Round



Input: Given linked list is:

Output:
1 → 2 → 3 → 4 → 5 → 6 → 7 → 8 → 9 → 12 → 20 → null.
Explanation:
The returned linked list should be in a sorted order. All the elements in this returned linked list are connected by 'child' pointers and 'next' pointers point to null.
The idea is to use the Merge() process of merge sort for linked lists. We use merge() to merge lists one by one. We recursively merge() the current list with the already flattened list.
The down pointer is used to link nodes of the flattened list.

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?