Tip 1: Create interactive projects based on full-stack development.
Tip 2: Practice at least 250 questions on DSA.
Tip 3: Do not include anything in your resume that you are not confident about.
Tip 1: Keep your resume short and concise.
Tip 2: Avoid including false information on your resume.
Tip 3: Exclude irrelevant details from your resume.
I was given three coding questions to solve. The questions were of easy to medium difficulty level.
Create a visited array to keep track of which numbers from the original array are present. For each positive number in the input array, mark its corresponding position in the visited array. After that, go through the visited array to find the first position that isn’t marked. The first unmarked index tells us the first missing positive number.
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.
Use a stack to store the nodes of the given linked list. First, push the k nodes of the linked list onto the stack. Then, pop the nodes one by one while keeping track of the previously popped node. Point the next pointer of the previous node to the top element of the stack. Repeat this process until you reach the end of the linked list.
If we have A = [3, 5, 7, 9, 2, 6] and m = 5.
Difference of array elements with m : [2, 0, 2, 4, 3, 1].
Array after rearrangement : [5, 6, 3, 7, 2, 9].
Use a hash set or dictionary to store elements that have already been processed.
Initialize the index of the result array to 0.
Traverse through the input array. If an element is not in the hash set, place it at the current result index and insert it into the set.
This round was conducted immediately after the coding round. It was the first technical round. I was asked two coding questions, theoretical DSA-related questions, as well as SQL and web development-related questions.
Conditions for valid parentheses:
1. All open brackets must be closed by the closing brackets.
2. Open brackets must be closed in the correct order.
()()()() is a valid parentheses.
)()()( is not a valid parentheses.
I solved this question using a stack.
Push all the opening brackets onto the stack. Whenever you encounter a closing bracket, check if the top of the stack is the corresponding opening bracket. If this is true, pop the stack and continue the iteration. In the end, if the stack is empty, it means all brackets are balanced or well-formed. Otherwise, they are not balanced.
Input: 'arr' = [2, 2, 2, 2, 0, 0, 1, 0]
Output: Final 'arr' = [0, 0, 0, 1, 2, 2, 2, 2]
Explanation: The array is sorted in increasing order.
Traverse the array once and count the number of 0s, 1s, and 2s, denoted as c0, c1, and c2, respectively. Then, traverse the array again, placing c0 (the count of 0s) 0s first, followed by c1 1s, and finally c2 2s.
What is the difference between the Breadth First Search (BFS) and Depth First Search (DFS)? (Learn)
What is the time complexity of enqueue and dequeue operations in a Queue? (Learn)
How are collisions handled in a hash data structure? (Learn)
Create an event in React.
Explain the difference between functional and class components in React. (Learn)
What is the difference between BETWEEN and IN operators in SQL? (Learn)
This round was conducted the day after the first technical round. I was informed by phone that I had been selected for the second technical round. In this round, I was asked two coding questions, DSA-based questions, questions from my resume, and questions about my projects.
• It is connected
• It has no cycle.
If n = 5 and if there are 4 edges i.e [ [0, 1], [0, 2], [0, 3], [1, 4]] so the graph formed will look like this:-
Here this graph is connected and it has no cycle so it is a tree.
Depth First Traversal can be used to detect a cycle in an undirected graph. If we encounter a visited vertex again, we can conclude that there is a cycle.
Traverse the tree in a bottom-up manner. For every subtree visited, return true if the subtree rooted under it is single-valued and increment the count. The idea is to use count as a reference parameter in recursive calls and use the returned values to determine whether the left and right subtrees are single-valued or not.
Which data structures are used for implementing LRU cache? (Learn)
Discuss the time and space complexity of graph operations: Traversal (DFS, BFS), insertion, and deletion. (Learn)
Explain Dijkstra’s algorithm and its applications. (Learn)
What is the load factor of a hash table and what should be the optimal load factor for a hash table?
Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
Which SQL keyword removes duplicate records from a result set?