Arista Networks | 6 yrs experience
Summary
I had an interview at Arista Networks for a role that involved two rounds, covering data structures & algorithms, low-level design, and system design, leveraging my 6 years of experience.
Full Experience
I went through two interview rounds at Arista Networks.
Round 1 focused on data structures and algorithms. I was given two coding problems to solve. The first was a known problem about counting numbers smaller than the current number in an array, and the second was a tree traversal problem to identify 'special' nodes based on their path from the root.
Round 2 covered design concepts. It started with a Low-Level Design (LLD) discussion where I had to detail the design of classes, interfaces, attributes, and methods, with a specific constraint of not using databases or complex data structures. I also delved into UI aspects, including API design, data models, method invocations, and how data structures would be manipulated in response to API calls. Following this, I tackled a System Design problem: designing a URL shortener with features like custom URLs, auto-generated URLs, full CRUD functionality, hit frequency statistics, and an auto-cleanup mechanism for unused URLs.
Interview Questions (4)
Given an array nums, for each nums[i] find out how many numbers in the array are smaller than it. That is, for each nums[i] you have to count the number of valid j's such that j != i and nums[j] < nums[i].
Input: [8,1,2,2,3]
Output: [4,0,1,1,3]
A node X is said to be special if in the path from root to X there are no nodes with a value greater than X. Return the number of valid special nodes in the tree.
Example:
3
/ \
1 4
/ /
3 1 5Valid nodes: 4 (3, 4, 5, 3).I was asked to discuss Low-Level Design principles. This included detailing the design of classes, interfaces, attributes, and methods, with the constraint of not using databases or advanced data structures. Additionally, I needed to explain UI interaction, covering what kind of APIs, data models, and methods APIs would invoke, and how data structures would be manipulated upon API calls.
I was asked to design a URL shortener system. The requirements included:
- Support for custom user-defined short URLs (e.g.,
www.google.com/news/date/123/xcxcxcxcmapping totiny/news). - Support for auto-generated short URLs (e.g.,
www.dfssssmapping tomy/ab123). - Description of how to implement add, update, and delete functionality.
- Tracking statistics, specifically the frequency of how many times a URL was hit.
- An auto-cleanup mechanism for unused URLs.