A

Arista Networks

SDE

Interview Date

2024

Result

Summer Internship

Difficulty

Medium

Rounds

1 OA + 1 Technical + 1 Hiring Manager

Drive Type

Internship

Topics asked

DSAOSCStringsTreesLinked ListBSTVirtual MemoryREST APIOOPs

Detailed experience

## Round 0: Online Assessment **Type:** Online Assessment **Format:** 3 Coding Problems + 15 MCQs (simple DSA, bash script, OS). ### Coding Problems 1. **String Operations** Given a string `s`, perform a series of operations defined by `l` (start index), `r` (end index), and `op` ("L" or "R"). - Operation "L": Shift characters in range `[l, r]` one position left in the alphabet (e.g., 'a' -> 'z'). - Operation "R": Shift characters in range `[l, r]` one position right in the alphabet (e.g., 'z' -> 'a'). - **Example:** `s = "abcde"`, Ops: `(1, 3, "L")`, `(2, 5, "R")` -> Result: `"zbcea"`. - **Constraints:** Lenient; brute-force approach works. 2. **Binary Substring Counting** Count substrings meeting either condition: - Condition 1: Consecutive '0's followed by equal number of consecutive '1's (e.g., "0011"). - Condition 2: Consecutive '1's followed by equal number of consecutive '0's (e.g., "1100"). 3. **Tree Stone Balancing** Given a tree with $n$ nodes and stones on each. Add minimum stones so the difference between any two adjacent nodes is 0 or 1. --- ## Round 1: Technical Interview **Type:** Technical Interview 1. **C Code Output Prediction** ```c char* c = "Tello"; void modifyString(char* c) { c[0] = 'h'; } int main() { modifyString(c); printf("%s\n", c); return 0; } ``` - **Follow-up Questions:** - Where is the string literal "Tello" stored (static or heap)? - Why is it stored this way? 2. **Linked List Duplicates** - Remove duplicate nodes from a linked list (Time: $O(n)$, Space: $O(n)$). - **Follow-up:** How to modify the approach for a sorted linked list? 3. **Tree Applications** - Real-world example of Tree Data Structure (Answer: File system). 4. **Invert Binary Tree** - Standard LeetCode problem. 5. **BST Successor** - Find the successor of a given value in a Binary Search Tree. 6. **OS Concepts** - Process vs Threads. - Locking Mechanisms and their necessity. - Virtual Memory. - **Scenario:** Downloading a large directory of images from the internet using OS concepts (Answer: Multithreading). --- ## Round 2: Hiring Manager **Type:** Hiring Manager 1. **Resume-Based Questions** - Discussion on startup experience and SRIP (Summer Research Internship Program). - **REST APIs:** Explain REST API in simple terms. How to test them (Postman)? - **System Internals:** How does Postman interact with the backend server if the OS restricts direct inter-process communication? 2. **Operating Systems** - Discussion on favorite course (OS). Explanation of Virtual Memory. 3. **Custom Vector Implementation** - Create a `MyVector` class with `pushback` and index-based retrieval. - **Memory Questions:** Where are class attributes stored (stack vs heap)? Where are dynamically created objects stored? - **Execution Context:** Activation frames, their contents, and stack behavior during recursion. 4. **System Design (Employee Hierarchy)** - Design a data structure for employee-supervisor reporting (Answer: N-ary Tree). - **Coding Task:** Implement the class and a function to print the hierarchy of managers for a given employee ID. ```cpp void printHierarchy(Node *root, int employeeId) { vector hierarchy; help(root, hierarchy, employeeId); for(int i = 0; i < hierarchy.size(); i++) cout << hierarchy[i] << " "; cout << endl; } bool help(Node* root, vector& employeeIds, int employeeId) { employeeIds.push_back(root->employeeId); if(employeeId == root->employeeId) { return true; } for(int i = 0; i < root->reportees.size(); i++) { if(help(root->reportees[i], employeeIds, employeeId)) { return true; } } employeeIds.pop_back(); return false; } ``` 5. **BST Iterator** - Implement an "Inorder Iterator" for a BST. 6. **C++ Internals** - What is a Vtable? Provide a use case (Polymorphism). - Explain runtime polymorphism using a vector of parent pointers storing child object references. --- ## Final Thoughts - Focus areas varied by candidate: some faced CS fundamentals (OS/CN), others faced system design/DSA and resume-based questions. - Knowledge of memory layout, stack vs heap, and Vtables (from Programming Languages course) was crucial. - Interviewers were generally helpful and "chill."
Posted on - 5 Mar 2026