Google Interview Question

The question is a bit tricky, and it's about random array and list.