Meta Interview Question

a sorting problem and a random sampling problem