Basic Computer Science interview questions

150 questions with answers (CSE-001 to CSE-150). Try each one aloud before reading the answer.

Data Structures

CSE-001 · What is the difference between an array and a linked list?

An array stores elements contiguously, giving O(1) random access but O(n) insertion or deletion in the middle. A linked list stores nodes connected by pointers, giving O(1) insert/delete at a known node but O(n) access by index.

CSE-002 · What is a stack?

A linear LIFO (last in, first out) structure with push, pop and peek, each O(1). It is used for function calls, undo operations, expression evaluation and backtracking.

CSE-003 · What is a queue?

A linear FIFO (first in, first out) structure where elements are enqueued at the rear and dequeued at the front in O(1). It is used in scheduling, buffering and breadth-first search.

CSE-004 · What is a deque?

A double-ended queue that allows insertion and removal at both the front and the rear in O(1). It can act as both a stack and a queue and is used in sliding-window algorithms.

CSE-005 · What is a hash table?

A structure that maps keys to values by applying a hash function to compute a bucket index. Average insert, delete and lookup are O(1); collisions are handled by chaining or open addressing.

CSE-006 · What is a binary tree?

A hierarchical structure in which each node has at most two children, called left and right. The topmost node is the root and nodes without children are leaves.

CSE-007 · What is a binary search tree (BST)?

A binary tree where every node's left subtree holds smaller keys and its right subtree holds larger keys. Search, insert and delete take O(h), which is O(log n) when balanced and O(n) when skewed.

CSE-008 · What is a heap?

A complete binary tree satisfying the heap property: in a min-heap each parent is ≤ its children, in a max-heap ≥. It is usually stored in an array and implements priority queues with O(log n) insert and extract.

CSE-009 · What is a graph and how can it be represented?

A set of vertices connected by edges, which may be directed or undirected and weighted or unweighted. It is stored as an adjacency matrix (O(V²) space) or an adjacency list (O(V + E) space).

CSE-010 · What is a trie?

A prefix tree where each edge represents a character and paths from the root spell keys. Lookup and insert take O(L) for a key of length L, making it ideal for autocomplete and prefix search.

CSE-011 · What is a circular queue?

A queue implemented on a fixed array where the rear wraps around to the start using modulo arithmetic, rear = (rear + 1) % capacity. It reuses slots freed by dequeues, avoiding wasted space.

CSE-012 · What is the difference between a singly and a doubly linked list?

A singly linked list node has only a next pointer, so traversal is one-way. A doubly linked list node also has a prev pointer, allowing backward traversal and O(1) deletion of a given node at the cost of extra memory.

CSE-013 · What is a priority queue?

An abstract data type where each element has a priority and the highest (or lowest) priority element is removed first. It is commonly implemented with a binary heap.

Algorithms & Complexity

CSE-014 · What is Big-O notation?

An asymptotic upper bound on how an algorithm's time or space grows with input size n, ignoring constants and lower-order terms. For example, 3n² + 5n + 2 is O(n²).

CSE-015 · What is the difference between Big-O, Big-Ω and Big-Θ?

Big-O is an asymptotic upper bound, Big-Ω a lower bound, and Big-Θ a tight bound where both hold. Merge sort, for instance, is Θ(n log n).

CSE-016 · What is linear search?

It scans each element in sequence until the target is found or the list ends. It takes O(n) time, O(1) space and works on unsorted data.

CSE-017 · What is binary search?

It finds a target in a sorted array by repeatedly comparing with the middle element and halving the search range. It runs in O(log n) time.

lo, hi = 0, len(a) - 1
while lo <= hi:
    mid = (lo + hi) // 2
    if a[mid] == x: return mid
    if a[mid] < x: lo = mid + 1
    else: hi = mid - 1

CSE-018 · What is recursion?

A technique in which a function calls itself on a smaller subproblem until reaching a base case. Each call uses a stack frame, so deep recursion can cause stack overflow.

CSE-019 · What is a stable sorting algorithm?

One that keeps elements with equal keys in their original relative order. Merge sort and insertion sort are stable; quicksort and heap sort generally are not.

CSE-020 · What is bubble sort and what is its complexity?

