Arista OA Experience 2026 | Aptitude + Core CS + 3 Coding Questions
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 -> ValueGoal:
Maximize total requests
such that
total bandwidth used <= maximum bandwidthTopics
- 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.
This tested understanding of how fork() creates new processes.
If the code is exactly as above:
After first fork -> 2 prints
After second fork -> 4 prints
After third fork -> 8 printsTotal:
14Q2. FIFO Page Replacement
Number of frames:
4Reference string:
1 2 3 4 5 1 3 1 2We 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 -> FaultSo the answer is:
7 Page FaultsQ3. Hashing – Number of Collisions
Hash table/bucket size:
10Keys were:
43, 165, 62, 123, 142Assuming the usual hash function:
h(x) = x % 10we get:
43 -> 3
165 -> 5
62 -> 2
123 -> 3 Collision
142 -> 2 CollisionTherefore:
2 collisionsQ4. Bitwise XOR
A question was similar to:
A = 01000001
B = 01000010
D = A ^ BPerforming XOR:
01000001
01000010
--------
00000011So:
D = 00000011Q5. 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 nTherefore:
[
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 -> NMRYBSDFind 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.
This tested the difference between:
x++and:
++xThe final answer depended on the initial 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


