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.
Interviewer straight away shared doc with 2 coding questions and gave me some time to think followed by discussion.



Since we need smaller window answer for larger windows, so we have to store the answer for window of each size from 1 to n.
Then we will have two pointers left and right to point at the two ends of our current window. For example if we have array [1,1,2,3,4,5,1] and we have to get the answer for subarray [2,3,4] then left will point at index 2and right at index 4.
Now in the current window we have to burst baloons in such sequence that we get the max value. And for this we have to check for each baloon in that window whether it can give the max value if burst at last.
So for this we have to traverse from left to right in the window and each time calculate the value assuming ith baloon is burst at last.
So while filling Dp we will be filling values for left to right window , i.e.,
dp[left][right] = Max(already calculated value, burst this ith baloon last and add left and right subarray points within the window)
dp[left][right] = max(dp[left][right], arr[left-1] * arr[i] * arr[right+1] + dp[left][i-1] + dp[i+1][right])



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
Since we need smaller window answer for larger windows, so we have to store the answer for window of each size from 1 to n.
Then we will have two pointers left and right to point at the two ends of our current window. For example if we have array [1,1,2,3,4,5,1] and we have to get the answer for subarray [2,3,4] then left will point at index 2and right at index 4.
Now in the current window we have to burst baloons in such sequence that we get the max value. And for this we have to check for each baloon in that window whether it can give the max value if burst at last.
So for this we have to traverse from left to right in the window and each time calculate the value assuming ith baloon is burst at last.
So while filling Dp we will be filling values for left to right window , i.e.,
dp[left][right] = Max(already calculated value, burst this ith baloon last and add left and right subarray points within the window)
dp[left][right] = max(dp[left][right], arr[left-1] * arr[i] * arr[right+1] + dp[left][i-1] + dp[i+1][right])
The interview was primarily based on Development skills and system design(I was not prepared for this). Interviewer asked 1 coding question as well.
Design a Restaurant Management System
Tip 1 : Prepare System Design questions.
Tip 2 : Prepare Previously Asked Questions.



For the given arr[ ] = { 1, 2, 3, 1}
After 0 rotation arr[ ] = { 1, 2, 3, 1} the sum is = (0 *1 + 1 * 2 + 2 * 3 + 3 * 1) = 11.
After 1 rotation arr[ ] = { 1, 1, 2, 3} the sum is = (0 *1 + 1 * 1 + 2 * 2 + 3 * 3) = 14.
After 2 rotation arr[ ] = { 3, 1, 1, 2} the sum is = (0 *3 + 1 * 1 + 2 * 1 + 3 * 2) = 9.
After 3 rotation arr[ ] = { 2, 3, 1, 1} the sum is = (0 *2 + 1 * 3 + 2 * 1 + 3 * 1) = 8.
So the maximum sum is 14 when arr[ ] = { 1, 1, 2, 3}.
Traverse the array once and keep updating the frequency of array elements in the Map.
Check if the size of the map is equal to the total number of distinct elements present in the original array or not. If found to be true, update the maximum sum.
While traversing the original array, if the ith traversal crosses K elements in the array, update the Map by deleting an occurrence of (i – K)th element.
After completing the above steps, print the maximum sum obtained.

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
When does a stack underflow occur?