Pure Storage | MTS3 | Bangalore | June 2024 [Reject]
Anonymous User
3972

Giving back to the community. I looked far and wide but could not find anything good to properly prepare myself before interviewing but here's hoping some of you can benefit.

Coding-1

Implement set functionality with APIs like:

  • put(val): store val into set
  • lookup(val): check if val in set and return T/F
  • remove(val): remove val from set
  • clear(): clear the whole set
  • iterate(): 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).

Coding-2

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()
There two APIs will operate starting from leaf level and the remaiming nodes in the tree will need fixup according to the property.

End

All in all it was a breath of fresh air to have such an interactive session with the interviewers, working through the solution and making improvements step by step.

Comments (4)