Arista Networks interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

Arista Networks
upvote
share-icon
2 rounds | 5 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 8 months
Topics: Data Structures, OOPs, Algorithms, Dynamic Programming, Graphs and Graph algorithms(BFS, DFS)
Tip
Tip

Tip 1 : Regularly participate in contests.
Tip 2 : along with DSA prepare your CS core subjects also.
Tip 3 : Make at least 2 personal projects on trending tech stacks.

Application process
Where: Campus
Eligibility: above 8.5 CGPA
Resume Tip
Resume tip

Tip 1 : Don't bluff in resume.
Tip 2 : You should have at least 2 personal projects.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration90 minutes
Interview date31 Aug 2021
Coding problem3

it was from 10 am - 11.30 am. It was the online coding round having 3 questions. 2 were easy and 1 was of medium difficulty.

1. Merge Intervals

Moderate
20m average time
80% success
0/80
Asked in companies
FacebookInnovaccerSalesforce

You are given N number of intervals, where each interval contains two integers denoting the start time and the end time for the interval.

The task is to merge all the overlapping intervals and return the list of merged intervals sorted by increasing order of their start time.

Two intervals [A,B] and [C,D] are said to be overlapping with each other if there is at least one integer that is covered by both of them.

For example:

For the given 5 intervals - [1, 4], [3, 5], [6, 8], [10, 12], [8, 9].

Since intervals [1, 4] and [3, 5] overlap with each other, we will merge them into a single interval as [1, 5].

Similarly, [6, 8] and [8, 9] overlap, merge them into [6,9].

Interval [10, 12] does not overlap with any interval.

Final List after merging overlapping intervals: [1, 5], [6, 9], [10, 12].
Problem approach

first i sorted the given array on the basis of start time of given intervals. we will iterate the sorted list now and try to maximize the range of each interval if ending time is less than start time of next pair then we will merge this current pair with next one and update our current end time with end time of next one.
this is the code for above logic -->
int st = a[0][0];
int en = a[0][1];
int n = a.size();
for(int i = 1;i {
if(a[i][0]<=en)
{
en = max(a[i][1],en);
}
else
{
ans.push_back({st,en});
st = a[i][0];
en = a[i][1];
}

}
ans.push_back({st,en});

Try solving now

2. 0 1 Knapsack

Easy
15m average time
85% success
0/40
Asked in companies
TwitterWalmartAmazon

A thief is robbing a store and can carry a maximal weight of W into his knapsack. There are N items and the ith item weighs wi and is of value vi. Considering the constraints of the maximum weight that a knapsack can carry, you have to find and return the maximum value that a thief can generate by stealing items.

Problem approach

it is a very standard problem of dynamic programming. in this for each move we will either take it or not take it. code -->
for(int i = 1;i<=n;i++)
{
for(int j = 1;j<=c;j++)
{
if(w[i-1]>j)
{
dp[i][j] = dp[i-1][j];
}
else 
{
dp[i][j]= max(v[i-1] + dp[i-1][j - w[i-1]],dp[i-1][j]);
}
}
}

Try solving now

3. Sorting Characters By Frequency

Moderate
25m average time
75% success
0/80
Asked in companies
Info Edge India (Naukri.com)AdobeUber

You have been given a string ‘S’.


You must return the string ‘S’ sorted in decreasing order based on the frequency of characters.

If there are multiple answers, return any of them.


Example :
Let 'S'= “abAb”. 

Here the characters ‘a’ and ‘A’ have frequency 1 and character ‘b’ has frequency ‘2’.  

Therefore the sorted string is “bbAa”. 
Problem approach

firstly store the frequency of each element and then store it in set of pair and then reverse it. then iterate the set and push the elements in ans string.
code -->

unordered_map mp;
for(auto &op : s)
mp[op]++;
set,greater<>> ss;
for(auto &op : mp)
{
ss.insert({op.second,op.first});
}
string ans;
for(auto &op : ss)
{
for(int j = 0;j {
ans.push_back(op.second);
}
}

Try solving now
02
Round
Medium
Video Call
Duration50 minutes
Interview date1 Sep 2021
Coding problem2

it was aound 10am - 11 am. interviewer was good and he was very supportive.

1. Minimum Boats To Cross River

Easy
15m average time
85% success
0/40
Asked in companies
MicrosoftSalesforceSnapdeal Ltd.

Ninja and his friends are on a trip. They have come across a river and want to cross the river with the help of boats. There are a total of 'N' people on the trip including Ninja himself. The weight of each person is given in an array 'ARR'. One boat can accommodate at most two persons only if the sum of their weight does not exceed 'L', i.e., the maximum weight capacity of the boat, otherwise, the boat will accommodate only one person. Given the weight of each person and the maximum weight capacity 'L', your task is to find the minimum number of boats required to ensure that everyone crosses the river.

Try solving now

2. Predict Output

Question 1 -->

         int main(int argc , char *argv[])
          {
              printf("%c",**++argv);
          }

Question 2 -->    

         int *x[N];
         x=(int(*)[N])malloc(M*sizeof(*x));
         printf("%d %d",sizeof(x),sizeof(*x));

Problem approach

I was not able to answer these questions as i was not good in core C concepts such as pointer.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

What is recursion?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by OYO
4657 views
0 comments
0 upvotes
company logo
SDE - 1
4 rounds | 11 problems
Interviewed by Arista Networks
3759 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 5 problems
Interviewed by Meesho
6451 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 9 problems
Interviewed by Salesforce
3452 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
15481 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
15339 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
10142 views
2 comments
0 upvotes