Round 1
Questions: Implement set functionality with APIs like:
put(val)
: store val into setlookup(val)
: check if val in set and return T/Fremove(val)
: remove val from setclear()
: clear the whole setiterate()
: wasn’t clear on this but you had to do something while iterating through current elements in set
The end goal is to have them all perform close to constant time (except iterate()
which would need you to go through all current elements).
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.
Round 2
Questions:
Given a perfect binary tree (not complete) with node value either 0 or 1 and a property where a node is 1 only if both children are 1. The requirement was to come up with implementation for two APIs: clear()
and set()
. These two APIs will operate starting from leaf level and the remaining nodes in the tree will need fixup according to the property.
Candidate's Approach
No approach provided.
Interviewer's Feedback
No feedback provided.