Arista Networks Interview Question

1. Fix the crash and write some function(Coding round)