Amazon interview question

intervals and monotonic stacks .....