It repeatedly swaps adjacent out-of-order elements so that the largest bubbles to the end each pass. Worst and average time are O(n²); with an early-exit flag the best case on sorted input is O(n).

CSE-021 · What is merge sort?

A divide-and-conquer sort that splits the array in half, sorts each half recursively and merges them. It runs in O(n log n) in all cases, is stable and needs O(n) extra space for arrays.

CSE-022 · What is the divide-and-conquer paradigm?

Solving a problem by dividing it into independent subproblems, solving them recursively and combining the results. Examples include merge sort, quicksort and binary search.

CSE-023 · What is a greedy algorithm?

An algorithm that makes the locally optimal choice at each step, hoping to reach a global optimum. It works when the problem has the greedy-choice property, as in Dijkstra's, Kruskal's and Huffman coding.

CSE-024 · What is dynamic programming?

A method for problems with overlapping subproblems and optimal substructure that stores subproblem results to avoid recomputation. It is applied top-down with memoization or bottom-up with tabulation.

CSE-025 · What is the difference between BFS and DFS?

BFS explores a graph level by level using a queue and finds shortest paths in unweighted graphs. DFS goes as deep as possible using a stack or recursion and suits cycle detection and topological sort. Both run in O(V + E).

CSE-026 · What is space complexity?

The amount of memory an algorithm needs as a function of input size, including auxiliary space and recursion stack. For example, recursive binary search uses O(log n) stack space and iterative uses O(1).

OOP & Design Patterns

CSE-027 · What are the four pillars of OOP?

Encapsulation (bundling data with methods and hiding state), abstraction (exposing only essential behaviour), inheritance (deriving classes from existing ones) and polymorphism (one interface, many implementations).

CSE-028 · What is the difference between a class and an object?

A class is a blueprint that defines attributes and methods. An object is a concrete instance of that class, occupying memory with its own state.

CSE-029 · What is encapsulation?

Bundling data and the methods that operate on it into one unit and restricting direct access to the internal state, usually via private fields and public getters/setters. It protects invariants and reduces coupling.

CSE-030 · What is a constructor?

A special method called automatically when an object is created to initialize its state. It has the class's name in C++ and Java (__init__ in Python) and has no return type.

CSE-031 · What is method overloading?

Defining multiple methods with the same name in one class but different parameter lists. The compiler selects the right one at compile time, so it is static polymorphism.

CSE-032 · What is method overriding?

A subclass providing its own implementation of a method already defined in its superclass with the same signature. The call is resolved at run time based on the object's actual type, so it is dynamic polymorphism.

CSE-033 · What is an abstract class?

A class that cannot be instantiated and may contain abstract methods without bodies alongside concrete methods and state. Subclasses must implement the abstract methods.

CSE-034 · What is an interface?

A contract listing method signatures that implementing classes must provide. In Java a class can implement many interfaces, which gives multiple inheritance of type without inheriting state.

CSE-035 · What is the difference between composition and inheritance?

Inheritance models an "is-a" relationship by extending a class. Composition models "has-a" by holding references to other objects. Composition is generally preferred because it is more flexible and less tightly coupled.

CSE-036 · What is a design pattern?

A reusable, named solution to a commonly occurring design problem. The Gang of Four grouped 23 patterns into creational, structural and behavioural categories.

CSE-037 · What is the Singleton pattern?

A creational pattern ensuring a class has exactly one instance with a global access point, for example a configuration manager. It needs care for thread safety and can hinder testing.

CSE-038 · What is the Factory pattern?

A creational pattern that delegates object creation to a factory method or class, so client code depends on an interface rather than concrete classes. It simplifies adding new product types.

CSE-039 · What is the Observer pattern?

A behavioural pattern where a subject keeps a list of observers and notifies them automatically when its state changes. It underlies event listeners and publish-subscribe systems.

Programming Languages (C/C++/Java/Python)

CSE-040 · What is the difference between stack and heap memory?

The stack holds local variables and call frames; allocation is automatic, LIFO, fast and limited in size. The heap holds dynamically allocated data; it is larger, managed manually (malloc/free, new/delete) or by a garbage collector, and can fragment.

CSE-041 · What is a pointer in C?

A variable that stores the memory address of another variable. &x gives the address of x and *p dereferences p to access the value it points to.

