Two DSA questions, I don't remember.
This went for 1.5 hours.
Q1. A sequence of characters given, rearrange them so that any two consecutive characters cannot be same. Used frequency map + priority queue approach with code passing all cases.
Q2. A sequence of buildings given, can remove one or more floors from one or more bildings (can also completely destroy a building) in one operation. Return minimum number of operations required to make all building of same height.
Gave an approach similar to binary search on answer.
Further optimisation was done using prefix sum.
Gave time complexity of both approaches.
No code written.
Q3. Give a scenario where you resolved a bug. I gave a scenario where we recently made our counter variable singleton. What production issues was it causing? I said I was not shared the issue by my team. (I asked later and they said it was just consuming more memory).
Q4. Explain diamond problem. How is it tackeled in Java and C++. Gave answer that Java doesn't use multiple inheritance and C++ uses virtual functions for it.
It was mostly an LLD round.
Asked about my role and team, day to day work. Explained the 5G architecture of UDM (AMF registration flow, SDM, SOR, PLMN).
Asked about the daily QPS rough estimate (I was not aware but he insisted so I said anything like 100M per day - it is a red flag I know now).
He asked for how these requests get delegated to microservices, I said using load balancers. He asked any load balancers used in industry (I knew it but was not sure completely so I said I don't know - red flag).
Q1. Design an ATCS system (manages airplanes take off scheduling and landing between source and destination). Handle edge cases like same time take-off time. He gave me a sheet of paper explaining the problem.
I went through it and approached in these steps -
1. User flow.
2. Functional and non functional requirements.
3. Entity identification with the data and methods they hold.
I said key phrases like entities are the nouns of the requirements. I was explaining some methods could have dummy implementation with only print statements. He said he only cared about the entities, their methods and which entities are calling which (dependency graph). He clarified the requirements here because of which I had to change my orchestrator class. I gave a composition relationship of orchestrator and other classed.
4. DSA logic. I gave priority queue approach. But during the explanation, he clarified the requirements which I had misunderstood. He stressed that I had not read carefully.
He was not convinced overall.
Q2. This was an OS question. There are n threads and a task which takes x time to complete. It is a single core machine. How long will it take to complete the task.
I gave a wrong answer saying x/n. He said this way we can make an infinite number of threads, is there an upper bound to the number of threads. I said I was not aware but since there is an overhead of thread lifecycle we don't create much threads. We went into process and threads deep dive with thread communication using IPC and shared memory advantage but processes also use that. Overall my weakness in OS and concurrency was revealed here.
It was overall negative.
Q1. Design a leaderboard of a game where users sign-in, play game - get score and delete account. The leaderboard should display top 10 users only as per their score.
Gave an initial set approach. The interviewer said we are not language specific so give a data structure. I said internally it is red black tree. He asked to do some dry run on test cases. I did.
But then he gave a hint asking the difference between a set and a sorted array.
Then I gave an approach having the top 10 users stored in an array and sorted with every new update to it (user addition and deletion). The rest of the users can be stored in another array (unsorted).
He gave another hint that we have to traverse the whole unsorted array just to get a user.
So I gave third approach where I stored the top 10 users in sorted array and the rest in a hashtable.
I needed a lot of hints to come to this optimal approach, maybe that was a red flag.
Q2. Design an exponentiation function. (It returns a raised to the power of b). I gave a recursive approach.
There was supposed to be another technical round then final HR round but it was called off.
Some days later, the HR asked my current CTC and said the verdict was that my problem solving skills could have been better for both the face to face rounds. They were interviewing other candidates and would reach out to me in a few days if they have requirements.
Verdict: Not selected.