Filter interviews by
Array is a collection of elements stored in contiguous memory locations while linked list is a collection of nodes linked by pointers.
Arrays have fixed size while linked lists can grow or shrink dynamically
Insertion and deletion is faster in linked lists than arrays
Accessing elements in arrays is faster than linked lists
Arrays are better for random access while linked lists are better for sequential access
An array of key-value pairs is the best data structure for a dictionary.
Use a hash table or a balanced tree to implement the dictionary.
Keys should be unique and immutable.
Values can be any data type.
Access time should be O(1) or O(log n) depending on the implementation.
Examples: Python's dict, Java's HashMap, C++'s unordered_map.
Hashing is a technique to map data to a fixed-size table. Time complexity of searching a hash table is O(n) in worst case.
Hashing is used to store and retrieve data quickly
It uses a hash function to map data to a fixed-size table
In the best case, searching a hash table takes O(1) time
In the worst case, all the data maps to the same index and searching takes O(n) time
Collision resolution techniques like chaining and ope
A linked list is used to store and manipulate a collection of data elements in a linear order.
Linked lists are commonly used in computer science for implementing data structures like stacks, queues, and hash tables.
They are also used in operating systems for managing memory allocation.
For example, a linked list can be used to implement a music playlist where each song is a node and the links between nodes represent the...
Implement a stack using a linked list
Create a Node class with data and next pointer
Create a Stack class with top pointer
Push new nodes to the top of the stack
Pop nodes from the top of the stack
Check if the stack is empty before popping
BST stands for Binary Search Tree, a data structure used for efficient searching and sorting operations.
BST is a tree-like data structure where each node has at most two children.
The left child of a node contains a value less than the parent node, while the right child contains a value greater than the parent node.
BST allows for efficient searching and sorting operations with a time complexity of O(log n).
Examples of a...
Program to check if a binary tree is a BST
Traverse the tree in-order and check if the values are in ascending order
Use a min-max range for each node to check if it satisfies the BST property
Recursively check if the left and right subtrees are BSTs
Top trending discussions
I applied via Naukri.com and was interviewed in Jul 2024. There was 1 interview round.
Medium difficulty level of questions
Endianess refers to the order in which bytes are stored in memory. Little endian stores the least significant byte first.
Check the byte order of a multi-byte integer value
Use a test value with known byte order to determine the system's endianess
Check the system's documentation or specifications
Use a code snippet to determine the endianess
Function pointers can be shared across processes using inter-process communication mechanisms like shared memory, pipes, sockets, etc.
Function pointers can be stored in shared memory regions that are accessible by multiple processes.
Processes can communicate with each other using pipes or sockets and pass function pointers as arguments.
Remote Procedure Call (RPC) mechanisms can also be used to share function pointers a...
Binder is a mechanism for inter-process communication in Android.
Binder allows different processes to communicate with each other.
It is used for implementing Android's IPC (Inter-Process Communication) system.
Binder uses a client-server model where the client sends requests to the server and the server responds with the requested data.
It is used for sharing data between different components of an Android application.
Bi...
sysctrl is a system control utility used to manage system settings and configurations.
sysctrl is used to manage system settings and configurations such as network settings, power management, and hardware configurations.
It can be used to start, stop, and restart system services.
sysctrl is commonly used in Linux and Unix-based operating systems.
Examples of sysctrl commands include 'sysctrl -p' to reload all settings from...
Device tree is a data structure used to describe hardware components in a system and their interconnections.
Device tree is used in embedded systems to provide a standardized way of describing hardware components.
It is written in a language called Device Tree Source (DTS) and compiled into a binary format called Device Tree Blob (DTB).
The device tree is loaded by the bootloader and used by the kernel to configure the ha...
4 IPCs used in user level process in Linux
Message Queues - allows processes to exchange data through messages
Shared Memory - allows processes to share a portion of memory
Semaphores - used for synchronization between processes
Pipes - allows communication between two related processes
Inter-process communication mechanisms like pipes, sockets, message queues, shared memory can be used to call a function from one user process to another.
Use pipes to establish a unidirectional communication channel between two processes.
Use sockets to establish a bidirectional communication channel between two processes.
Use message queues to send messages between processes.
Use shared memory to share data between proce...
Program with 2 threads printing even and odd numbers in sequence. How to make it SMP safe?
Use mutex locks to ensure only one thread accesses the shared resource (the number to be printed) at a time
Use condition variables to signal when it's safe for the other thread to access the shared resource
Use atomic variables to ensure that the shared resource is accessed atomically
Use thread-safe data structures to store the sha...
Technical Lead
238
salaries
| ₹11.4 L/yr - ₹43 L/yr |
Senior Software Engineer
120
salaries
| ₹10 L/yr - ₹30 L/yr |
Software Engineer
89
salaries
| ₹6 L/yr - ₹20 L/yr |
Manufacturing Engineer
83
salaries
| ₹5.5 L/yr - ₹16 L/yr |
Senior Engineer Mechanical
58
salaries
| ₹9 L/yr - ₹20 L/yr |
Lam Research
KLA
ASML
Entegris