Jefferies Interview Question

you have to write some codes.