Whenever you're ready, walk me through how you'd approach this.
What is the time complexity of this portion of code ?
Explain how you would assess the complexity when the code is a SQL query. State what information is needed to give a meaningful estimate and how the query plan can inform your answer.