Pony.ai Interview Question

Two algorithm questions.