Arista OA Experience 2026 | Aptitude + Core CS + 3 Coding Questions

arista logo
arista
September 27, 2026 · 1 reads

Summary

I completed the Arista online assessment which included aptitude, core CS MCQs, and three coding questions.

Full Experience

Arista OA Experience 2026 | Aptitude + Core CS + 3 Coding Questions

I recently appeared for the Arista Online Assessment and wanted to document the pattern and the questions I remember.

The OA had a mix of aptitude/core CS MCQs and 3 coding questions. The technical section especially focused on Operating Systems, hashing, bit manipulation, time complexity and C/C++ output tracing.


Coding Questions

Q1. LFU Cache

This was an exact match with:

LeetCode 460 – LFU Cache

We had to implement an LFU Cache supporting operations similar to:

get(key)
put(key, value)

When the cache reaches capacity, the least frequently used key must be removed.

If multiple keys have the same frequency, the least recently used among them is removed.

Topics

  • Hash Map
  • Doubly Linked List
  • Frequency Map
  • Design
  • Cache Implementation

Q2. API Bandwidth Allocation

This was essentially a 0/1 Knapsack variant.

We were given:

  • Maximum available bandwidth
  • Bandwidth required by each API endpoint
  • Number of requests that could be resolved by each endpoint

We had to allocate the available bandwidth in such a way that the maximum number of requests could be resolved.

The mapping to 0/1 Knapsack was:

Maximum Bandwidth   -> Knapsack Capacity
Endpoint Bandwidth  -> Weight
Requests Resolved   -> Value

Goal:

Maximize total requests
such that
total bandwidth used <= maximum bandwidth

Topics

  • Dynamic Programming
  • 0/1 Knapsack
  • Optimization

Q3. Easy Coding Question

The third coding question was comparatively easy, but unfortunately I don't remember the exact statement.

If anyone appeared for the same Arista OA and remembers Q3, please add it in the comments.


Technical / Aptitude Questions

Q1. fork() Output Question

A code snippet was similar to:

int main() {
    fork();
    printf("Hello");

    fork();
    printf("Hello");

    fork();
    printf("Hello");
}

We had to determine how many times "Hello" would be printed.

If the code is exactly as above:

After first fork  -> 2 prints
After second fork -> 4 prints
After third fork  -> 8 prints

Total:

14

Q2. FIFO Page Replacement

Number of frames:

4

Reference string:

1 2 3 4 5 1 3 1 2

We had to calculate the number of page faults using FIFO.

Tracing it gives:

1 -> Fault
2 -> Fault
3 -> Fault
4 -> Fault
5 -> Fault
1 -> Fault
3 -> Hit
1 -> Hit
2 -> Fault

So the answer is:

7 Page Faults

Q3. Hashing – Number of Collisions

Hash table/bucket size:

10

Keys were:

43, 165, 62, 123, 142

Assuming the usual hash function:

h(x) = x % 10

we get:

43  -> 3
165 -> 5
62  -> 2
123 -> 3   Collision
142 -> 2   Collision

Therefore:

2 collisions

Q4. Bitwise XOR

A question was similar to:

A = 01000001
B = 01000010

D = A ^ B

Performing XOR:

01000001
01000010
--------
00000011

So:

D = 00000011

Q5. Time Complexity

A code snippet was similar to:

for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j += i) {
        for (int k = 1; k <= n; k += 2) {
            // O(1)
        }
    }
}

The important observation is that the second loop does not always run n times.

For a particular i:

j loop -> approximately n/i
k loop -> approximately n

Therefore:

T(n) = \sum_{i=1}^{n} \frac{n}{i} \cdot n = n^2 \sum_{i=1}^{n} \frac{1}{i}

Since:

\sum_{i=1}^{n}\frac1i = \Theta(\log n)

the complexity is:

\boxed{\Theta(n^2\log n)}

Q6. Coding-Decoding

Given:

CRAYONS -> NMRYBSD

Find the code for:

FLOWERS -> ?

This was an alphabet/coding-decoding pattern question.

I don't remember the exact rule clearly enough to reconstruct the final answer.


Q7. C/C++ Post-Increment Output

A question was similar to:

for (int i = 0; i < 5; i++) {
    if (x++ == 4)
        break;
}

cout << x;

We had to trace the value of x.


Topics Covered in the OA

The OA covered a fairly wide range of CS fundamentals:

Operating Systems

  • fork()
  • Process creation
  • FIFO Page Replacement

Data Structures

  • LFU Cache
  • Hashing
  • Hash Collisions

Dynamic Programming

  • 0/1 Knapsack

Bit Manipulation

  • XOR

Programming Fundamentals

  • C/C++ Output Questions
  • Post Increment
  • Loop Tracing

Complexity Analysis

  • Nested Loops
  • Harmonic Series
  • Big-O / Theta Analysis

Aptitude

  • Coding-Decoding

Overall Experience

The Arista OA was interesting because it was not purely a DSA test.

It tested both:

  • Coding ability
  • Strong CS fundamentals

The coding questions ranged from an implementation‑heavy problem like LFU Cache, to a classic 0/1 Knapsack variant, along with one comparatively easy problem.

For anyone preparing for Arista, I would recommend revising:

  • LeetCode 460 – LFU Cache
  • 0/1 Knapsack
  • Operating Systems
  • fork()
  • Page Replacement Algorithms
  • Hashing
  • Bit Manipulation
  • C/C++ Output Questions
  • Time Complexity Analysis

Interview Questions (7)

1.

LFU Cache

Data Structures & Algorithms·Hard

Implement an LFU (Least Frequently Used) cache with get(key) and put(key, value) operations. When the cache reaches its capacity, the key with the lowest access frequency should be evicted. If multiple keys share the same frequency, evict the least recently used among them. This matches LeetCode problem 460.

2.

API Bandwidth Allocation

Data Structures & Algorithms

Given a maximum available bandwidth, a list of API endpoints each with a required bandwidth (weight) and a number of requests it can resolve (value), allocate bandwidth to maximize the total number of resolved requests without exceeding the bandwidth limit. This is a 0/1 knapsack variant where:

  • Capacity = Maximum Bandwidth
  • Weight = Endpoint Bandwidth
  • Value = Requests Resolved
3.

fork() Output Question

Other·Easy

Code snippet:

int main() {
    fork();
    printf("Hello");

    fork();
    printf("Hello");

    fork();
    printf("Hello");
}

Determine how many times the string "Hello" is printed. The execution creates 2 prints after the first fork, 4 after the second, and 8 after the third, totaling 14 prints.

4.

FIFO Page Replacement

Other·Easy

Given 4 frames and the reference string 1 2 3 4 5 1 3 1 2, compute the number of page faults using the FIFO replacement policy. The trace results in page faults for the accesses: 1,2,3,4,5,1,2 (7 faults total).

5.

Hashing – Number of Collisions

Other·Easy

Hash table size is 10. Keys: 43, 165, 62, 123, 142. Using h(x) = x % 10, the hash values are 3,5,2,3,2 respectively, causing collisions at values 3 and 2. Total collisions: 2.

6.

Bitwise XOR

Other·Easy

Compute D = A ^ B where A = 01000001 and B = 01000010. Performing bitwise XOR yields D = 00000011.

7.

Time Complexity of Nested Loops

Other·Medium

Analyze the time complexity of:

for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j += i) {
        for (int k = 1; k <= n; k += 2) {
            // O(1)
        }
    }
}

The inner k loop runs O(n) times, the j loop runs approximately n/i times, and the outer i loop runs n times. The total work is Θ(n^2 log n).

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!