Pregunta de entrevista de SpaceX

Fairly open ended question with implementation in C++.