Tip 1: Make sure you have your computer science fundamentals very clear.
Tip 2: You should know the complexity of the code you write and should know the internal implementation of the data structure you use while coding.
Tip 3: You should know about everything you write in your resume.
Tip 4: Practice a lot of programming problems. Participate in competitive programming contests.
Tip 1: Be honest about what you write in your resume.
Tip 2: Should have at least 2 projects
Tip 3: Maintain a precise and self-speaking one-page resume.
Tip 4: Add technical achievements only.
This round started at 11 Am in the morning and covered DSA, Puzzles



‘?’ – matches any single character
‘*’ – Matches any sequence of characters(sequence can be of length 0 or more)
Each occurrence of ‘?’ character in wildcard pattern can be replaced with any other character and each occurrence of ‘*’ with a sequence of characters such that the wildcard pattern becomes identical to the input string after replacement.
Let’s consider any character in the pattern.
Case 1: The character is ‘*’ . Here two cases arises as follows:
We can ignore ‘*’ character and move to next character in the Pattern.
‘*’ character matches with one or more characters in Text. Here we will move to next character in the string.
Case 2: The character is ‘?’
We can ignore current character in Text and move to next character in the Pattern and Text.
Case 3: The character is not a wildcard character
If current character in Text matches with current character in Pattern, we move to next character in the Pattern and Text. If they do not match, wildcard pattern and Text do not match.
We can use Dynamic Programming to solve this problem:
Let T[i][j] is true if first i characters in given string matches the first j characters of pattern.



We cannot use the element at a given index twice.
Try to do this problem in O(N) time complexity.
Initialize the count variable with 0 which stores the result.
Iterate arr and if the sum of ith and jth [i + 1…..n – 1] element is equal to sum i.e. arr[i] + arr[j] == sum, then increment the count variable.
Return the count.
There are 3 ants sitting on three corners of a triangle. All ants randomly pick a direction and start moving along edge of the triangle. What is the probability that any two ants collide?
Tip 1: Convey your thought process to the interviewer
Tip 2: Practice Problems on online sites
Tip 3: look into previously asked questions.
This round was conducted at 2 PM with a senior engineer and 2 DSA problems were asked in it. followed by some basic os and Computer networks questions.



If two or more such subarrays exist, return any subarray.
Create a Hashmap (hm) to store a key-value pair, i.e, key = prefix sum and value = its index, and a variable to store the current sum (sum = 0) and the sum of the subarray as s
Traverse through the array from start to end.
For every element update the sum, i.e sum = sum + array[i]
If the sum is equal to s then print that the subarray with the given sum is from 0 to i
If there is any key in the HashMap which is equal to sum – s then print that the subarray with the given sum is from hm[sum – s] to i
Put the sum and index in the hashmap as a key-value pair.



1 ‘X’: Enqueue element ‘X’ into the end of the nth queue. Returns true after the element is enqueued.
2: Dequeue the element at the front of the nth queue. Returns -1 if the queue is empty, otherwise, returns the dequeued element.
Enqueue means adding an element to the end of the queue, while Dequeue means removing the element from the front of the queue.
The oldest entered element is always at the top of stack 1, so that deQueue operation just pops from stack1. To put the element at top of stack1, stack2 is used.
This round was taken by a tech lead in the evening. I was asked 1 DSA question followed by questions on my projects.



1. Get(int num): If the key exists, it will return the value of the key stored. Else, return -1.
2. Put(int key, int value): If the key already exists, update the value of the key. Else add the key-value pair to the cache. If the number of keys is more than the capacity for this operation, delete the least recently key used.
For the following input:
4 2
2 1 4
1 1
1 4
We will initialize an empty LRU cache for the first operation with a maximum capacity of 2.
For the first operation, we need to add a key-value pair (1,4) to the cache.
For the second operation, we need to return the value stored for key 1, i.e., 4
For the third operation, we need to return -1, as we don't have any key 4 in the cache.
So, the final output will be:
4 -1
The problem can be solved with a hashtable that keeps track of the keys and its values in the double linked list. One interesting property about double linked list is that the node can remove itself without other reference. In addition, it takes constant time to add and remove nodes from the head or tail.
One particularity about the double linked list that I implemented is that I create a pseudo head and tail to mark the boundary, so that we don't need to check the NULL node during the update. This makes the code more concise and clean, and also it is good for the performance.
This round is simple. It is more like a friendly discussion with HR.
1. your strengths and weaknesses
2. where do you see yourself in 5 years?
Tip 1: Practice general HR questions
Tip 2: Stay confident
Tip 3: Always ask your doubts wisely, don't overdo things.

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?