Try to do Data Structures and Algorithms based questions and firstly attempt it yourself before going to the solution, also try to do it as quickly as you can. Also prepare for theory subjects like Operating system, Database Management System, etc which I prepared through Coding Ninjas subjective notes and they are very accurate and up to mark
Tip 1 : Have some projects on resume.
Tip 2: Do not put false things on resume.



An array ‘B’ is a subarray of an array ‘A’ if ‘B’ that can be obtained by deletion of, several elements(possibly none) from the start of ‘A’ and several elements(possibly none) from the end of ‘A’.
To find the maximum element in an array, you can start by setting a variable to the first element in the array. Then, go through the remaining elements one by one and compare each element to the variable holding the maximum value. If you encounter an element that is greater than the maximum value, update the variable to hold the new maximum value. After checking all elements in the array, return the variable holding the maximum value as the result.



String 'S' is NOT case sensitive.
Let S = “c1 O$d@eeD o1c”.
If we ignore the special characters, whitespaces and convert all uppercase letters to lowercase, we get S = “c1odeedo1c”, which is a palindrome. Hence, the given string is also a palindrome.
To check if a string is a palindrome, you can follow these steps:
Initialize two pointers, one pointing to the beginning of the string and the other pointing to the end of the string.
While the left pointer is less than the right pointer, compare the characters at the two pointers.
If the characters are not equal, the string is not a palindrome. Return false.
If the characters are equal, move the left pointer to the right and the right pointer to the left.
Repeat steps 2-4 until the left pointer is greater than or equal to the right pointer.
If you have made it to this point, the string is a palindrome. Return true.



Can you solve this in logarithmic time and space complexity?
Step 1 : Store the original URL in a database and generate a unique identifier for the shortened URL. This identifier can be generated by hashing the original URL or by using an auto-incrementing counter. Store this identifier along with the original URL in the database.
Step 2 : When a user requests the shortened URL, lookup the original URL in the database using the unique identifier and redirect the user to the original URL.



Input: Let the binary tree be:

Output: 2
Explanation: The root node is 3, and the leaf nodes are 1 and 2.
There are two nodes visited when traversing from 3 to 1.
There are two nodes visited when traversing from 3 to 2.
Therefore the height of the binary tree is 2.
The height of a binary tree is the number of edges in the longest path from the root node to a leaf node. Here's an algorithm to calculate the height of a binary tree:
If the root node is None, return 0.
Otherwise, recursively calculate the height of the left and right subtrees of the root node.
Return the maximum height of the left and right subtrees, plus 1 to account for the root node.

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