UST interview question

Core concepts and a DSA problem