Problem of the day
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 consisted of 3 coding questions which were purely based on Data Structures and Algorithms.
Question 1 - Find the length of the longest switching sub-array. An array is called switching if all numbers in even positions are equal and all numbers in odd positions are equal.
Question 2 - It was a long passage question on Dynamic Programming but the solution was really easy.
Question 3 - Given a string S consisting of N lowercase letters, return the minimum number of letters that must be deleted to obtain a word in which every letter occurs a unique number of times. Ex - "aaaabbbb" should return 1, as when we delete 1 a or 1 b , a and b will have different frequencies.
The major point to note in the coding round was that they did not have any time or space limit, so brute force solutions were also accepted.
The result of my test was declared just as the test ended and I scored a 100%, but they took a long time to release the final shortlist. There was a gap of about a week between the test and interviews.
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.
Amex came for two profiles - Tech Role and Analyst, 19 and 23 people respectively were shortlisted for the interviews. Fortunately, I was shortlisted for both the roles. I was asked basic question of C++ and it was majorly an HR Round
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
It was a fairly simple round conssting of 5 - 6 questions related to coding, puzzles and me.
What are your interests?
What projects have you done and your field of interest?
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.
int& a = b (reference)
int* a = &b (pointer)
Answer = 1
The question explains everything. Just need to use try catch blocks for exception handling
This round was purely technical
No introduction was done, straight to the point
My preference was the Tech Role, so as I was selected in this, I never had to give interviews for the Analyst role. In total 5 people were selected in the Analyst profile and 4 in the Tech profile.
In the end, I was offered a 6 months internship at Amex.
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.