Tip 1 : Do practice a lot of data structures from renowned websites like LeetCode and also from CodeZen
Tip 2 : In your introduction, when asked, you just need to tell your life story.
Tip 3 : Maintain eye contact with the interviewers and clarify every details about the question before proceeding to the solution
Tip 1: Add most recent and relevant projects only
Tip 2: you should know each and everything written on your resume
It's like a sliding window problem.
We keep track of even and odd equality with 2 variables, even and odd.
Whenever we come across a unmet condition, like index even but not equal with even variable and same goes for odd, we first
Record the length till now in max_len.
Reset start to i-1 as this is need incase of all elements equal.
Reset even and odd according to current index i...
Given two integer N and K representing number of chips a person has and the number of chips he can use at max at a time, return the minimum number of rounds that are necessary for John to leave the casino with N chips, having placed all-in no more than K times. If the person bets C chips and wins he gets 2C chips back and if he loses he doesn't get anything.
It was a dynamic programming question but I was able to solve it with recursion as well.
The approach was simply, that if he wins then he gets 2C chips back. that means 1 turn is used to deploy half the chips he had. while in the other case he just loses a chip and same number of turns are restored.
Tip 1: Be confident answer honestly as they can catch you easily
Tip 2: Know everything on your resume
Tip 3: Be gentle as you speak
Just the answer which is 2.
Reference - No memory is allocated and it is just an alias of the same memory location
Pointer - New memory location is created which stores the address of the location it is pointing to.
Ex -
int& a = b (reference)
int* a = &b (pointer)
Answer = 1
The question explains everything. Just need to use try catch blocks for exception handling
I gave the two pointer approach. Then he said what if we are provided with the length of the list. I said that we will move forward in the list till n/2 nodes and then the same approach as above. Then he said what if we had to do it with a stack. I said we will add elements into the stack till n/2 nodes and then start popping elements while simultaneously traversing the linked list from the (n/...
We will create a third table that will store only two columns which are the Primary Keys of both the tables and they together can uniquely identify records in both the tables.
I thought of it but did not reach the solution at once, it took me 3 – 4 attempts for it but he didn’t tell me anything, and finally, I got to the solution.