For freshers (Software Engineer / Developer roles), the typical interview process includes:
For experienced candidates, the aptitude/written round may be skipped, and the process focuses more on coding, design, and project discussion.
Pass by value sends a duplicate of the variable, so changes don’t affect the original. Pass by reference sends memory address, so modifications reflect in the original variable. C supports both; Java uses pass-by-value but object references behave similarly to reference passing. Understanding this avoids unintended modification bugs.
Inline suggests the compiler replace function calls with the function body to reduce calling overhead. It is useful for small and frequently used functions. It should not be used for recursion, loops, or large functions because it expands binary size and can slow performance.
A dangling pointer points to memory that has already been freed. Accessing it may lead to undefined behavior or segmentation faults. It often occurs due to premature delete/free and out-of-scope pointers. Always assign NULL after freeing memory to avoid this.
A virtual destructor ensures that when deleting a derived object through a base pointer, both base and derived destructors execute. Without it, only the base destructor runs, causing memory leaks. It supports proper cleanup via runtime binding.
Two different keys mapping to the same index cause collision. Handling techniques include chaining (linked list), open addressing (linear/quadratic probing), and double hashing. Efficient hash design and rehashing reduce collision frequency.
Greedy decisions optimize locally, hoping to achieve global optimum but fail on many problems like 0/1 knapsack. DP solves using optimal substructure and overlapping subproblems via memoization or tabulation. Greedy is faster but less reliable.
BFS uses a queue and explores level by level, ideal for shortest path in unweighted graphs. DFS uses a stack or recursion and helps detect cycles and perform backtracking in deep search tasks. BFS requires more memory for wide graphs.
Backtracking incrementally builds solutions and abandons paths when constraints are violated. It is used in N-Queens, Sudoku, and string permutations. It’s effective with pruning but can still exhibit exponential time in worst cases.
Memoization caches results of expensive function calls to avoid recomputation. Improves recursive algorithms like Fibonacci from exponential to linear. It follows top-down dynamic programming.
A BIT supports prefix sum queries and updates in O(log n) time. It uses least significant bit operations to adjust tree indexes. Widely used in frequency tables and range queries requiring both fast updates and fast lookups.
It models how two processes share a fixed buffer: the producer adds items while the consumer removes them. Synchronization is necessary to avoid race conditions, overflows, and underflows. Semaphores and mutexes are used to solve it.
Paging divides memory into fixed-size blocks eliminating external fragmentation. Segmentation groups memory by logical program units and may cause fragmentation. Some systems combine both to leverage advantages.
Mutex puts a thread to sleep if a lock is unavailable. Spinlock continuously checks (spins) until lock is free. Spinlocks are better for short critical sections on multiprocessor systems.
Thrashing occurs when a system spends most of its time swapping pages instead of executing. It results from insufficient memory for active processes. Solutions include working-set models and reducing the degree of multiprogramming.
Synchronization ensures data consistency when processes share resources. Communication enables exchange of data between processes. Both are critical in concurrent programming and implemented via shared memory, pipes, sockets, and message queues.
Shadow copy duplicates only object references, causing shared underlying memory and unwanted changes. Deep copy clones the entire object and its members, preventing shared state but costing more memory and time.
Abstract class supports partial abstraction and can include state. Interface enforces full abstraction and allows multiple inheritance. Chosen based on design constraint and relationship modeling.
It allows method execution based on runtime types of two objects. Implemented using the Visitor pattern. Useful for adding new operations without modifying existing class structures.
Overloading is compile-time polymorphism and depends on signature variation. Overriding is runtime polymorphism where derived classes define their own version of base functions. Overriding must follow type and visibility constraints.
Atomicity ensures transactions execute all or none. Consistency maintains data rules. Isolation manages concurrent transactions without interference. Durability ensures committed data persists even after failures.
Inner returns matching records. Left/Right retain non-matching from one side. Full returns all rows from both. Cross produces Cartesian pairs. Self join enables row comparisons within the same table.
Normalization reduces redundancy and anomalies using 1NF to BCNF. Denormalization increases redundancy to speed up heavy read workloads. Real systems often balance both.
SPs are precompiled SQL blocks stored on the server, reducing parsing overhead. Improve performance, encapsulation, and security. Also reduce network traffic by executing logic server-side.
DB engines choose optimal execution plans using table statistics, indexing, and join orders. Index scanning vs full scanning affects speed. Tools like EXPLAIN reveal query decisions.
Memory allocated but not released leads to reduced system performance over time. Causes include lingering references, improper delete/free, or circular references. Debuggers and profilers detect leaks.
Smart pointers automate memory management via RAII. unique_ptr enforces exclusive ownership, shared_ptr shares ownership via reference counting, and weak_ptr prevents cyclic dependencies.
Operations that produce unpredictable results at runtime, like out-of-bounds access or using uninitialized variables. Compilers make no guarantees and results vary across executions.
Virtual memory maps virtual addresses to physical pages and swaps inactive pages to disk. It supports large processes and memory isolation. Paging tables translate virtual to physical addresses.
Journaling logs metadata changes before updating the real file system. Prevents corruption after power failure and makes recovery quicker. Used by NTFS and ext4.
RAID improves storage performance or redundancy. RAID 0 uses striping, RAID 1 mirroring, RAID 5 parity, RAID 10 mixes mirroring and striping for high performance and safety.
Programs accessing data close in space/time perform better due to caching. QuickSort operates locally on small subarrays, enhancing cache performance, unlike MergeSort which accesses scattered memory.
NP problems are verifiable in polynomial time. NP-Complete are hardest among NP. NP-Hard problems are at least as hard as NP-Complete but may not be verifiable in poly time.
Assign colors to vertices such that no two adjacent vertices share same color. It is NP-Complete and has applications in compiler register allocation and scheduling tasks.
LRU removes the least recently accessed item first. Implemented using HashMap + Doubly Linked List for O(1) get and put operations. Common in browsers and DB caching.
Singleton restricts instantiation to one object globally. In multithreading, race conditions can create multiple objects. Double-checked locking and static initialization ensure thread-safe instances.
A subject notifies registered observers when state changes. It supports loose coupling and event-driven architecture. Useful in GUIs and distributed messaging.
Producer–consumer exchanges items directly with bounded synchronization. Publisher–subscriber uses a broker to distribute messages to multiple subscribers, allowing high scalability and decoupling.
REST APIs must follow statelessness, client-server design, cacheability, uniform interface, and layered system. Followed correctly, they scale well for distributed web systems.
JWT is a token format for claims; OAuth is an authorization framework for delegated permissions. OAuth can use JWT or opaque tokens during access management.
Client validates server certificate, negotiates encryption keys, and initiates TLS session. It protects against eavesdropping and MITM attacks, enabling secure communication.
Paging moves portions of process memory between disk and RAM. Swapping exchanges the whole process image with disk and back. Swapping is slow and mostly replaced by paging.
Two threads modify variables located on the same CPU cache line causing performance degradation due to constant invalidation. Padding prevents this issue.
Atomic compare-and-swap can misinterpret A → B → A changes as unchanged. Happens in lock-free structures. Version tagging solves it.
It orders nodes in a directed acyclic graph so dependencies appear before dependents. Useful in build systems, scheduling, and compiler linking. Implemented using Kahn’s algorithm or DFS.
A prefix tree storing characters by level where keys share prefixes. Enables fast dictionary lookups and autocomplete in O(length). Memory-intensive but efficient for large datasets.
A tree for range queries and point updates in logarithmic time. Suitable for sum, min, max, and XOR queries. Lazy propagation optimizes updates on large segments.
A probabilistic structure to test membership. It guarantees no false negatives but may return false positives. Used for caching, databases, and spam filters with minimal memory.
Uniformly distributes keys across nodes and reduces data movement when adding/removing servers. Used in load balancers, distributed caches, and DHT systems.
Map splits tasks and processes them in parallel; Reduce aggregates results. Ideal for massive distributed computing (e.g., Hadoop). Ensures fault tolerance and high throughput.
Uses hashing to generate short key, maps it to original URL using database, and caches frequently accessed links. Must handle collisions, redirects, metrics, and high availability at scale.