In October 2024, I got the chance to appear in the interview for Agoda, Malaysia.
Interview was scheduled for 1 hour, 12:30 PM to 1:30 PM IST.
By around 12:33 PM, the interveiwer joined. Then in next 3-4 mins we introduced ourselves.
Then he asked few below general questions-
a) If the request rate is set for the client but sometimes client breaches that limit. And we don't
want to drop their requests either, then how will I handle that.
b) If we get spike in the requests then how will I handle that.
c) What deployment model I/we follow in the project, whether it is jar based or containers
based.
I think 1 or 2 more such questions were asked but I don't remember.
It was 12:45 now, he gave me one leetcode questions on HackerRank page to solve.
It is an easy question, I was just getting the idea of Bruteforce way only i.e. nlg(n) running
time.
He asked me to improve the performance but it was not hitting me. So he gave me the hint
and then I understood, it was like 2 pointer problem & then I did code for that. But again I
made the mistake in moving the pointer early causing the wrong result & I kept wondering why,
then again he gave the hint & I resolved that issue. Solution has O(n) time complexity.
Then he executed a few cases to test & all those passed.
Then he asked that can it be improved for any scenario & I belived, its not prossible.
But he mentioned a case. but it was very specific & rare, so he said that we can ignore that.
It was 1:15 PM now, too much time I took for such easy problem.
But he asked me the 2nd problem & suggested to tell only the approach as no time to code.
Question was -
Create a class which will hold the unique numbers only such that below methods are
implemented-
insert(int num) {// It will any valid integer to storer only unique integers }
remove(int num) {// It will remove the given number from the internal collection & will
return that }
get() {// It will return any random existing number from the collection with equal
probability}
I gave my approach, on that he raised concern that rermove() will be time consuming then.
So I added more in my approach. In all this discussion, it was 1:35 PM IST.
So he asked if I have any questions. I asked a few questions & at around 1:40 M IST, we closed the call.
I was sure that my performance was not for Staff Software Engineer. But 1 day later I got the
mail from consultancy that I have cleared that round & Agoda wants to have 2nd round.
But I was wondering, why? I even tested my solution on LeetCode & it failed due to wrong
condition I was using & luckily it worked for all the test cases by interviewer. But my solution was not correct.
So I wrote to consultancy immediately that I shouldn't have cleared 1st round due to given
reasons. So consultancy double checked with Agoda & then wrote to me -
"You kind of did clear the first round – they obviously saw you had some great experience but
not quite as experienced for the Staff level role.. However, they want you to progress for the
Senior engineer role.."
For this I wrote to refuse for further rounds -
"As per me - Either I clear a round or I don't, there is nothing 'kind of'.
My profile was taken for Staff level & after 1st round itself, if I can't justify that level then I
shouldn't be moving ahead.
Thanks once again for giving me the chance & appreciate for acknowledging my experience."
So if I can't justify in the first stage then how would I in later stages, so I dropped-off.
To some other candidate below question was asked-
You are getting a sequence of Orders at some moment of time throughout the day. You also
get the duration about how much time each order will take to complete.
Now you being a Senior Developer, can decide about how will you receive this data to
pocess(pun intended here). Though, in reality, you will be getting these orders through some
message pipelines, but that is not possible during interviews, no matter how Senior Developer
you are.
So, below code is written assuming that we are getting these orders' details in single shot.
I am taking these details through 2 lists, one having the order time & other is holding the
durartion needed for each order. Then I am creating Order object in the code.
Again, you can receive the list of Orders directly, as you will be getting JSON representation
of Order which can be converted to Order objects by some library.
Second twist was that, if you also get 'Idle Time' for that order, such that chef will be idle after
completing the order. So it can vary for each order, which again can be part of the order itself.
But for below code, I have taken fixed idle time value.
It took me time to come-up with below code-
Interview was scheduled for 1 hour, 12:30 PM to 1:30 PM IST.
By around 12:33 PM, the interveiwer joined. Then in next 3-4 mins we introduced ourselves.
Then he asked few below general questions-
a) If the request rate is set for the client but sometimes client breaches that limit. And we don't
want to drop their requests either, then how will I handle that.
b) If we get spike in the requests then how will I handle that.
c) What deployment model I/we follow in the project, whether it is jar based or containers
based.
I think 1 or 2 more such questions were asked but I don't remember.
It was 12:45 now, he gave me one leetcode questions on HackerRank page to solve.
It is an easy question, I was just getting the idea of Bruteforce way only i.e. nlg(n) running
time.
He asked me to improve the performance but it was not hitting me. So he gave me the hint
and then I understood, it was like 2 pointer problem & then I did code for that. But again I
made the mistake in moving the pointer early causing the wrong result & I kept wondering why,
then again he gave the hint & I resolved that issue. Solution has O(n) time complexity.
Then he executed a few cases to test & all those passed.
Then he asked that can it be improved for any scenario & I belived, its not prossible.
But he mentioned a case. but it was very specific & rare, so he said that we can ignore that.
It was 1:15 PM now, too much time I took for such easy problem.
But he asked me the 2nd problem & suggested to tell only the approach as no time to code.
Question was -
Create a class which will hold the unique numbers only such that below methods are
implemented-
insert(int num) {// It will any valid integer to storer only unique integers }
remove(int num) {// It will remove the given number from the internal collection & will
return that }
get() {// It will return any random existing number from the collection with equal
probability}
I gave my approach, on that he raised concern that rermove() will be time consuming then.
So I added more in my approach. In all this discussion, it was 1:35 PM IST.
So he asked if I have any questions. I asked a few questions & at around 1:40 M IST, we closed the call.
I was sure that my performance was not for Staff Software Engineer. But 1 day later I got the
mail from consultancy that I have cleared that round & Agoda wants to have 2nd round.
But I was wondering, why? I even tested my solution on LeetCode & it failed due to wrong
condition I was using & luckily it worked for all the test cases by interviewer. But my solution was not correct.
So I wrote to consultancy immediately that I shouldn't have cleared 1st round due to given
reasons. So consultancy double checked with Agoda & then wrote to me -
"You kind of did clear the first round – they obviously saw you had some great experience but
not quite as experienced for the Staff level role.. However, they want you to progress for the
Senior engineer role.."
For this I wrote to refuse for further rounds -
"As per me - Either I clear a round or I don't, there is nothing 'kind of'.
My profile was taken for Staff level & after 1st round itself, if I can't justify that level then I
shouldn't be moving ahead.
Thanks once again for giving me the chance & appreciate for acknowledging my experience."
So if I can't justify in the first stage then how would I in later stages, so I dropped-off.
To some other candidate below question was asked-
You are getting a sequence of Orders at some moment of time throughout the day. You also
get the duration about how much time each order will take to complete.
Now you being a Senior Developer, can decide about how will you receive this data to
pocess(pun intended here). Though, in reality, you will be getting these orders through some
message pipelines, but that is not possible during interviews, no matter how Senior Developer
you are.
So, below code is written assuming that we are getting these orders' details in single shot.
I am taking these details through 2 lists, one having the order time & other is holding the
durartion needed for each order. Then I am creating Order object in the code.
Again, you can receive the list of Orders directly, as you will be getting JSON representation
of Order which can be converted to Order objects by some library.
Second twist was that, if you also get 'Idle Time' for that order, such that chef will be idle after
completing the order. So it can vary for each order, which again can be part of the order itself.
But for below code, I have taken fixed idle time value.
It took me time to come-up with below code-
Code Editor
Though, I didn't create Chef objects above, but I was suggested to create Objects during interviews to show that you can visualize a class in these questions for future extension.....
a pure stupidity, I believe. As you can convert your functional code to Object based easier than vice-a-versa. So its your call, what you want to do.
System Design : Any how, as I had accepted the System interview request before I got the
profile update as written above, so I attended the System Design interview.
It started with introduction of both of us.
Then I was asked -
We have a E-commerce system, where many items are being sold, now you have to give top 20 selling items or top 30 etc & so on.
For this I said that I will be looking for priority queue ordered by count of each item sold.
On this he asked me to design the system for this. So I gave below design-
a pure stupidity, I believe. As you can convert your functional code to Object based easier than vice-a-versa. So its your call, what you want to do.
System Design : Any how, as I had accepted the System interview request before I got the
profile update as written above, so I attended the System Design interview.
It started with introduction of both of us.
Then I was asked -
We have a E-commerce system, where many items are being sold, now you have to give top 20 selling items or top 30 etc & so on.
For this I said that I will be looking for priority queue ordered by count of each item sold.
On this he asked me to design the system for this. So I gave below design-
Here I said, cache, builder & DB will be distributed, as app is used worldwide. Rest can be
local.
On this he asked, what if whole cache goes-down, for this I introduced Cache Builder. Then he
asked, what DB is doing here, for that I said that it is persisting each item's sold count.
Then, what if, DBB also goes down, for this I said that I will be relying on the DB of other
services to get the items' count, which I can take from their transactions DB/service.
Total it took 50-55 mins & it was difficult to understand their accent. So whatever.
After 1 week, I got the mail to provide the feedback for their interviews & then got the rejection
mail.
My Suggestion - If you are from some Big Product based company or from some good
company from travel domain or you know that you are damn good then only
entertain its call else you will be just wasting your time as it needs a single
reason to reject your profile else you can get more than 1 chance for
interview. Rest we all know, what goes on in these companies in the name of
excellence.
local.
On this he asked, what if whole cache goes-down, for this I introduced Cache Builder. Then he
asked, what DB is doing here, for that I said that it is persisting each item's sold count.
Then, what if, DBB also goes down, for this I said that I will be relying on the DB of other
services to get the items' count, which I can take from their transactions DB/service.
Total it took 50-55 mins & it was difficult to understand their accent. So whatever.
After 1 week, I got the mail to provide the feedback for their interviews & then got the rejection
mail.
My Suggestion - If you are from some Big Product based company or from some good
company from travel domain or you know that you are damn good then only
entertain its call else you will be just wasting your time as it needs a single
reason to reject your profile else you can get more than 1 chance for
interview. Rest we all know, what goes on in these companies in the name of
excellence.