Deloitte interview question

Write SQL query interpreting loops in that.