Tip 1: OOPS - You should be well-versed in basic OOPS principles.
Tip 2: You should be confident and have profound knowledge about the projects you have worked on.
Tip 3: Basic DB concepts like joins and normalization.
Tip 1: Formatting and Structure:
Contact Information:
Summary/Objective:
There are 2 Coding questions and some basic fundamental questions.



The question was a slight variation or modification of the 0-1 Knapsack problem. The main crux of the question was to identify that it was based on the 0-1 Knapsack problem. After identifying the pattern, I solved it using recursion, then memoized my solution, and it passed all the test cases.



Strings ‘STR’ and ‘PTR’ consist only of English uppercases.
Length of string ‘STR’ will always be greater than or equal to the length of string ‘PTR’.
The index is ‘0’ based.
In case, there is no anagram substring then return an empty sequence.
For example, the given ‘STR’ is ‘BACDGABCD’ and ‘PTR’ is ‘ABCD’. Indices are given
0-3 in ‘STR’ index 0,1,2,3 are ‘BACD’ and it is an anagram with ‘ABCD’
1-4 in ‘STR’ index 1,2,3,4 are ‘ACDG’ and it is not anagram with ‘ABCD’
2-5 in ‘STR’ index 2,3,4,5 are ‘CDGA’ and it is not anagram with ‘ABCD’
3-6 in ‘STR’ index 3,4,5,6 are ‘DGAB’ and it is not anagram with ‘ABCD’
4-7 in ‘STR’ index 4,5,6,7 are ‘GABC’ and it is not anagram with ‘ABCD’
5-8 in ‘STR’ index 5,6,7,8 are ‘ABCD’ and it is an anagram with ‘ABCD’
Hence there are 2 starting indices of substrings in the string ‘STR’ that are anagram with given ‘PTR’ which are index 0 and 5.
It was a direct problem on a string matching algorithm. After checking the constraints, it was pretty obvious that I had to use the Rabin-Karp algorithm for the same.



In zigzag order, level 1 is printed from left to right fashion, level 2 is printed from right to left. and level 3 is printed from left to right again, and so on…..
For the given binary tree

The zigzag traversal is [1, 4, 3, 5, 2, 7, 6]
This is one famous of the question related to Binary Tree.
I solved it with BFS approach using queue Data Structures.



Each product can cross the integer limits, so we should take modulo of the operation.
Take MOD = 10^9 + 7 to always stay in the limits.
Can you try solving the problem in O(1) space?
I started with the brute force approach since initially, there were no conditions on using the division operator. However, I was given some test cases where my solution was giving wrong answers. Then, I made some changes, and eventually, I was given the condition that I couldn't use the division operator. After some time, I proposed a solution using two arrays: one prefix array and one suffix array to store the product of array elements from the start to index \(i\) and from the end to index \(i\), respectively. Later on, I was asked to optimize the space, and I did this using one array instead of two.


1. Push(num): Push the given number in the stack.
2. Pop: Remove and return the top element from the stack if present, else return -1.
3. Top: return the top element of the stack if present, else return -1.
4. getMin: Returns minimum element of the stack if present, else return -1.
For the following input:
1
5
1 1
1 2
4
2
3
For the first two operations, we will just insert 1 and then 2 into the stack which was empty earlier. So now the stack is => [2,1]
In the third operation, we need to return the minimum element of the stack, i.e., 1. So now the stack is => [2,1]
For the fourth operation, we need to pop the topmost element of the stack, i.e., 2. Now the stack is => [1]
In the fifth operation, we return the top element of the stack, i.e. 1 as it has one element. Now the stack is => [1]
So, the final output will be:
1 2 1
I used reference with the variation of next greater element problem.



In the given linked list, there is a cycle, hence we return true.

I applied the most optimal approach of FAST AND SLOW.

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