Zoox Interview Question

Write the logic pertaining to a pretty commonly found data structure. Again, think about corner cases and implement tests.