atfinity interview question

Some basic algorithmic questions