Wolfram Research interview question

some algorithm questions