F5 Interview Question

Solve the following coding question