Round 1 | DSA
Questions:
-
Given an array of probabilities
array = [0.5, 0.7, 0.1, 1, 0.3]
andK = 3
, find the sum of all probabilities where we can get K heads.- Example: For K = 3, possible combinations include THHTH, HHHTT, TTHHH, etc.
-
Minimize a string consisting only of A's and B's by deleting occurrences of AA or BB in as few moves as possible.
- Input:
AABABBA
- Output:
"B"
(removing AA and BB results in a total of 3 deletions).
- Input:
Candidate's Approach
- For the first question, I spent some time using a dynamic programming solution and was able to figure out the approach.
- For the second question, I managed to code the solution effectively.
- The interviewer seemed happy with my overall performance, and I was given an extra 10 minutes beyond the scheduled 60 minutes.
Interviewer's Feedback
No feedback provided.
Round 2 | LLD
Questions:
- Design a vending machine.
Candidate's Approach
- I provided a class diagram and discussed the states of the vending machine.
- I started coding the solution and explained my thought process, but I struggled with managing the states and ran out of time before completing the solution.
Interviewer's Feedback
The interviewer was not happy with this round.