CSE-042 · What is the difference between compiled and interpreted languages?

A compiled language is translated ahead of time into machine code (C, C++). An interpreted language is executed by an interpreter at run time (CPython executes bytecode). Java compiles to bytecode that the JVM interprets and JIT-compiles.

CSE-043 · What is the difference between malloc and calloc?

malloc(n) allocates n bytes with uninitialized contents. calloc(count, size) allocates count × size bytes and zero-initializes them. Both return NULL on failure and are released with free.

CSE-044 · What is a reference in C++?

An alias for an existing variable, declared with &. Unlike a pointer it must be initialized, cannot be null in well-formed code and cannot be reseated to refer to another object.

CSE-045 · What is the difference between JDK, JRE and JVM?

The JVM executes Java bytecode. The JRE is the JVM plus core libraries needed to run programs. The JDK is the JRE plus development tools such as the javac compiler and debugger.

CSE-046 · What is garbage collection?

Automatic reclamation of heap memory occupied by objects that are no longer reachable from program roots. It is used in Java, Python and C#, eliminating manual frees but adding pause and CPU overhead.

CSE-047 · What is the difference between a list and a tuple in Python?

A list is mutable and written with brackets [1, 2]. A tuple is immutable and written with parentheses (1, 2), so it is hashable when its elements are and can serve as a dictionary key.

CSE-048 · What does the static keyword mean in Java?

A static member belongs to the class rather than any instance, so it is shared across all objects and accessible without creating one. Static methods cannot access instance fields directly.

CSE-049 · What is a virtual function in C++?

A member function declared virtual in a base class so that calls through a base pointer or reference dispatch to the derived class's override at run time, via a vtable.

CSE-050 · What is the difference between == and .equals() in Java?

== compares references for objects (whether both point to the same object) and values for primitives. .equals() compares logical content when the class overrides it, as String does.

CSE-051 · What is a lambda or anonymous function?

A function defined without a name, usually inline and short, often passed as an argument. Python: lambda x: x * 2; Java: x -> x * 2; C++: [](int x){ return x * 2; }.

CSE-052 · What is a header file in C/C++?

A file (typically .h) containing declarations of functions, types and macros shared across source files. It is pulled in with #include and protected against double inclusion by include guards or #pragma once.

Operating Systems

CSE-053 · What is the difference between a process and a thread?

A process is an executing program with its own address space and resources. Threads are units of execution within a process that share its memory and files, making them lighter to create and switch but requiring synchronization.

CSE-054 · What is an operating system?

System software that manages hardware resources and provides services to programs, including process scheduling, memory management, file systems, device I/O and security.

CSE-055 · What is the kernel?

The core of the OS that runs in privileged mode and directly manages the CPU, memory, devices and system calls. User programs access it through system calls.

CSE-056 · What is a context switch?

Saving the state (registers, program counter, stack pointer) of the running process or thread and loading another's so the CPU can switch between them. It is pure overhead and can disturb caches and TLBs.

CSE-057 · What is a system call?

A controlled entry point through which a user program requests a kernel service, such as read, write, fork or open. It triggers a switch from user mode to kernel mode.

CSE-058 · What is a deadlock?

A state where a set of processes wait forever because each holds a resource another needs. For example, P1 holds lock A and waits for B while P2 holds B and waits for A.

CSE-059 · What is a semaphore?

A synchronization variable with atomic wait (P) and signal (V) operations. A counting semaphore limits concurrent access to N resources; a binary semaphore allows one.

CSE-060 · What is a mutex?

A mutual-exclusion lock that allows only one thread at a time into a critical section. Unlike a semaphore, it has ownership: only the thread that locked it should unlock it.

CSE-061 · What is paging?

A memory-management scheme that divides virtual memory into fixed-size pages and physical memory into equal-size frames. A page table maps pages to frames, eliminating external fragmentation.

CSE-062 · What is a page fault?

An exception raised when a process accesses a page not currently in physical memory. The OS loads the page from disk, updates the page table and resumes the instruction.

CSE-063 · What are the common CPU scheduling algorithms?

First-Come First-Served, Shortest Job First, Shortest Remaining Time First, Priority scheduling, Round Robin with a time quantum, and multilevel feedback queues.

