Amazon interview question

Unique paths in a grid(common dp question) Next greater Element in stack