Solutions to various interview type questions