CSE-064 · What is the difference between user mode and kernel mode?

In user mode, code has restricted access and cannot execute privileged instructions or touch hardware directly. In kernel mode, the OS has full access. Transitions occur via system calls, interrupts and exceptions.

CSE-065 · What is a zombie process?

A child process that has terminated but whose exit status has not yet been collected by its parent via wait(). It keeps a process-table entry until reaped.

DBMS & SQL

CSE-066 · What is a DBMS?

Software that stores, retrieves and manages data, providing a query language, concurrency control, recovery, integrity constraints and security. Examples are MySQL, PostgreSQL and Oracle.

CSE-067 · What is a primary key?

A column or set of columns that uniquely identifies each row in a table. It must be unique and non-null, and a table has only one.

CSE-068 · What is a foreign key?

A column that references the primary key of another (or the same) table, enforcing referential integrity so a row cannot point to a non-existent parent.

CSE-069 · What is the difference between DELETE, TRUNCATE and DROP?

DELETE removes selected rows, can use WHERE and fires triggers. TRUNCATE removes all rows quickly while keeping the table structure. DROP removes the table itself with its data and definition.

CSE-070 · What is the difference between WHERE and HAVING?

WHERE filters rows before grouping and cannot use aggregate functions. HAVING filters groups after GROUP BY and can use aggregates such as COUNT(*) > 5.

CSE-071 · What are the main types of SQL joins?

INNER JOIN returns matching rows from both tables. LEFT and RIGHT OUTER JOIN also keep unmatched rows from one side with NULLs. FULL OUTER JOIN keeps unmatched rows from both. CROSS JOIN returns the Cartesian product.

CSE-072 · What is an index in a database?

An auxiliary structure, usually a B+ tree or hash, that speeds up lookups on one or more columns. It accelerates reads but costs storage and slows inserts, updates and deletes.

CSE-073 · What is a view?

A virtual table defined by a stored SELECT query. It simplifies complex queries and restricts access to columns or rows, and normally does not store data unless materialized.

CSE-074 · What is the difference between SQL and NoSQL databases?

SQL databases are relational, use fixed schemas and joins, and emphasize ACID transactions. NoSQL databases (key-value, document, column-family, graph) use flexible schemas and typically scale horizontally, often with relaxed consistency.

CSE-075 · What is a transaction?

A sequence of database operations executed as a single logical unit that either commits entirely or rolls back entirely, preserving consistency.

CSE-076 · What is the difference between a candidate key and a super key?

A super key is any set of columns that uniquely identifies rows. A candidate key is a minimal super key with no removable column. The primary key is the chosen candidate key.

CSE-077 · What are aggregate functions in SQL?

Functions that compute a single value from a set of rows: COUNT, SUM, AVG, MIN and MAX. They are typically combined with GROUP BY.

CSE-078 · What is an ER diagram?

An entity-relationship diagram models data as entities (rectangles), their attributes (ovals) and relationships (diamonds) with cardinalities such as 1:1, 1:N and M:N. It is used in conceptual database design.

Computer Networks

CSE-079 · What is the difference between TCP and UDP?

TCP is connection-oriented, reliable and ordered, with flow and congestion control; it suits web, email and file transfer. UDP is connectionless with no delivery or ordering guarantees but low overhead; it suits video streaming, DNS, VoIP and gaming.

CSE-080 · What are the seven layers of the OSI model?

Physical, Data Link, Network, Transport, Session, Presentation and Application, from bottom to top. The TCP/IP model collapses these into four or five layers.

CSE-081 · What is an IP address?

A logical address identifying a host interface on a network. IPv4 uses 32 bits written as four dotted decimals (192.168.1.10); IPv6 uses 128 bits written in hexadecimal groups.

CSE-082 · What is a MAC address?

A 48-bit hardware address assigned to a network interface, written as six hex pairs. It is used for delivery within a local network at the data link layer.

CSE-083 · What is DNS?

The Domain Name System translates human-readable names such as example.com into IP addresses through a hierarchy of root, TLD and authoritative servers, with caching at resolvers. It mainly uses UDP port 53.

CSE-084 · What is the difference between a hub, a switch and a router?

A hub repeats signals to all ports (layer 1). A switch forwards frames to the correct port using MAC addresses (layer 2). A router forwards packets between networks using IP addresses (layer 3).

