ThoughtSpot interview question

This was a Data Structures implementation question