Tip 1 : Practice at least 250 Questions, and practice regularly
Tip 2 : Do at least 2 projects of good level
Tip 1 : Have some projects on resume.
Tip 2 : Do not put false things on resume.
DSA based round



If N = 5 and arr[ ] = {1, 2, 3, 4, 5} then output will be 5 1 2 3 4.
If N = 8 and arr[ ] = {9, 8, 7, 6, 4, 2, 1, 3} then output will be 3 9 8 7 6 4 2 1.
We can use two pointers, say i and j which point to first and last element of array respectively. As we know in cyclic rotation we will bring last element to first and shift rest in forward direction, so start swaping arr[i] and arr[j] and keep j fixed and i moving towards j. Repeat till i is not equal to j.



Consider the array be 1,6,4,6,2,4,2
The integers 2, 4, 6 occur twice and only the integer 1 occurs once.
1) Traverse all elements and put them in a hash table. Element is used as key and the count of occurrences is used as the value in the hash table.
2) Traverse the array again and print the element with count 1 in the hash table.
This solution works in O(n) time but requires extra space.
The best solution is to use XOR. XOR of all array elements gives us the number with a single occurrence. The idea is based on the following two facts.
a) XOR of a number with itself is 0.




The idea is to use Queue for traversing the tree and using the BFS approach.
In order to prove it is a foldable tree, we need to check two conditions whether null or not.
The left child of the left subtree = the right child of the right subtree. Both of them should be not null.
The right child of left subtree = left child of right subtree. Both of them should be null or not null.
Basic java and DSA



Assume that the Indexing for the singly linked list always starts from 0.
1. Initialize count = 0
2. Loop through the link list
a. if count is equal to the passed index then return current
node
b. Increment count
c. change current to point to next of the current.
Tip 1 : Read Galvin for OS thoroughly.
Tip 2 : Do practice for SQL queries.
Basic HR questions
Tip 1 : Good projects
Tip 2 : Knowledge about basic questions

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