Arista Networks interview question

Explain the thought process behind how I asnwered the coding questions