Tip 1 : Be well prepared in DSA , including graphs,dp
Tip 2 : practice regularly one or two hours is enough but u need to be consistent for atleast a year or so
Tip 3 : prepare os dbms oops in last week of the interview
Tip 1 : at least Two projects
Tip 2 : Some experience in competitive programming will be beneficial.
Timing- In the evening around 5 pm
Environment- It was online test so I was in my room comfortable.



You can’t engage in multiple transactions simultaneously, i.e. you must sell the stock before rebuying it.
Input: N = 6 , PRICES = [3, 2, 6, 5, 0, 3] and K = 2.
Output: 7
Explanation : The optimal way to get maximum profit is to buy the stock on day 2(price = 2) and sell it on day 3(price = 6) and rebuy it on day 5(price = 0) and sell it on day 6(price = 3). The maximum profit will be (6 - 2) + (3 - 0) = 7.
The problem can be solved by using dynamic programming.
But first explain the recursive approach also and tell the time complexity and then move on to the dynamic programming part.
Explain what are the subproblem and optimal substructure and then code the dp part.
Timing - 2pm
Environment - my room
Interviewer was pretty chilled.



1. push(data) :
This function should take one argument of type integer. It pushes the element into the stack and returns nothing.
2. pop() :
It pops the element from the top of the stack and returns nothing.
3. top() :
It returns the element being kept at the top of the stack.
4. getMin() :
It returns the smallest element present in the stack.
Query-1(Denoted by an integer 1): Pushes integer data to the stack. (push function)
Query-2(Denoted by an integer 2): Pops the data kept at the top of the stack. (pop function)
Query-3(Denoted by an integer 3): Fetches and returns the data being kept at the top of the stack. (top function)
Query-4(Denoted by an integer 4): Returns the smallest element present in the stack. (getMin() function)
Explain the two stack approach first and then move to the optimized version try writing a different function for min element apart from which is given in the geeksforgeeks.

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