Screening Round
Questions:
Question 1
Design a set with the below functionalities:
add(element)
- increments value for element. If not present, add element with value 1.remove(element)
- decrements value for element. If value reaches 0, remove the element. (Was asked to decide what would be a better option in case key was not present)count(element)
- returns count
Question 2
Variant of 528. Random Pick with Weight (binary search solution expected)
Candidate's Approach
No approach provided.
Interviewer's Feedback
Got a call from recruiter with positive feedback.