Smarsh interview question

Data structures and algorithm, sql