Wolfram Research Interview Question

some algorithm questions