Equinix interview question

Basic algorithm questions.