MAQ Software interview question

They asked me a dsa question and 2 sql queries