CSE-085 · What is HTTP?

The Hypertext Transfer Protocol is a stateless, request-response application protocol for the web. Clients send methods like GET and POST; servers reply with status codes like 200 or 404. It runs on port 80; HTTPS on 443.

CSE-086 · What is a port number?

A 16-bit number (0–65535) identifying a specific process or service on a host. Well-known ports include 22 (SSH), 25 (SMTP), 53 (DNS), 80 (HTTP) and 443 (HTTPS).

CSE-087 · What is DHCP?

The Dynamic Host Configuration Protocol automatically assigns IP addresses, subnet masks, gateways and DNS servers to hosts, via the Discover, Offer, Request, Acknowledge exchange.

CSE-088 · What is a subnet mask?

A 32-bit mask that separates the network and host portions of an IPv4 address. 255.255.255.0, or /24, leaves 8 host bits for 254 usable hosts.

CSE-089 · What is the difference between LAN, MAN and WAN?

A LAN covers a small area such as a building, a MAN spans a city, and a WAN spans countries or continents, the Internet being the largest WAN.

CSE-090 · What is ARP?

The Address Resolution Protocol maps a known IPv4 address to a MAC address on the local network by broadcasting a request and caching the reply.

System Design

CSE-091 · What is scalability?

A system's ability to handle growing load by adding resources. Vertical scaling adds power to one machine; horizontal scaling adds more machines.

CSE-092 · What is a load balancer?

A component that distributes incoming requests across multiple servers to improve throughput and availability. Common algorithms include round robin, least connections and IP hash.

CSE-093 · What is caching?

Storing frequently accessed data in fast storage, such as memory, to reduce latency and backend load. Examples are browser caches, CDNs, Redis and Memcached.

CSE-094 · What is a CDN?

A Content Delivery Network is a geographically distributed set of edge servers that cache static content near users, reducing latency and origin load.

CSE-095 · What is the difference between monolithic and microservices architecture?

A monolith is one deployable unit containing all functionality. Microservices split the application into small, independently deployable services communicating over APIs, improving scaling and team autonomy at the cost of operational complexity.

CSE-096 · What is an API?

An Application Programming Interface is a defined contract through which software components communicate, specifying requests, responses and data formats. Web APIs are commonly REST, GraphQL or gRPC.

CSE-097 · What is REST?

Representational State Transfer is an architectural style that models resources identified by URLs and manipulated with HTTP methods (GET, POST, PUT, DELETE), with stateless requests and cacheable responses.

CSE-098 · What is latency versus throughput?

Latency is the time to complete one operation, such as 50 ms per request. Throughput is the number of operations completed per unit time, such as 10,000 requests per second.

CSE-099 · What is a message queue?

Middleware that stores messages from producers until consumers process them, decoupling services and smoothing load spikes. Examples are RabbitMQ, Apache Kafka and Amazon SQS.

CSE-100 · What is database replication?

Copying data from a primary database to one or more replicas to improve read scalability, availability and disaster recovery. It can be synchronous or asynchronous.

CSE-101 · What is database sharding?

Horizontally partitioning data across multiple database servers by a shard key, such as user ID, so that each shard holds a subset. It scales writes and storage but complicates joins and rebalancing.

CSE-102 · What is high availability?

Designing a system to remain operational with minimal downtime, using redundancy, failover and health checks. It is often expressed in "nines", where 99.9% allows about 8.76 hours of downtime per year.

Software Engineering & Testing

CSE-103 · What is the SDLC?

The Software Development Life Cycle is the structured process of requirements, design, implementation, testing, deployment and maintenance. Models include Waterfall, V-model, Spiral and Agile.

CSE-104 · What is the Waterfall model?

A linear, sequential SDLC model where each phase finishes before the next begins. It suits stable requirements but handles change poorly because testing happens late.

CSE-105 · What is Agile?

An iterative, incremental approach that delivers working software in short cycles, values collaboration and adapts to changing requirements. Scrum and Kanban are popular frameworks.

CSE-106 · What is Scrum?

An Agile framework using fixed-length sprints, typically 1–4 weeks, with roles Product Owner, Scrum Master and Developers, and events such as sprint planning, daily scrum, review and retrospective.

