OA
Questions:
- Easy-medium binary search question.
- Hard graph question.
Round 1
Questions:
- How do you manage API Calls?
- Is http.post and http.get scalable?
DSA Question:
- An easy sliding window based question with edge cases.
Puzzle Question:
- There are 3 light bulbs (R,G,B) with 3 switches respectively. Let 000 signify all are off and 111 signify all are on. If more than one bulb is turned on, you will see a mixture of those colors. You have to go from 000 to 111 covering all possible colors in the shortest number of moves such that in one move you can toggle only one bulb.
Candidate's Approach
Identified edge cases in the sliding window question and performed a dry run. For the puzzle, recognized the problem as related to the gray code sequence and provided the correct answer.
Interviewer's Feedback
The interviewer was satisfied with the candidate's approach to the sliding window question and impressed by the quick answer to the puzzle.
Round 2
Questions:
- Discussed projects, including tech stack and project structure.
- What does package.json / pubspec.yaml file store?
- What does package-lock.json / pubspec.lock file store?
- What is the difference between the two?
- What is the difference between dependencies and dev-dependencies?
- How do you send real-time notifications if the app is currently in a dead state?
DSA Question:
- A database contains the list of all batters and their respective runs scored by them. Define a data structure to minimize the time complexity of the following operations:
- Add a batter to the db
- Remove a batter from the db
- getRunsScored(String batter)
- kthHighestRunScorer(int k)
Puzzle Question:
- Alice and Bob are playing a game where during their turn a player selects any number between 1 to 10 (both inclusive) and adds it to the currentSum. Whenever the currentSum reaches 100, the player with the present turn wins. Alice always starts first; derive a strategy for Alice so that she never loses.
Candidate's Approach
Explained the tech stack and project structure but struggled to answer most of the questions about the projects. Took around 10 minutes to devise a data structure for the DSA question but received no feedback. For the puzzle, deduced that Alice needs to reach 89 to win but could not find the correct recursive approach.
Interviewer's Feedback
The interviewer was disappointed with the candidate's inability to answer most project-related questions and did not respond to the data structure answer. The candidate felt bad about not solving the puzzle, which was perceived as easy.