Arista Networks Interview Question

Please do this coding problem.