Large deviation asymptotics for occupancy problems