F5 interview question

Mostly into the javascript, solution and design