Upwork interview question

Some normal algorithm questions