Amazon interview question

they asked many programs with mentioned time complexities