UST interview question

Basic coding