CSE-107 · What is unit testing?

Testing the smallest testable pieces of code, such as functions or classes, in isolation, often with mocks for dependencies. Frameworks include JUnit, pytest and Google Test.

CSE-108 · What is integration testing?

Testing that combined modules or services work together correctly, focusing on interfaces, data flow and interactions with databases or APIs.

CSE-109 · What is the difference between black-box and white-box testing?

Black-box testing checks behaviour against requirements without knowledge of internal code. White-box testing designs tests from the code's structure, such as paths and branches.

CSE-110 · What is regression testing?

Re-running existing tests after code changes to confirm that previously working functionality still works. It is usually automated in CI pipelines.

CSE-111 · What is version control?

A system that records changes to files over time so you can review history, revert, branch and collaborate. Git is a distributed version control system; SVN is centralized.

CSE-112 · What is continuous integration (CI)?

The practice of merging code into a shared branch frequently, with each merge triggering automated builds and tests to catch integration problems early.

CSE-113 · What is the difference between verification and validation?

Verification asks "are we building the product right?", checking it against specifications through reviews and tests. Validation asks "are we building the right product?", checking it meets user needs.

CSE-114 · What is a code review?

Systematic examination of code by peers before merging to find defects, enforce standards and share knowledge. It is usually done through pull requests.

Computer Security

CSE-115 · What is the CIA triad?

Confidentiality (only authorized access), integrity (data is not altered improperly) and availability (systems are accessible when needed), the three core goals of information security.

CSE-116 · What is the difference between authentication and authorization?

Authentication verifies who you are, for example with a password or certificate. Authorization determines what an authenticated identity is allowed to do.

CSE-117 · What is the difference between symmetric and asymmetric encryption?

Symmetric encryption uses one shared key for encryption and decryption and is fast (AES). Asymmetric encryption uses a public/private key pair (RSA, ECC) and is slower but solves key distribution and enables digital signatures.

CSE-118 · What is hashing in security?

A one-way function that maps input to a fixed-size digest, such as SHA-256, where reversing it or finding collisions is computationally infeasible. It is used for integrity checks and, with salt and slow algorithms, password storage.

CSE-119 · What is a firewall?

A network device or software that filters traffic based on rules such as IP, port and protocol, allowing or blocking connections between trusted and untrusted networks.

CSE-120 · What is SQL injection?

An attack where malicious SQL is inserted into input that the application concatenates into a query, letting the attacker read or modify data. It is prevented with parameterized queries.

CSE-121 · What is cross-site scripting (XSS)?

An attack injecting malicious scripts into web pages viewed by other users, letting the attacker steal cookies or act as the victim. It is prevented by output encoding, input validation and a Content Security Policy.

CSE-122 · What is phishing?

A social-engineering attack that tricks users through fake emails, messages or websites into revealing credentials or installing malware.

CSE-123 · What is multi-factor authentication (MFA)?

Authentication requiring two or more independent factors: something you know (password), something you have (phone, token) and something you are (biometric).

CSE-124 · What is malware?

Malicious software designed to harm or gain unauthorized access, including viruses, worms, trojans, ransomware, spyware and rootkits.

CSE-125 · What is a DoS attack?

A denial-of-service attack overwhelms a system with traffic or requests so legitimate users cannot reach it. A DDoS attack uses many distributed sources, often a botnet.

CSE-126 · What is HTTPS?

HTTP over TLS. It encrypts traffic between client and server, authenticates the server via a certificate and protects integrity, on default port 443.

Computer Architecture

CSE-127 · What is the von Neumann architecture?

A design where a CPU, a single memory holding both instructions and data, and I/O are connected by shared buses, executing instructions sequentially via the fetch-decode-execute cycle.

CSE-128 · What is the difference between von Neumann and Harvard architecture?

Von Neumann uses a single memory and bus for instructions and data, causing a bottleneck. Harvard uses separate memories and buses so instruction fetch and data access can happen simultaneously.

CSE-129 · What is the difference between RISC and CISC?

RISC uses a small set of simple, fixed-length instructions that usually execute in one cycle, with load/store memory access (ARM, RISC-V). CISC uses many complex, variable-length instructions that can access memory directly (x86).

