- Round I
- Say millions of players are playing a game online and their scores keep changing. Every player is represented by ID and SCORE. How to implement the following queries
- (i) a new player can be added, input will be id and score
- (ii) An existing player’s score can be updated as the game is being played online in real time, input will be id and score
- (iii) any time a player can get its rank, input will be id, return rank
- (iv) any time you should give top k players, where k is not fixed, the input is k, return a list of top k players with id and scores
I tried to solve it with a lot of data structures but a balanced binary search tree appeared me best at that time for all queries. He also asked to handle cases where scores of players are same. There can be two cases: scores of the same players have the same rank and scores of the same players have a different rank on the basis of id.
- Find Excel column name from a given column number
- Say millions of players are playing a game online and their scores keep changing. Every player is represented by ID and SCORE. How to implement the following queries
- Round II
- Recursively remove all adjacent duplicates
This question has ambiguous outputs.
consider input : 1 2 4 5 5 4 4 5 7 8
if you remove first two occurrence of 5 first then output will be 1 2 5 7 8
if you remove first two occurrences of 4 first then output will be 1 2 4 7 8Interviewer only stated the problem did not asked to use recursion or something so I solved it using stack without recursion but took lot of time.
- Ugly Numbers
- Recursively remove all adjacent duplicates
- Round III
- Java Concepts Questions, required proper explanation
- Count all possible paths from top left to bottom right
If you like neveropen and would like to contribute, you can also write an article and mail your article to review-team@geeksforgeeks.org. See your article appearing on the neveropen main page and help other Geeks.
Related Practice Problems
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 neveropen!