arista network logo

Arista Network Interviews

2 experiences57 reads4 questions0% success rate
Arista Network Interview Experience
arista network logo
Arista Network
Ongoing
October 2, 202533 reads

Summary

I had an interview at Arista Network focusing on C++ pointer concepts, including debugging code and fixing logical errors to achieve a desired output. I successfully navigated both parts of the problem.

Full Experience

My interview at Arista Network began with a C++ debugging problem. The interviewer presented me with a code snippet involving pointers and asked me to predict its output and explain the reasoning. I correctly determined that the output would be 'Value: 10' and explained that the function receives a copy of the pointer, so reassigning p within the function does not affect the original ptr in main. Following this, I was challenged to modify the function to make the program print 'Value: 100'. I proposed dereferencing p and assigning the value of x to the memory location it pointed to, thereby altering the value of a in main to 100.

Interview Questions (2)

Q1
C++ Pointer Debugging - Output Prediction
Data Structures & AlgorithmsMedium

What will be the output of the provided C++ code snippet and why?

#include <iostream>
using namespace std;

void function(int *p) { int x = 100; p = &x; }

int main() { int a = 10; int *ptr = &a; function(ptr); cout << "Value: " << *ptr << endl; return 0; }

Q2
C++ Pointer Debugging - Correcting Function Logic
Data Structures & AlgorithmsEasy

Given the previous C++ code snippet, how would you modify the function to make it print Value: 100 instead of Value: 10, by changing only the function body?

Original function:

void function(int *p) {
    int x = 100;
    p = &x;
}
Arista Network | Interview Experience | 6+ year of experience
arista network logo
Arista Network
6 yearsRejected
December 13, 202424 reads

Summary

I recently interviewed with Arista Network for a first-round technical position where I confidently solved two coding problems. Despite my strong performance, I was unfortunately rejected, with HR citing alleged struggles which I believe were entirely unfounded.

Full Experience

I recently completed my first-round interview with Arista Network. The interview was conducted by a principal engineer and primarily focused on two coding questions. I was presented with the problem Remove Linked List Elements, which I successfully solved within 10 minutes, achieving an optimal O(N) time complexity and O(1) space optimization.

The second question I tackled was Remove All Occurrences of a Substring. For this problem, I demonstrated two distinct approaches: one utilizing C++ Standard Template Library (STL) features and another purely iterative method. Both solutions maintained an overall time complexity of O(N). Throughout the coding session, I made sure to run all test cases provided by the interviewer and thoroughly discussed various corner cases for both problems.

Following the technical segment, we transitioned into a positive discussion regarding my current project. It's worth noting that I was not feeling well on the day of the interview, yet I still joined the call and believe I effectively completed all the Data Structures and Algorithms problems.

However, the feedback I subsequently received from HR indicated that Arista Network was not inclined to move forward with my application. They stated that I was supposedly unable to solve the second question and struggled with basic problem-solving skills. I find this feedback entirely baseless and believe the interviewer may not have fully comprehended my C++ code. As a candidate, I put significant effort into preparing for interviews, and such inaccurate assessments can be incredibly disheartening.

Interview Questions (2)

Q1
Remove Linked List Elements
Data Structures & AlgorithmsEasy

Given the head of a linked list and an integer val, remove all the nodes of the linked list that have Node.val == val, and return the new head.

Q2
Remove All Occurrences of a Substring
Data Structures & AlgorithmsMedium

Given two strings s and part, remove all occurrences of part from s. You may remove the leftmost occurrence at each step. Return s after removing all occurrences of part.

Have a Arista Network Interview Experience to Share?

Help other candidates by sharing your interview experience. Your insights could make the difference for someone preparing for their dream job at Arista Network.