Amazon Interview Question

1) Display recent items visited by user 2) find min swap to sort a binary array in asc or dsc