Deloitte interview question

Second max salary query