100 Essential Computer Science Engineering Questions You Must Know (with Answers & Examples)

Computer Science Engineering (CSE) is a dynamic field that merges the theoretical foundations of computer science with the practical engineering skills needed to design, develop, and implement software and hardware systems. Whether you’re a student, a software developer, a system architect, or preparing for an engineering interview, a strong grasp of these core concepts is indispensable.

This extensive guide presents 100 of the most common and critical questions across key CSE domains: Data Structures & Algorithms, Object-Oriented Design, Operating Systems, Database Systems, Computer Networks, Software Engineering Principles, and System Design. Each question includes a concise answer and a real-world example to enhance your understanding.

Let’s engineer some knowledge!

Section 1: Data Structures & Algorithms (DSA) – Questions 1-30

DSA remains the bedrock for efficient and scalable software solutions in Computer Science Engineering.

  1. What is an Algorithm?
    • Answer: A well-defined, step-by-step procedure or set of rules used to solve a specific problem or perform a computation.
    • Example: Euclid’s algorithm to find the greatest common divisor (GCD) of two numbers.
  2. Explain Big O Notation.
    • Answer: A mathematical notation that classifies algorithms by how their run-time or space requirements grow as the input size (n) increases, focusing on the worst-case scenario.
    • Example: Searching an unsorted array takes O(N) time.
  3. Difference between Array and Linked List?
    • Answer: Arrays store elements in contiguous memory, allowing O(1) random access but O(N) insertion/deletion. Linked Lists use nodes with pointers, allowing O(1) insertion/deletion at ends but O(N) for random access.
    • Example: A Python list often uses dynamic arrays; a JavaScript array can behave more like a linked list in some operations.
  4. What is a Hash Table? How does it handle collisions?
    • Answer: A data structure that maps keys to values using a hash function for O(1) average-case lookup. Collisions (multiple keys hashing to the same index) are handled via chaining (linked list at each index) or open addressing (probing for the next empty slot).
    • Example: A dictionary in Python (dict) uses hash tables.
  5. What is a Binary Search Tree (BST)? What is its average time complexity for search/insert/delete?
    • Answer: A tree where the left child’s value is less than the parent, and the right child’s value is greater. Average time complexity is O(logN).
    • Example: Used in database indexing where data needs to be retrieved quickly in sorted order.
  6. What is the importance of a balanced BST (e.g., AVL, Red-Black Tree)?
    • Answer: They maintain a balanced height, preventing degeneration to a linked list (O(N) operations) and ensuring O(logN) performance in worst-case scenarios for search, insertion, and deletion.
    • Example: Java’s TreeMap uses a Red-Black Tree.
  7. Explain Stacks and Queues with real-world analogies.
    • Answer: A Stack is LIFO (Last-In, First-Out), like a pile of plates. A Queue is FIFO (First-In, First-Out), like a line at a ticket counter.
    • Example: Function call stack uses a Stack; print job spooler uses a Queue.
  8. What is a Heap data structure? (Min-Heap vs. Max-Heap)
    • Answer: A complete binary tree that satisfies the heap property: in a Min-Heap, parent nodes are smaller than children; in a Max-Heap, parent nodes are larger. Used for efficient retrieval of min/max elements.
    • Example: A Priority Queue is often implemented using a Heap.
  9. Difference between BFS (Breadth-First Search) and DFS (Depth-First Search)?
    • Answer: BFS explores level by level (uses a Queue). DFS explores as deep as possible before backtracking (uses a Stack or recursion).
    • Example: BFS finds the shortest path in an unweighted graph; DFS is used for topological sorting.
  10. When would you use a Graph data structure?
    • Answer: To model relationships between interconnected entities.
    • Example: Social networks (users are nodes, friendships are edges), airline flight routes, network topologies.
  11. Explain Dijkstra’s Algorithm.
    • Answer: An algorithm to find the shortest paths between nodes in a graph, with non-negative edge weights. It explores the graph outwards from a starting node.
    • Example: Used by GPS systems to calculate the shortest route between two locations.
  12. What is Dynamic Programming? Provide an example.
    • Answer: An optimization technique that solves complex problems by breaking them into simpler overlapping subproblems and storing their results to avoid redundant computations (memoization or tabulation).
    • Example: Calculating the Nth Fibonacci number more efficiently by storing previously computed values.
  13. What is a Greedy Algorithm?
    • Answer: An algorithm that makes the locally optimal choice at each stage with the hope of finding a global optimum. It doesn’t always guarantee the best solution.
    • Example: Kruskal’s or Prim’s algorithm for finding a Minimum Spanning Tree.
  14. What is the Time Complexity of Quick Sort in average and worst cases?
    • Answer: Average O(NlogN); Worst-case O(N2) (e.g., if the pivot selection consistently chooses the smallest or largest element).
  15. What is a “stable” sorting algorithm? Give an example.
    • Answer: A sorting algorithm is stable if it preserves the relative order of equal elements.
    • Example: Merge Sort is stable; Quick Sort is generally not.
  16. How does Binary Search work? What are its prerequisites?
    • Answer: Efficiently finds a target value in a sorted array by repeatedly dividing the search interval in half. Prerequisite: The array must be sorted.
  17. What is a Trie (Prefix Tree)? Where is it used?
    • Answer: A tree-like data structure used to store a dynamic set of strings, where nodes represent common prefixes.
    • Example: Autocomplete features, spell checkers, IP routing tables.
  18. Difference between an Abstract Data Type (ADT) and a Data Structure?
    • Answer: An ADT is a logical description of what operations can be performed (e.g., Stack, Queue). A Data Structure is a concrete implementation of an ADT, specifying how those operations are performed (e.g., array-based stack, linked-list-based queue).
  19. What is recursion? When should it be used?
    • Answer: A function that calls itself to solve a problem, often breaking it into smaller, identical subproblems. Used when a problem can be defined in terms of itself.
    • Example: Calculating factorials (n! = n * (n-1)!) or traversing a tree.
  20. What is memoization?
    • Answer: An optimization technique used primarily in dynamic programming to speed up computations by storing the results of expensive function calls and returning the cached result when the same inputs occur again.
    • Example: Caching intermediate Fibonacci numbers to avoid re-calculation.
  21. What is Amortized Analysis in algorithm complexity?
    • Answer: Analyzing the average cost per operation over a sequence of operations, where some operations are expensive but rare, and most are cheap.
    • Example: Dynamic array resizing (most appends are O(1), but occasional resize is O(N)).
  22. What is a Disjoint Set Union (DSU) data structure?
    • Answer: A data structure that keeps track of a set of elements partitioned into a number of disjoint (non-overlapping) subsets. It supports find (which set an element belongs to) and union (merge two sets) operations.
    • Example: Used in Kruskal’s algorithm for MST, or detecting cycles in a graph.
  23. What is a Topological Sort? What kind of graphs can be topologically sorted?
    • Answer: A linear ordering of vertices such that for every directed edge u→v, vertex u comes before v in the ordering. Only possible for Directed Acyclic Graphs (DAGs).
    • Example: Task scheduling (dependencies), course prerequisites.
  24. How do you detect a cycle in a graph?
    • Answer: Using DFS: if, during traversal, we encounter a back-edge (an edge pointing to an already visited ancestor in the current DFS path), a cycle exists. For undirected graphs, ensure the back-edge isn’t just to the parent.
    • Example: In a network configuration, detecting a routing loop.
  25. What is a Bloom Filter? Where is it used?
    • Answer: A space-efficient probabilistic data structure used to test whether an element is a member of a set. It can yield false positives but not false negatives.
    • Example: Checking if a username is already taken (avoids database lookup for non-existent users), or caching systems.
  26. Explain the concept of “Divide and Conquer.”
    • Answer: A paradigm that involves three steps:
      1. Divide: Break the problem into smaller subproblems of the same type.
      2. Conquer: Solve these subproblems recursively.
      3. Combine: Combine the solutions to the subproblems to get the solution to the original problem.
    • Example: Merge Sort, Quick Sort.
  27. What is a Fenwick Tree (Binary Indexed Tree)?
    • Answer: A data structure that can efficiently update element values and calculate prefix sums in a table of numbers.
    • Example: Calculating range sums in a dynamic array where elements are frequently updated.
  28. What is the difference between a struct and a class in C++ (or similar languages)?
    • Answer: In C++, a struct defaults to public members and public inheritance, while a class defaults to private members and private inheritance. Functionally, they are very similar, with class usually preferred for OOP.
    • Example: A struct for simple data grouping (e.g., a Point {int x; int y;}), a class for complex objects with methods and encapsulation.
  29. What is Garbage Collection?
    • Answer: An automatic memory management process that identifies and reclaims memory that is no longer being used by a program.
    • Example: Java’s JVM and Python’s interpreter have garbage collectors.
  30. What is Pointer Arithmetic?
    • Answer: Performing mathematical operations (addition, subtraction) on pointers, which increments or decrements the pointer by the size of the data type it points to.
    • Example: int arr[5]; int* ptr = arr; ptr++; (ptr now points to arr[1]).

