Tip 1: Practice at least 250 questions.
Tip 2: Complete at least 2 projects.
Tip 1: Include some projects on your resume.
Tip 2: Do not include false information on your resume.

Can you solve the problem in logarithmic time and constant space complexity?



Let ‘x’ be a larger integer, ‘n’ be the size of the hash table, and ‘h(x) = x mod n’ be a hash function. Then in Quadratic Probing -:
1. If we find that the index h(x), is already mapped to some other integer in the hashtable, then we try for index (h(x) + 1 * 1) mod n.
2. If the index (h(x) + 1*1) mod n, is also already mapped to some other integer in the hashtable, then we try for index (h(x) + 2 * 2) mod n.
3. If the index (h(x) + 2*2) mod n, is also already mapped to some other integer in the hashtable, then we try for index ‘(h(x) + 3 * 3) mod n.
4. We repeat this process until an unmapped index is found in the hashtable or index values start repeating.
For Example -: Consider, array ‘keys’ = {50, 49, 76, 85, 92, 73, 18}, ‘n’ = 7 and the hash function h(x) = x mod 7. Then -:
1. h(50) = 50 mod 7 = 1, thus it will be mapped to index ‘1’ in the hashtable.
2. h(49) = 49 mod 7 = 0, thus it will be mapped to index ‘0’ in hashtable.
3. h(76) = 76 mod 7 = 6, thus it will be mapped to index ‘6’ in the hashtable.
4. h(85) = 85 mod 7 = 1, thus it should be mapped to index ‘1’ in the hashtable, but index ‘1’is already mapped with 50, so we try for index (h(85) + 1*1) mod 7 = ‘2’, as index ‘2’ is not mapped previously, thus it will be mapped to index ‘2’ in hashtable’.
5. h(92) = 92 mod 7 = 1, thus it should be mapped to index ‘1’ in the hashtable, but index ‘1’ is already mapped with 50, so we try for index (h(92) + 1*1) mod 7 = 2, but index ‘2’ is also occupied so we try for index (h(92) + 2*2) mod 7 = ‘5’, as index ‘5’ is not mapped previously, thus it will be mapped to index ‘5’ in hashtable
6. h(73) = 73 mod 7 = 3, thus it will be mapped to index ‘3’ in the hashtable.
7. h(18) = 18 mod 7 = 4, thus it will be mapped to index ‘4’ in the hashtable.
Thus the resultant array ‘hashTable’ should be {49, 50, 85, 73, 18, 92, 76}.

1. Consider ‘0’ based indexing.
2. Don’t print anything, just return the integer array ‘hashTable’.



A character from an index of a string(str1) is put at the end of it, is defined as a single operation.
You cannot perform any operation on the string, str2.



For the given 5 intervals - [1, 4], [3, 5], [6, 8], [10, 12], [8, 9].
Since intervals [1, 4] and [3, 5] overlap with each other, we will merge them into a single interval as [1, 5].
Similarly, [6, 8] and [8, 9] overlap, merge them into [6,9].
Interval [10, 12] does not overlap with any interval.
Final List after merging overlapping intervals: [1, 5], [6, 9], [10, 12].
I first sorted the intervals in ascending order of 'R', then traversed the intervals from left to right, keeping track of the last interval's endpoint and checking if it intersects with a new interval or not, updating the answer accordingly.



Order of return of diagonal path’s array/vector: The rightmost diagonal path must come first, and so on.
Every parent node comes first then the child node. In other words, return the diagonal element from top to bottom.
Consider the given binary tree.

There are 4 diagonal paths:
1 3 6
2 5 9
4 8
7
You need to return ‘1 3 6 2 5 9 4 8 7’.
Let's consider this example

Diagonal paths are:
1 3 6
2 5
4
You need to return ‘1 3 6 2 5 4’.



• The left subtree of a node contains only nodes with data less than the node’s data.
• The right subtree of a node contains only nodes with data greater than the node’s data.
• Both the left and right subtrees must also be binary search trees.
For the given level order traversal: 5 3 6 2 4 7
The BST will be:

The Inorder Traversal of this BST is 2 3 4 5 6 7.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?