Peloton Technology interview question

Implementation of a simple DS