Tip 1 : For every topic of DSA do at least 30 question so that you get good grasp on each topic
Tip 2 : Must go through OOPS, DBMS in details as they are very much asked in interview
Tip 3 : Also you should have complete knowledge of the technology used in your personal projects.
Tip 1 : Your resume must be of 1 page only
Tip 2 : You must have projects in your resume along with the practical impact it is making
Round held at 12 noon. There were 2 interviewers


Given ‘N’ = 4,
'ARR' = { 4, 3, 2, 1}
Then a possible array is 3, 4, 1, 2.
You are supposed to return the array, which is in a zig-zag fashion.
Since there can be multiple answers for a particular array, any of the possible solutions are accepted.
It can be proved. A zig-zag array is always possible for a given array.
Step 1 : Since we have to solve this problem in O(N) time that is single traversal, so we rearrange given array in required order while traversing
Step 2 : Now whenever we are at odd index(0-based indexing), we check if it's greater than it's left element, if not we swap.
Step 3 : Similarly for every odd and even index we satisfy the given condition using swap operation



1
/ \
2 3
The root to leaf path 1->2 represents the number 12.
The root to leaf path 1->3 represents the number 13.
The total sum of all the possible root to leaf paths is 12+13 = 25
The output may be very large, return the answer after taking modulus with (10^9+7).
Step 1 : We call a function with arguments as node and integer 0. Here integer 0 represents number till node N(From root to given node)
Step 2 : If node=NULL, we return 0, else we update value as value*10+node->value
Step 3 : If given node is leaf node, we return value else we call same function for left and right child
Round held at 4pm. There were 2 interviewers



Input: 'list' = [1, 2, 3, 4], 'k' = 2
Output: 2 1 4 3
Explanation:
We have to reverse the given list 'k' at a time, which is 2 in this case. So we reverse the first 2 elements then the next 2 elements, giving us 2->1->4->3.
All the node values will be distinct.
Step 1 : We first traverse till kth node, keep track of next node and call function to reverse the first k nodes
Step 2 : For reversing we use 3 pointers to reverse the linkedlist



1. A binary tree is a tree in which each node has at most two children.
2. The given tree will be non-empty.
3. The given tree can have multiple nodes with the same value.
4. If there are no nodes in the tree which are at distance = K from the given node, return an empty list.
5. You can return the list of values of valid nodes in any order. For example if the valid nodes have values 1,2,3, then you can return {1,2,3} or {3,1,2} etc.

Consider this tree above. The target node is 5 and K = 3. The nodes at distance 1 from node 5 are {2}, nodes at distance 2 from node 5 are {1, 4} and nodes at distance 3 from node 5 are {6, 3}.
Step 1 : Firstly we find all the nodes which are below the given node and at a distance k. This is easy to implement because as we go 1 node down we decrement k and if k==0, we print that nodes
Step 2 : To find nodes which are not in subtree of given node, we find distance of all it's ancestors from given node, let it be x, now we go to other subtree(if present) for that ancestor and search for nodes at distance k-x by using Step 1 approach

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?