Section 2: Object-Oriented Design & Principles (Questions 31-45)

CSE heavily relies on designing robust and maintainable software using OOP principles.

  1. What are the four pillars of OOP?
    • Answer: Abstraction, Encapsulation, Inheritance, Polymorphism.
    • Example: A Vehicle class (abstraction), with private speed (encapsulation), a Car subclass (inheritance), and Vehicle.start() having different implementations for Car and Motorcycle (polymorphism).
  2. Explain the SOLID principles.
    • Answer: A set of five design principles that help develop maintainable and scalable object-oriented software:
      • Single Responsibility Principle
      • Open/Closed Principle
      • Liskov Substitution Principle
      • Interface Segregation Principle
      • Dependency Inversion Principle
    • Example: Single Responsibility: A class should only have one reason to change (e.g., a ReportGenerator should not also handle database persistence).
  3. Difference between an Abstract Class and an Interface?
    • Answer:
      • Abstract Class: Can have concrete and abstract methods, instance variables, and constructors; a class can extend only one.
      • Interface: Defines a contract with only abstract methods (pre-Java 8), no instance variables (only constants), no constructors; a class can implement multiple.
    • Example: An AbstractShape class with an abstract calculateArea() and concrete getColor() method; a Flyable interface with a fly() method.
  4. What is Composition over Inheritance? When would you use it?
    • Answer: A design principle favoring the use of object composition (where one class “has a” reference to another) over inheritance (“is a” relationship) for code reuse. It promotes flexibility and loose coupling.
    • Example: Instead of Car inheriting from Engine, Car has an Engine object as a member.
  5. What is an immutable object? Why are they useful?
    • Answer: An object whose state cannot be modified after it is created. They are useful for thread safety (no race conditions), easier caching, and predictable behavior.
    • Example: Java’s String class is immutable.
  6. What is a Design Pattern? Give an example.
    • Answer: A reusable solution to a commonly occurring problem within a given context in software design.
    • Example: Singleton Pattern (ensures a class has only one instance), Factory Pattern (creates objects without exposing the instantiation logic).
  7. Explain the Singleton Design Pattern.
    • Answer: A creational design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system.
    • Example: A logging utility or a configuration manager in an application.
  8. Explain the Factory Design Pattern.
    • Answer: A creational design pattern that defines an interface for creating objects, but lets subclasses alter the type of objects that will be created. It encapsulates object creation.
    • Example: A CarFactory that creates different types of Car objects (e.g., Sedan, SUV) based on input.
  9. What is Dependency Injection?
    • Answer: A design pattern that allows the creation of dependent objects outside of a class and then provides those objects to a class. It promotes loose coupling and testability.
    • Example: Instead of a Car class creating its own Engine object, the Engine object is passed into the Car constructor.
  10. What are access modifiers? Why are they important in OOP?
    • Answer: Keywords (public, private, protected, default) that specify the accessibility of classes, methods, and variables. They enforce encapsulation and control visibility, crucial for maintaining object integrity.
    • Example: A private member variable can only be accessed within its own class.
  11. What is Method Overloading vs. Overriding?
    • Answer: Overloading (compile-time polymorphism) means multiple methods in the same class have the same name but different parameters. Overriding (runtime polymorphism) means a subclass provides a specific implementation for a method that is already defined in its superclass (same name, same parameters).
  12. What is the super keyword (or equivalent in other languages)?
    • Answer: In many OOP languages, super refers to the parent or superclass object. It’s used to call the parent class’s constructor or methods that have been overridden in the child class.
    • Example: super(args) in a child class constructor to call the parent’s constructor.
  13. What is the difference between shallow copy and deep copy?
    • Answer: A shallow copy creates a new object but copies references to the original nested objects. A deep copy creates a new object and recursively copies all nested objects, so no objects are shared.
    • Example: Modifying a nested object in a shallow copy affects the original; in a deep copy, it does not.
  14. What is a constructor? Can a class have multiple constructors?
    • Answer: A special method used to initialize an object when it’s created. It has the same name as the class and no return type. Yes, a class can have multiple constructors (constructor overloading) with different parameters.
    • Example: public Person(String name) and public Person(String name, int age).
  15. What is coupling and cohesion in software design?
    • Answer:
      • Coupling: The degree of interdependence between software modules. Low coupling is desirable (modules are independent).
      • Cohesion: The degree to which the elements inside a module belong together. High cohesion is desirable (a module has a clear, single responsibility).
    • Example: A highly cohesive UserService class only handles user-related logic. A loosely coupled OrderService interacts with UserService through a well-defined interface.

