Arista Networks
Shri Krishnaswamy College Interview Questions and Answers
Q1. Find the memory of the given structure (Struct padding is the hint)
The question asks to find the memory of a given structure by considering struct padding.
Struct padding refers to the unused bytes added to align the members of a structure.
To find the memory of a structure, we need to consider the size of each member and the padding added.
The total memory of a structure is the sum of the sizes of its members and the padding.
Q2. Write code to find the position of a number in a BST
Code to find the position of a number in a BST
Implement a recursive function to traverse the BST
Compare the target number with the current node value
If the target is smaller, go to the left subtree; if larger, go to the right subtree
Repeat until the target is found or the subtree is null
Q3. Create a Trie data structure and perform insertion and search on it.
A Trie is a tree-like data structure used for efficient retrieval of strings. It supports insertion and search operations.
A Trie is also known as a prefix tree.
Each node in the Trie represents a character.
The root node represents an empty string.
Each node can have multiple children, each representing a different character.
Insertion involves traversing the Trie and creating new nodes as needed.
Search involves traversing the Trie and checking if the desired string exists.
Tries ...read more
Q4. Internal working of Hashmap in c C++ debugging the code
Hashmap in C/C++ stores key-value pairs using a hash function for fast retrieval.
Hashmap uses a hash function to map keys to indices in an array.
Collision handling is done using techniques like chaining or open addressing.
Hashmap allows for fast insertion, deletion, and lookup of key-value pairs.
Example: std::unordered_map in C++ implements a hashmap.
Debugging hashmap code involves checking hash function, collision resolution, and data retrieval.
Q5. Design a routing table with insert delete and forward functionality. Define its class also
Design a routing table with insert, delete, and forward functionality in a defined class.
Create a class called RoutingTable with methods for insert, delete, and forward
Use a data structure like a hash table or tree to store routing information
Implement insert method to add new routes, delete method to remove routes, and forward method to look up and forward packets
Q6. String compare using char pointers
Comparing two strings using char pointers in C/C++
Use char pointers to iterate through each character of the strings
Compare characters at each position until a difference is found
Return 0 if strings are equal, -1 if first string is less than second, 1 if first string is greater
More about working at Arista Networks
Top HR Questions asked in Shri Krishnaswamy College
Interview Process at Shri Krishnaswamy College
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month