CSE-130 · What is cache memory?

Small, fast SRAM between the CPU and main memory that holds recently or frequently used data. It exploits temporal and spatial locality and is organized in levels L1, L2 and L3.

CSE-131 · What is the memory hierarchy?

The arrangement of storage from fastest, smallest and most expensive to slowest, largest and cheapest: registers, L1/L2/L3 cache, main memory (DRAM), SSD and HDD.

CSE-132 · What is a register?

A very small, very fast storage location inside the CPU holding operands, addresses or status, such as the program counter, stack pointer and general-purpose registers.

CSE-133 · What is the instruction cycle?

The repeated sequence fetch (read the instruction at the PC), decode (interpret opcode and operands), execute (perform the operation) and write-back (store the result).

CSE-134 · What is pipelining?

Overlapping execution stages of multiple instructions, such as fetch, decode, execute, memory and write-back, so a new instruction can start each cycle, increasing throughput without reducing single-instruction latency.

CSE-135 · What is the ALU?

The Arithmetic Logic Unit is the CPU component that performs integer arithmetic (add, subtract) and logical operations (AND, OR, XOR, shifts) and sets status flags.

CSE-136 · What is an interrupt?

A signal from hardware or software that makes the CPU suspend the current program, save state and run an interrupt service routine, then resume. It avoids wasteful polling.

CSE-137 · What is DMA?

Direct Memory Access lets I/O devices transfer data to and from memory without the CPU moving each byte. The CPU sets up the transfer and is interrupted when it completes.

CSE-138 · What is the difference between 32-bit and 64-bit processors?

The word size and typical address width. A 32-bit processor can address 2³² bytes (4 GiB) of virtual memory directly; a 64-bit processor has 64-bit registers and a far larger address space.

Cloud & Distributed Systems

CSE-139 · What is cloud computing?

On-demand delivery of computing resources such as servers, storage and databases over the Internet with pay-as-you-go pricing, rapid elasticity and no upfront hardware.

CSE-140 · What are IaaS, PaaS and SaaS?

IaaS provides virtual machines, storage and networks (AWS EC2). PaaS provides a managed platform to deploy code (Heroku, Google App Engine). SaaS delivers complete applications (Gmail, Salesforce).

CSE-141 · What is the difference between public, private and hybrid cloud?

A public cloud is shared infrastructure owned by a provider. A private cloud is dedicated to one organization. A hybrid cloud combines both, with workloads moving between them.

CSE-142 · What is virtualization?

Running multiple isolated virtual machines on one physical host, each with its own OS, managed by a hypervisor that shares the CPU, memory and I/O.

CSE-143 · What is a hypervisor?

Software that creates and runs virtual machines. Type 1 (bare-metal) runs directly on hardware, such as ESXi or KVM. Type 2 (hosted) runs on a host OS, such as VirtualBox.

CSE-144 · What is a container?

A lightweight, isolated user-space environment that packages an application with its dependencies and shares the host OS kernel, using namespaces and cgroups on Linux. Docker is the best-known tool.

CSE-145 · What is the difference between a container and a virtual machine?

A VM virtualizes hardware and runs a full guest OS, giving strong isolation but more overhead. A container shares the host kernel, so it starts in seconds or less and uses fewer resources, with weaker isolation.

CSE-146 · What is Kubernetes?

An open-source container orchestration platform that automates deployment, scaling, self-healing, service discovery and rolling updates of containerized applications across a cluster.

CSE-147 · What is a distributed system?

A collection of independent computers that communicate over a network and appear to users as one coherent system. Examples include distributed databases, DNS and cloud storage.

CSE-148 · What is auto-scaling?

Automatically adding or removing compute instances based on metrics such as CPU utilization or request rate, matching capacity to demand and controlling cost.

CSE-149 · What is serverless computing?

A model where the cloud provider runs code in response to events and manages servers, scaling and patching, billing only for execution time. AWS Lambda and Azure Functions are examples.

CSE-150 · What is object storage?

Storage that manages data as objects with a unique key, data and metadata in a flat namespace, accessed over HTTP APIs. It is highly scalable and durable, as in Amazon S3.

Other levels: Intermediate · Advanced · Tricky · All Computer Science questions