Amazon Interview Question

It is about database problem.