Section 3: Operating Systems & System Programming (Questions 46-60)

Understanding how software interacts with the underlying OS and hardware is crucial for building efficient systems.

  1. What is an Operating System (OS)? What are its primary functions?
    • Answer: Software that manages computer hardware and software resources. Primary functions: process management, memory management, file system management, I/O management, security.
    • Example: Windows, Linux, macOS.
  2. Difference between a Process and a Thread?
    • Answer: A Process is an independent program execution with its own memory space. A Thread is a lightweight unit of execution within a process, sharing the process’s memory space.
    • Example: A web browser is a process; each tab or concurrent task within it could be a thread.
  3. What is a Deadlock? List the four conditions for a deadlock to occur.
    • Answer: A situation where two or more processes are blocked indefinitely, waiting for each other to release resources.
    • Conditions: Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait.
    • Example: Two programs needing exclusive access to two different resources, each holding one and waiting for the other.
  4. Explain Virtual Memory.
    • Answer: A memory management technique that gives an application program the impression that it has a contiguous, large block of memory, even if physical memory is fragmented or limited. It uses disk space as an extension of RAM.
    • Example: Running multiple large applications simultaneously that exceed the physical RAM available.
  5. What is Paging?
    • Answer: A memory management scheme that allows the OS to retrieve processes from secondary storage into main memory in the form of fixed-size blocks called “pages.” It enables virtual memory.
    • Example: When a program tries to access a page not currently in RAM, a “page fault” occurs, and the OS loads it from disk.
  6. Difference between a Semaphore and a Mutex?
    • Answer:
      • Mutex (Mutual Exclusion): A binary lock that provides exclusive access to a single resource. Only the thread that locked it can unlock it.
      • Semaphore: A signaling mechanism (can be binary or counting) used to control access to a pool of resources. A thread that acquires it doesn’t necessarily have to be the one to release it.
    • Example: Mutex for protecting a shared variable; Semaphore for limiting simultaneous access to a database connection pool.
  7. What is a System Call?
    • Answer: The programmatic interface to the services provided by the operating system. It allows user-level programs to request kernel-level operations.
    • Example: open(), read(), write(), fork(), exec().
  8. Explain Context Switching.
    • Answer: The process of storing the state (context) of a CPU for one process or thread so that another process or thread can be executed, and then restoring the previous process’s state when its turn comes again.
    • Example: When a time-slice for a running process expires, the OS saves its state and loads another process’s state.
  9. What is a Kernel?
    • Answer: The core of an operating system, responsible for managing system resources and providing services to other parts of the OS and applications.
    • Example: The Linux kernel (vmlinuz) manages processes, memory, and devices.
  10. Difference between User Mode and Kernel Mode?
    • Answer:
      • User Mode: Where application programs typically run. Restricted access to system resources.
      • Kernel Mode: Where the OS kernel runs. Unrestricted access to hardware and memory.
    • Example: When an application makes a system call, the CPU switches from user mode to kernel mode.
  11. What are I/O bound vs. CPU bound processes?
    • Answer:
      • I/O Bound: Spends most of its time waiting for input/output operations to complete (e.g., reading from disk, network communication).
      • CPU Bound: Spends most of its time performing computations (e.g., complex calculations, video rendering).
    • Example: A database query waiting for disk reads is I/O bound; a program calculating prime numbers is CPU bound.
  12. What is a process scheduler?
    • Answer: The part of the operating system that selects which process to execute next and allocates CPU time to it.
    • Example: Round Robin, First-Come, First-Served (FCFS), Shortest Job First (SJF) are common scheduling algorithms.
  13. Explain the concept of ‘fork’ and ‘exec’ system calls.
    • Answer:
      • fork(): Creates a new process (child process) that is a duplicate of the calling process (parent process).
      • exec(): Replaces the current process’s image with a new program specified by a path or filename. It doesn’t create a new process; it transforms the current one.
    • Example: A shell creating a new process for a command (fork) and then running the command (exec).
  14. What is a race condition? How can it be prevented?
    • Answer: A situation where the outcome of an operation depends on the unpredictable sequence or timing of other operations.
    • Prevention: Using synchronization mechanisms like mutexes, semaphores, critical sections, or atomic operations.
    • Example: Two threads incrementing a shared counter simultaneously without locking can lead to an incorrect final value.
  15. What is a pipe in inter-process communication (IPC)?
    • Answer: A unidirectional communication channel that can be used for IPC. Data written to one end of the pipe can be read from the other.
    • Example: ls | grep "foo" (the output of ls is piped as input to grep).
    • Section 4: Database Systems & Data Management (Questions 61-75)
    • CSE professionals frequently work with databases, from design to optimization.
  16. What are ACID properties in DBMS?
    • Answer: Properties that guarantee reliable processing of database transactions: Atomicity (all or nothing), Consistency (valid state), Isolation (concurrent transactions don’t interfere), Durability (committed changes persist).
    • Example: A bank transfer must adhere to ACID properties to prevent money loss.
  17. Difference between SQL and NoSQL databases?
    • Answer:
      • SQL (Relational): Strict schema, uses SQL, vertically scalable, ACID-compliant, good for complex joins and structured data.
      • NoSQL (Non-Relational): Flexible schema, horizontally scalable, BASE-compliant (Basically Available, Soft state, Eventually consistent), good for unstructured/semi-structured data and high scalability.
    • Example: SQL: PostgreSQL, MySQL; NoSQL: MongoDB (document), Cassandra (column-family).
  18. Explain Database Normalization (1NF, 2NF, 3NF).
    • Answer: A process of organizing a relational database to minimize data redundancy and improve data integrity, through a series of forms:
      • 1NF: Atomic values, no repeating groups.
      • 2NF: In 1NF, and all non-key attributes are fully functionally dependent on the primary key.
      • 3NF: In 2NF, and no transitive dependencies (non-key attributes depend only on the primary key, not other non-key attributes).
    • Example: Separating customer details from order details into distinct tables.
  19. What is a Primary Key and a Foreign Key?
    • Answer:
      • Primary Key: Uniquely identifies each record in a table (e.g., UserID).
      • Foreign Key: A column in one table that refers to the primary key in another table, establishing a link (e.g., UserID in an Orders table referencing UserID in a Users table).
  20. What is an Index in a database? Why is it used?
    • Answer: A data structure that improves the speed of data retrieval operations on a database table by allowing the database to quickly locate data, similar to a book index.
    • Example: Creating an index on a ProductName column to speed up searches.
  21. What is a Transaction? What are its states?
    • Answer: A single logical unit of work performed on a database. States: Active, Partially Committed, Failed, Aborted, Committed.
    • Example: An INSERT, UPDATE, or DELETE statement.
  22. What is a Join in SQL? (INNER, LEFT, RIGHT, FULL)
    • Answer: Used to combine rows from two or more tables based on a related column between them.
      • INNER: Returns matching rows from both.
      • LEFT (OUTER): All rows from left, matching from right.
      • RIGHT (OUTER): All rows from right, matching from left.
      • FULL (OUTER): All rows when there’s a match in either table.
    • Example: SELECT * FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;
  23. What is Denormalization? When is it used?
    • Answer: The process of intentionally introducing redundancy into a database by adding duplicate data or combining tables. Used to improve read performance for specific queries, often in data warehousing or reporting systems.
  24. What is a View in SQL?
    • Answer: A virtual table based on the result-set of an SQL query. It does not store data itself but provides a simplified or restricted representation of data from one or more underlying tables.
    • Example: A view showing only “active” users from a larger Users table.
  25. What is a Stored Procedure?
    • Answer: A pre-compiled collection of SQL statements and logic stored in the database. They can improve performance, enforce business rules, and enhance security.
    • Example: A stored procedure GetCustomerOrders(CustomerID) that returns all orders for a specific customer.
  26. What is the CAP Theorem?
    • Answer: A fundamental theorem in distributed computing stating that a distributed data store can only simultaneously guarantee two out of three: Consistency, Availability, and Partition tolerance.
    • Example: When a network partition occurs, a system must choose between being consistent (all nodes have same data) or available (every request gets a response).
  27. What is database sharding (or horizontal partitioning)?
    • Answer: A method of splitting a large database into smaller, more manageable parts called “shards” that are stored on different servers. This improves scalability and performance.
    • Example: Sharding a user database by UserID range, where users A-M are on one server and N-Z on another.
  28. What is an ORM (Object-Relational Mapping)?
    • Answer: A programming technique for converting data between incompatible type systems using object-oriented programming languages. It allows developers to interact with a database using objects instead of raw SQL.
    • Example: SQLAlchemy (Python), Hibernate (Java), Entity Framework (.NET).
  29. What is the difference between OLTP and OLAP?
    • Answer:
      • OLTP (Online Transaction Processing): Optimized for high-volume, short, frequent, read-write transactions (e.g., e-commerce, banking).
      • OLAP (Online Analytical Processing): Optimized for complex, analytical queries on large datasets (e.g., data warehousing, business intelligence).
  30. What is eventual consistency?
    • Answer: A consistency model in distributed computing that guarantees that if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value. Common in NoSQL databases.
    • Example: Social media feeds where a post might not immediately appear on all users’ timelines.
    • Section 5: Computer Networks (Questions 76-90)
    • Building distributed systems requires a deep understanding of network communication.
  31. What is the TCP/IP Model? List its layers.
    • Answer: A four-layer (sometimes five) conceptual model for network communication used in the Internet: Network Access (or Link), Internet, Transport, Application.
    • Example: The Internet Protocol (IP) operates at the Internet layer.
  32. Explain the difference between a Hub, Switch, and Router.
    • Answer:
      • Hub: Dumb repeater, broadcasts all traffic to all ports (Physical layer).
      • Switch: Intelligent, learns MAC addresses, forwards traffic only to intended recipient (Data Link layer).
      • Router: Connects different networks, forwards traffic based on IP addresses (Network layer).
    • Example: A home WiFi router combines router, switch, and wireless access point functionality.
  33. What is DNS Resolution?
    • Answer: The process of translating human-readable domain names (e.g., google.com) into numerical IP addresses that computers use to identify each other on a network.
    • Example: Your browser sending a query to a DNS server to get google.com‘s IP address.
  34. What is HTTP and HTTPS? What does the ‘S’ stand for?
    • Answer:
      • HTTP (Hypertext Transfer Protocol): Protocol for transferring web pages.
      • HTTPS (Hypertext Transfer Protocol Secure): Secure version of HTTP, using SSL/TLS encryption. The ‘S’ stands for Secure.
    • Example: Always use HTTPS for secure communication like online banking.
  35. How does a Firewall work?
    • Answer: A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules, filtering out malicious or unauthorized traffic.
    • Example: Blocking all traffic on a specific port from external IPs, except for trusted ones.
  36. What is a Load Balancer? Why is it important in system design?
    • Answer: A device or service that distributes network traffic across multiple servers to optimize resource utilization, maximize throughput, minimize response time, and avoid overload of any single server. It ensures high availability and scalability.
    • Example: Distributing incoming web requests across a cluster of identical web servers.
  37. What is a CDN (Content Delivery Network)?
    • Answer: A geographically distributed network of proxy servers and their data centers. The goal is to provide high availability and performance by distributing the service spatially relative to end-users.
    • Example: Using Cloudflare or Akamai to serve static assets (images, CSS, JS) from a server closer to the user.
  38. What is the difference between IPv4 and IPv6?
    • Answer:
      • IPv4: 32-bit addresses, limited address space (approx. 4.3 billion), uses dots for separation (e.g., 192.168.1.1).
      • IPv6: 128-bit addresses, vastly larger address space, uses colons for separation (e.g., 2001:0db8::1). Designed to replace IPv4.
  39. What is a VPN? How does it provide security?
    • Answer: A Virtual Private Network creates an encrypted “tunnel” over a public network, allowing secure remote access to a private network. It encrypts traffic and often hides the user’s real IP address.
    • Example: A corporate VPN allowing remote employees to securely access internal company resources.
  40. What is a Proxy Server?
    • Answer: An intermediary server that sits between client applications and other servers. It can filter requests, improve performance (caching), or provide anonymity.
    • Example: A corporate proxy blocking access to certain websites or caching frequently visited pages.
  41. What is REST (Representational State Transfer)?
    • Answer: An architectural style for networked hypermedia applications. APIs designed with REST (RESTful APIs) are stateless, use standard HTTP methods (GET, POST, PUT, DELETE), and resources are identified by URLs.
    • Example: A GET /users/{id} request to retrieve user data from a server.
  42. What is SOAP (Simple Object Access Protocol)?
    • Answer: A messaging protocol specification for exchanging structured information in the implementation of web services. It relies on XML for its message format.
    • Example: Used in enterprise-level applications where strict standards and built-in security features are required.
  43. What is a socket in networking?
    • Answer: An endpoint of a two-way communication link between two programs running on the network. It’s defined by an IP address and a port number.
    • Example: A web server listens on a socket (e.g., IP address + port 80) for incoming client connections.
  44. What is a subnet? Why is subnetting used?
    • Answer: A logical division of an IP network into smaller network segments. Subnetting is used to improve network performance (reduce broadcast traffic), enhance security, and manage IP address allocation more efficiently.
    • Example: Dividing a large corporate network into subnets for different departments.
  45. What is an API Gateway?
    • Answer: A server that acts as a single entry point for a cluster of microservices. It handles requests, routing, authentication, rate limiting, and more, before forwarding them to the appropriate backend service.
    • Example: All external requests to a microservices-based e-commerce application go through the API Gateway first.
    • Section 6: Software Engineering & System Design (Questions 91-100)
    • These questions focus on the practical methodologies and design considerations for building complex software systems.
  46. What is the Software Development Life Cycle (SDLC)?
    • Answer: A structured process that guides software development from conception to deployment and maintenance. Common models include Waterfall, Agile, Scrum, DevOps.
    • Example: Phases: Requirements Analysis -> Design -> Implementation -> Testing -> Deployment -> Maintenance.
  47. Difference between Monolithic and Microservices architecture?
    • Answer:
      • Monolithic: A single, tightly coupled application where all components run as one unit. Easier to develop initially, harder to scale selectively.
      • Microservices: An application built as a collection of small, independent services, each running in its own process. More complex to manage, but offers better scalability, fault isolation, and technology diversity.
    • Example: A traditional ERP system (monolithic) vs. Netflix’s service-oriented architecture (microservices).
  48. Explain Continuous Integration (CI) and Continuous Delivery/Deployment (CD).
    • Answer:
      • CI: Developers frequently merge code into a central repository, triggering automated builds and tests.
      • CD: Extends CI by automatically preparing code for release (Delivery) or automatically deploying it to production (Deployment) after all tests pass.
    • Example: Using Jenkins, GitLab CI, or GitHub Actions to automate the build, test, and deploy pipeline.
  49. What is version control (e.g., Git)? Why is it important?
    • Answer: A system that records changes to a file or set of files over time so that you can recall specific versions later. It’s crucial for collaboration, tracking changes, and reverting to previous states.
    • Example: Git allows multiple developers to work on the same codebase simultaneously without overwriting each other’s work.
  50. What is the concept of Idempotence in software design?
    • Answer: An operation is idempotent if applying it multiple times produces the same result as applying it once. Essential for reliable API design and fault-tolerant systems.
    • Example: A DELETE /resource/{id} request is idempotent; performing it multiple times still results in the resource being deleted.
  51. What are code reviews and why are they important?
    • Answer: A systematic examination (often peer review) of computer source code. They are important for finding bugs early, improving code quality, sharing knowledge, and ensuring adherence to coding standards.
    • Example: A developer submitting a Pull Request (PR) in Git for team members to review before merging.
  52. What is a caching strategy? Give an example.
    • Answer: A method for deciding what data to store in a cache, how long to keep it, and when to evict it. Common strategies: Least Recently Used (LRU), Least Frequently Used (LFU), First-In, First-Out (FIFO).
    • Example: LRU caching ensures that the most recently accessed items are kept in memory, quickly accessible.
  53. What is the difference between horizontal and vertical scaling?
    • Answer:
      • Horizontal Scaling (Scale Out): Adding more machines/nodes to your existing system (e.g., adding more web servers).
      • Vertical Scaling (Scale Up): Adding more resources (CPU, RAM) to an existing single machine.
      • Example: Horizontal scaling is preferred for distributed systems and cloud environments due to its flexibility and fault tolerance.
  54. What is System Design? What are its key considerations?
    • Answer: The process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. Key considerations include scalability, reliability, availability, performance, security, and maintainability.
      • Example: Designing a global ride-sharing service, considering user concurrency, real-time updates, and data consistency across regions.
  55. What is the importance of observability in distributed systems?
    • * Answer: The ability to infer the internal state of a system by examining its external outputs (logs, metrics, traces). It’s crucial for debugging, performance monitoring, and understanding complex microservices architectures.
      • * Example: Using tools like Prometheus for metrics, Grafana for dashboards, and Jaeger for distributed tracing to monitor a cloud application.

Leave a Reply

Your email address will not be published. Required fields are marked *