Pregunta de entrevista de Apple

Difficult algorithm questions on system design