Interview at IVY Comptech -
Majorly interview was around Garbage Collector in Java like -
a) When the Garbage collector runs?
b) What is the memory model in Java?
c) Design Garbage collector.
One question was around to code to reverse the words in a sentence like -
Input :- This is a Sentence
Output : sihT si a ecnetneS
Condition :- Dont use any loop or iterator.
One question to find middle node in the link list in one iteration.
1 or 2 normal questions were also asked but I don't remember them.
Majorly interview was around Garbage Collector in Java like -
a) When the Garbage collector runs?
b) What is the memory model in Java?
c) Design Garbage collector.
One question was around to code to reverse the words in a sentence like -
Input :- This is a Sentence
Output : sihT si a ecnetneS
Condition :- Dont use any loop or iterator.
One question to find middle node in the link list in one iteration.
1 or 2 normal questions were also asked but I don't remember them.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
I got another chance to have the interview at Ivy Comptech, in Jan 2022.
Interview was taken by Himan Bayan.
I always wonder why interviewers are afraid to share their video during the discussions, they will be expecting you to share your video but don't share their video, either they are not dressed or check the interview questions/answers over the internet.
So one of these reasons can be possible here, as Himan didn't show coutesy to switch on his video.
Interview was started to design the backend for MakeMyTrip to show the latest flight details from various airlines.
So surely, this question was about handling the high volume of data quickly.
But I don't know why he gave the example of Hotstar for handling of streams here..............?
I am not sure if he was looking for certain words from me or some good working design, but it was sure that he was also not very clear about his question.
Second question for coding which I messed up, as it was very common & straight one..
Question : Find the indexes of the pair of numbers, from given array, whose sum is equal to the given number.
What I messed in this straight question?
I tried to apply HashSet here, Himan also asked how HashSet can help here...but I had already messed up my thinking.. :(
Point to remember....
HashSet can be used if we need to find that pair of numbers.
But if we need to find the indexes of those numbers then we need to use HashMap where key will be the number & value will be Index.
Rest it is straight, & it is the most efficient one which I can think of.
Though using sorting & do binary search is a first way to solve, but it is not efficient one & if one needs to find the indexes
of those 2 numbers then it's shape changes & now we need to worry about the actual indexes also. To solve it, you have 2 ways-
1) You will be creating the objects for every number having 2 properties - value & index.
Then you can store all those objects in the array or some List, then sort all those elements based on their values.
2) Use a TreeMap with key as number & values as its index.
Obviously (1) is going to be too heavy, so you will be prefering (2), now if using TreeMap then better to go for HashMap & avoid any sorting even.
I got another chance to have the interview at Ivy Comptech, in Jan 2022.
Interview was taken by Himan Bayan.
I always wonder why interviewers are afraid to share their video during the discussions, they will be expecting you to share your video but don't share their video, either they are not dressed or check the interview questions/answers over the internet.
So one of these reasons can be possible here, as Himan didn't show coutesy to switch on his video.
Interview was started to design the backend for MakeMyTrip to show the latest flight details from various airlines.
So surely, this question was about handling the high volume of data quickly.
But I don't know why he gave the example of Hotstar for handling of streams here..............?
I am not sure if he was looking for certain words from me or some good working design, but it was sure that he was also not very clear about his question.
Second question for coding which I messed up, as it was very common & straight one..
Question : Find the indexes of the pair of numbers, from given array, whose sum is equal to the given number.
What I messed in this straight question?
I tried to apply HashSet here, Himan also asked how HashSet can help here...but I had already messed up my thinking.. :(
Point to remember....
HashSet can be used if we need to find that pair of numbers.
But if we need to find the indexes of those numbers then we need to use HashMap where key will be the number & value will be Index.
Rest it is straight, & it is the most efficient one which I can think of.
Though using sorting & do binary search is a first way to solve, but it is not efficient one & if one needs to find the indexes
of those 2 numbers then it's shape changes & now we need to worry about the actual indexes also. To solve it, you have 2 ways-
1) You will be creating the objects for every number having 2 properties - value & index.
Then you can store all those objects in the array or some List, then sort all those elements based on their values.
2) Use a TreeMap with key as number & values as its index.
Obviously (1) is going to be too heavy, so you will be prefering (2), now if using TreeMap then better to go for HashMap & avoid any sorting even.