Amazon interview question

Hard programming questions regarding algorithms