Deloitte Interview Question

What was the most complicated SQL query you have solved? How did you optimize it?