💻 Computer Science MCQ Quiz
100 Questions | Exam Preparation | Multiple Categories
📚 Data Structures & Algorithms
Q1. You have dolls nested one inside another and want to see all by opening their
boxes. Which concept does this represent?
A) Iteration
B) Recursion
C) Polymorphism
D) Abstraction
✅ Answer: B) Recursion
Explanation: Recursion involves a function calling itself, similar to opening nested boxes — each box reveals
another until you reach the last one.
Q2. Which data structure uses LIFO (Last In, First Out) order?
A) Queue
B) Array
C) Stack
D) Linked List
✅ Answer: C) Stack
Explanation: A stack follows LIFO — the last element pushed is the first to be popped.
Q3. Which data structure is best suited for implementing a printer queue?
A) Stack
B) Queue
C) Tree
D) Graph
✅ Answer: B) Queue
Explanation: Queues use FIFO (First In, First Out), which matches how print jobs are processed in order.
Q4. What is the time complexity of binary search on a sorted array?
A) O(n)
B) O(n²)
C) O(log n)
D) O(1)
✅ Answer: C) O(log n)
Explanation: Binary search halves the search space each time, resulting in O(log n) time complexity.
Q5. Which sorting algorithm has the best average-case time complexity?
A) Bubble Sort
B) Selection Sort
C) Insertion Sort
D) Quick Sort
✅ Answer: D) Quick Sort
Explanation: Quick Sort has an average time complexity of O(n log n), making it one of the fastest sorting
algorithms in practice.
Q6. In a linked list, what does each node contain?
A) Only data
B) Data and pointer to next node
C) Only a pointer
D) Index and data
✅ Answer: B) Data and pointer to next node
Explanation: Each node in a singly linked list stores data and a reference (pointer) to the next node.
Q7. Which traversal visits nodes in Left → Root → Right order?
A) Pre-order
B) Post-order
C) In-order
D) Level-order
✅ Answer: C) In-order
Explanation: In-order traversal visits Left, Root, Right. For a BST, this produces sorted output.
📚 Databases
Q8. Which key enforces referential integrity in a relational database?
A) Primary Key
B) Unique Key
C) Foreign Key
D) Composite Key
✅ Answer: C) Foreign Key
Explanation: A Foreign Key references the Primary Key of another table, enforcing referential integrity between
tables.
Q9. Which database operation permanently saves changes to the database?
A) ROLLBACK
B) SAVEPOINT
C) BEGIN
D) COMMIT
✅ Answer: D) COMMIT
Explanation: COMMIT permanently saves all changes made in the current transaction to the database.
Q10. Why is database indexing used?
A) To compress data
B) To speed up data retrieval
C) To encrypt records
D) To normalize tables
✅ Answer: B) To speed up data retrieval
Explanation: Indexing creates a data structure that allows the database engine to find rows faster without
scanning the entire table.
Q11. How can you implement a one-to-many relationship in a relational database?
A) Using a Primary Key only
B) Using a Foreign Key in the 'many' table referencing the 'one' table
C) Using a junction table
D) Using composite keys on both tables
✅ Answer: B) Using a Foreign Key in the 'many' table referencing the 'one' table
Explanation: A one-to-many relationship is implemented by placing a Foreign Key in the child ('many') table that
points to the parent ('one') table.
Q12. What does SQL stand for?
A) Standard Query Language
B) Structured Query Language
C) Simple Query Logic
D) Sequential Query Layer
✅ Answer: B) Structured Query Language
Explanation: SQL stands for Structured Query Language, used to manage and manipulate relational databases.
Q13. Which SQL clause is used to filter groups in a query?
A) WHERE
B) HAVING
C) GROUP BY
D) ORDER BY
✅ Answer: B) HAVING
Explanation: HAVING filters groups after GROUP BY is applied, whereas WHERE filters individual rows before
grouping.
Q14. What is normalization in databases?
A) Encrypting the database
B) Organizing data to reduce redundancy
C) Creating indexes
D) Backing up the database
✅ Answer: B) Organizing data to reduce redundancy
Explanation: Normalization is the process of structuring a database to minimize redundancy and dependency by
organizing tables and columns.
Q15. In a transaction, what does ROLLBACK do?
A) Saves changes permanently
B) Creates a backup
C) Undoes changes made in the current transaction
D) Drops the table
✅ Answer: C) Undoes changes made in the current transaction
Explanation: ROLLBACK reverses all changes made during the current transaction, restoring the database to its
previous state.
Q16. Which of the following is a NoSQL database?
A) MySQL
B) PostgreSQL
C) MongoDB
D) Oracle
✅ Answer: C) MongoDB
Explanation: MongoDB is a popular NoSQL document-oriented database that stores data in JSON-like
documents.
Q17. In database transactions, what does the 'I' in ACID stand for?
A) Integration
B) Isolation
C) Indexing
D) Integrity
✅ Answer: B) Isolation
Explanation: ACID stands for Atomicity, Consistency, Isolation, Durability. Isolation ensures concurrent
transactions don't interfere with each other.
Q18. A conflict in scheduling is serializable if the transactions' conflict graph is:
A) Cyclic
B) Fully connected
C) Acyclic (no cycles)
D) Undirected
✅ Answer: C) Acyclic (no cycles)
Explanation: A schedule is conflict-serializable if the precedence (conflict) graph has no cycles — meaning it can
be converted to a serial schedule.
📚 Operating Systems
Q19. Which disk scheduling algorithm is commonly used to improve I/O performance
by moving the disk arm in one direction?
A) FCFS
B) SSTF
C) SCAN (Elevator)
D) Round Robin
✅ Answer: C) SCAN (Elevator)
Explanation: The SCAN algorithm moves the disk arm in one direction servicing requests until it reaches the
end, then reverses — similar to an elevator.
Q20. Which memory management technique is used in .NET?
A) Manual memory allocation
B) Garbage Collection
C) Reference counting only
D) Stack-only allocation
✅ Answer: B) Garbage Collection
Explanation: .NET uses a Garbage Collector (GC) that automatically frees unused memory, reducing memory
leaks.
Q21. What is a deadlock in an operating system?
A) A process running too fast
B) Two or more processes waiting for each other's resources indefinitely
C) A crashed process
D) CPU overloading
✅ Answer: B) Two or more processes waiting for each other's resources indefinitely
Explanation: Deadlock occurs when processes hold resources and wait for others held by each other, forming a
circular wait.
Q22. Which scheduling algorithm assigns the CPU to the process with the shortest
next CPU burst?
A) FCFS
B) Round Robin
C) SJF (Shortest Job First)
D) Priority Scheduling
✅ Answer: C) SJF (Shortest Job First)
Explanation: SJF selects the process with the smallest estimated next CPU burst, minimizing average waiting
time.
Q23. What is virtual memory?
A) RAM installed on the GPU
B) A technique that uses disk space as an extension of RAM
C) Cache memory inside the CPU
D) Read-only memory
✅ Answer: B) A technique that uses disk space as an extension of RAM
Explanation: Virtual memory allows a computer to run programs larger than physical RAM by using disk storage
as overflow memory.
Q24. Which of the following is NOT a state in a process lifecycle?
A) Ready
B) Running
C) Blocked
D) Compiling
✅ Answer: D) Compiling
Explanation: A process has states: New, Ready, Running, Blocked/Waiting, and Terminated. Compiling is not a
runtime process state.
📚 OOP & Programming Concepts
Q25. What is serialization in programming?
A) Converting an object into a byte stream for storage or transmission
B) Sorting objects alphabetically
C) Encrypting code
D) Compiling source code
✅ Answer: A) Converting an object into a byte stream for storage or transmission
Explanation: Serialization converts an object's state into a format (like JSON or binary) that can be stored or sent
over a network.
Q26. What is the output of: for(int i=1; i<=5; i++){ [Link](i); }
A) 1 2 3 4 5
B) 12345
C) 0 1 2 3 4
D) 01234
✅ Answer: B) 12345
Explanation: [Link]() (without println) does not add a newline, so numbers print consecutively: 12345.
Q27. Which OOP principle hides the internal implementation from the outside world?
A) Inheritance
B) Polymorphism
C) Encapsulation
D) Abstraction
✅ Answer: C) Encapsulation
Explanation: Encapsulation bundles data and methods together and restricts direct access, exposing only what
is necessary.
Q28. Which keyword is used to prevent a class from being inherited in Java?
A) static
B) abstract
C) final
D) private
✅ Answer: C) final
Explanation: In Java, the 'final' keyword on a class prevents it from being subclassed.
Q29. What does polymorphism mean in OOP?
A) A class having multiple constructors
B) An object taking many forms
C) Inheriting from multiple classes
D) Hiding class members
✅ Answer: B) An object taking many forms
Explanation: Polymorphism allows a single interface to represent different underlying data types — e.g., method
overriding and overloading.
Q30. Which Python data type cannot have duplicate values?
A) List
B) Tuple
C) Dictionary
D) Set
✅ Answer: D) Set
Explanation: A Python Set automatically removes duplicates — it only stores unique values.
Q31. What is the difference between an abstract class and an interface?
A) No difference
B) Abstract class can have method implementations; interface (traditionally) cannot
C) Interface can have constructors
D) Abstract class cannot be extended
✅ Answer: B) Abstract class can have method implementations; interface (traditionally)
cannot
Explanation: Abstract classes can have both implemented and abstract methods. Traditional interfaces only
declare methods without implementation.
Q32. What does the 'this' keyword refer to in Java?
A) The parent class
B) The current object instance
C) A static variable
D) The return type
✅ Answer: B) The current object instance
Explanation: 'this' refers to the current instance of the class, used to differentiate instance variables from
parameters.
📚 .NET & Web Development
Q33. Who converts MSIL (Microsoft Intermediate Language) to native code at
runtime?
A) Compiler
B) Linker
C) JIT (Just-In-Time) Compiler
D) Interpreter
✅ Answer: C) JIT (Just-In-Time) Compiler
Explanation: In .NET, the JIT compiler converts MSIL/CIL code to native machine code at runtime, enabling
platform-specific optimization.
Q34. What is the value stored between postbacks in a web application?
A) Session variable
B) Cookie
C) ViewState
D) Cache
✅ Answer: C) ViewState
Explanation: ViewState is an [Link] mechanism that stores page and control values between postbacks as a
hidden field in the page.
Q35. Does Turbo C++ support modern processors like Core i3 and i5?
A) Yes, fully supports all features
B) No, it is a legacy 16-bit compiler not optimized for modern processors
C) Only supports Core i3
D) Yes, with a plugin
✅ Answer: B) No, it is a legacy 16-bit compiler not optimized for modern processors
Explanation: Turbo C++ is an old 16-bit IDE/compiler. It does not leverage modern 32/64-bit processor features
of Core i3 or i5.
Q36. What does HTTP stand for?
A) HyperText Transfer Protocol
B) High Transfer Text Process
C) Hyperlink Transfer Technology Protocol
D) HyperText Technical Program
✅ Answer: A) HyperText Transfer Protocol
Explanation: HTTP (HyperText Transfer Protocol) is the foundation of web communication, used to transfer data
between browsers and servers.
Q37. Which HTTP method is used to retrieve data from a server?
A) POST
B) DELETE
C) PUT
D) GET
✅ Answer: D) GET
Explanation: GET requests retrieve data from a server without modifying it. POST, PUT, DELETE modify or send
data.
Q38. What is the purpose of cookies in web applications?
A) Store large files on the server
B) Store small data on the client's browser
C) Encrypt web traffic
D) Compress HTML pages
✅ Answer: B) Store small data on the client's browser
Explanation: Cookies are small pieces of data stored on the client side, used to remember user preferences,
sessions, and tracking.
Q39. In [Link], which object stores user-specific data across multiple requests?
A) Application
B) Cache
C) Session
D) ViewState
✅ Answer: C) Session
Explanation: Session stores user-specific data server-side and persists it across multiple HTTP requests for the
same user.
📚 AI & Emerging Technologies
Q40. Which technology is primarily used in ChatGPT?
A) Convolutional Neural Networks (CNN)
B) Large Language Models (LLM) based on Transformer architecture
C) Decision Trees
D) K-Nearest Neighbors
✅ Answer: B) Large Language Models (LLM) based on Transformer architecture
Explanation: ChatGPT is built on GPT (Generative Pre-trained Transformer), a Large Language Model using the
Transformer architecture.
Q41. What is machine learning?
A) Manually programming rules for every decision
B) Teaching machines using physical hardware
C) Enabling systems to learn from data and improve without explicit programming
D) A type of database management
✅ Answer: C) Enabling systems to learn from data and improve without explicit programming
Explanation: Machine learning is a subset of AI where systems learn patterns from data and improve
performance over time.
Q42. Which type of machine learning uses labeled training data?
A) Unsupervised Learning
B) Reinforcement Learning
C) Supervised Learning
D) Semi-supervised Learning
✅ Answer: C) Supervised Learning
Explanation: Supervised learning trains models on labeled datasets where input-output pairs are provided.
Q43. What does API stand for?
A) Automated Programming Interface
B) Application Programming Interface
C) Advanced Process Integration
D) Applied Protocol Interface
✅ Answer: B) Application Programming Interface
Explanation: An API defines how software components interact, allowing applications to communicate with each
other.
📚 Networking & Security
Q44. What does DNS stand for?
A) Dynamic Network Service
B) Domain Name System
C) Data Network Security
D) Distributed Node Server
✅ Answer: B) Domain Name System
Explanation: DNS translates human-readable domain names (like [Link]) into IP addresses that computers
use to communicate.
Q45. Which layer of the OSI model is responsible for routing packets?
A) Data Link Layer
B) Transport Layer
C) Network Layer
D) Session Layer
✅ Answer: C) Network Layer
Explanation: The Network Layer (Layer 3) handles logical addressing and routing of packets from source to
destination.
Q46. What is a firewall?
A) A type of virus
B) A hardware/software system that monitors and controls network traffic
C) An encryption algorithm
D) A database backup tool
✅ Answer: B) A hardware/software system that monitors and controls network traffic
Explanation: A firewall filters incoming and outgoing traffic based on security rules to protect a network.
Q47. What does SSL/TLS provide in web communication?
A) Data compression
B) Faster loading
C) Encrypted secure communication
D) IP address assignment
✅ Answer: C) Encrypted secure communication
Explanation: SSL/TLS encrypts data transmitted between a browser and server, preventing interception.
Q48. What is a SQL injection attack?
A) Inserting valid SQL to optimize a query
B) Malicious SQL code inserted into input to manipulate a database
C) A database normalization technique
D) A stored procedure
✅ Answer: B) Malicious SQL code inserted into input to manipulate a database
Explanation: SQL injection exploits vulnerabilities where user input is improperly sanitized, allowing attackers to
manipulate queries.
Q49. What is the full form of IP in networking?
A) Internet Protocol
B) Intranet Process
C) Information Packet
D) Internal Port
✅ Answer: A) Internet Protocol
Explanation: IP (Internet Protocol) is the principal communications protocol for relaying packets across network
boundaries.
📚 Python Programming
Q50. Which Python data type is immutable and ordered?
A) List
B) Set
C) Tuple
D) Dictionary
✅ Answer: C) Tuple
Explanation: Tuples are ordered and immutable in Python — once created, their elements cannot be changed.
Q51. What does the 'len()' function return in Python?
A) The last element
B) The number of elements
C) The sum of elements
D) The data type
✅ Answer: B) The number of elements
Explanation: len() returns the number of items in a string, list, tuple, dictionary, or other collection.
Q52. What is the output of: print(type(3.14)) in Python?
A) <class 'int'>
B) <class 'double'>
C) <class 'float'>
D) <class 'decimal'>
✅ Answer: C) <class 'float'>
Explanation: 3.14 is a floating-point number, so type() returns <class 'float'>.
Q53. Which Python keyword is used to handle exceptions?
A) catch
B) error
C) except
D) handle
✅ Answer: C) except
Explanation: Python uses try/except blocks for exception handling. The 'except' clause catches and handles
exceptions.
Q54. What does 'append()' do to a Python list?
A) Removes the last element
B) Adds an element to the beginning
C) Adds an element to the end
D) Sorts the list
✅ Answer: C) Adds an element to the end
Explanation: The append() method adds a single item to the end of a list.
Q55. What is a lambda function in Python?
A) A function defined with 'def' keyword
B) A small anonymous function defined with 'lambda' keyword
C) A recursive function
D) A built-in class method
✅ Answer: B) A small anonymous function defined with 'lambda' keyword
Explanation: Lambda functions are one-liners: lambda x: x*2 is equivalent to def f(x): return x*2.
Q56. Which operator is used for exponentiation in Python?
A) ^
B) **
C) //
D) %%
✅ Answer: B) **
Explanation: In Python, ** is the exponentiation operator. 2**3 equals 8.
📚 Software Engineering
Q57. What does SDLC stand for?
A) Software Design and Logic Cycle
B) System Development Life Cycle
C) Software Development Life Cycle
D) Structured Design and Language Concept
✅ Answer: C) Software Development Life Cycle
Explanation: SDLC is the process used to plan, create, test, and deploy an information system.
Q58. Which software development model follows a sequential phase-by-phase
approach?
A) Agile
B) Scrum
C) Waterfall
D) Spiral
✅ Answer: C) Waterfall
Explanation: The Waterfall model is a linear sequential approach where each phase must be completed before
the next begins.
Q59. What is a use case diagram used for?
A) Show system architecture
B) Model the interaction between users and a system
C) Describe database schema
D) Show code flow
✅ Answer: B) Model the interaction between users and a system
Explanation: Use case diagrams (UML) show how actors (users/systems) interact with system functionalities.
Q60. What is the purpose of version control systems like Git?
A) Compile code faster
B) Encrypt source code
C) Track and manage changes to source code over time
D) Deploy applications automatically
✅ Answer: C) Track and manage changes to source code over time
Explanation: Version control systems track changes, enable collaboration, and allow rollback to previous
versions.
Q61. What does 'refactoring' mean in software development?
A) Rewriting code from scratch
B) Improving code structure without changing its behavior
C) Adding new features
D) Deploying to production
✅ Answer: B) Improving code structure without changing its behavior
Explanation: Refactoring improves code readability and maintainability while preserving its external behavior.
Q62. In Agile methodology, what is a 'Sprint'?
A) A bug-fixing session
B) A short fixed iteration (usually 1-4 weeks) to complete a set of tasks
C) A final product release
D) A team meeting
✅ Answer: B) A short fixed iteration (usually 1-4 weeks) to complete a set of tasks
Explanation: In Scrum/Agile, a Sprint is a time-boxed period during which specific work is completed and made
ready for review.
📚 Computer Architecture
Q63. What does CPU stand for?
A) Central Process Utility
B) Central Processing Unit
C) Computer Processing Unit
D) Core Processing Utility
✅ Answer: B) Central Processing Unit
Explanation: The CPU is the primary component that executes instructions of a computer program.
Q64. What is the purpose of cache memory?
A) Long-term data storage
B) Temporary fast storage between CPU and RAM
C) GPU memory
D) Network buffer
✅ Answer: B) Temporary fast storage between CPU and RAM
Explanation: Cache memory is high-speed memory located close to the CPU that stores frequently accessed
data for quick retrieval.
Q65. What is the function of the ALU in a CPU?
A) Store data
B) Perform arithmetic and logical operations
C) Handle input/output
D) Manage memory allocation
✅ Answer: B) Perform arithmetic and logical operations
Explanation: The Arithmetic Logic Unit (ALU) performs all mathematical computations and logical comparisons in
the CPU.
Q66. What does RAM stand for?
A) Read Access Memory
B) Random Access Memory
C) Rapid Allocation Memory
D) Remote Access Module
✅ Answer: B) Random Access Memory
Explanation: RAM is volatile memory used for temporarily storing data that is actively being used by the CPU.
Q67. Which number system uses base 16?
A) Binary
B) Octal
C) Decimal
D) Hexadecimal
✅ Answer: D) Hexadecimal
Explanation: Hexadecimal uses base 16 with digits 0-9 and letters A-F. Widely used in programming and color
codes.
Q68. What is the binary representation of decimal 10?
A) 1010
B) 1100
C) 0110
D) 1001
✅ Answer: A) 1010
Explanation: 10 in binary = 8+2 = 1010. (8=1, 4=0, 2=1, 1=0).
Q69. What is pipelining in computer architecture?
A) Connecting multiple computers
B) Executing multiple instruction stages simultaneously
C) A disk scheduling method
D) A memory compression technique
✅ Answer: B) Executing multiple instruction stages simultaneously
Explanation: Pipelining overlaps instruction execution stages (fetch, decode, execute) to improve CPU
throughput.
📚 Java Programming
Q70. What is the output of: [Link](10 / 3); in Java?
A) 3.33
B) 3
C) 4
D) 3.0
✅ Answer: B) 3
Explanation: In Java, integer division truncates the decimal. 10 / 3 = 3 (not 3.33).
Q71. Which Java keyword is used to create a subclass?
A) implements
B) extends
C) inherits
D) super
✅ Answer: B) extends
Explanation: The 'extends' keyword is used to inherit from a class. 'implements' is used for interfaces.
Q72. What is the default value of a boolean variable in Java?
A) true
B) 0
C) null
D) false
✅ Answer: D) false
Explanation: In Java, uninitialized boolean instance variables default to false.
Q73. Which collection in Java maintains insertion order and allows duplicates?
A) HashSet
B) TreeSet
C) ArrayList
D) HashMap
✅ Answer: C) ArrayList
Explanation: ArrayList is an ordered collection that maintains insertion order and allows duplicate elements.
Q74. What does the 'static' keyword mean in Java?
A) The variable changes frequently
B) The method/variable belongs to the class, not instances
C) The class cannot be modified
D) The method runs asynchronously
✅ Answer: B) The method/variable belongs to the class, not instances
Explanation: Static members belong to the class itself. They can be accessed without creating an object.
Q75. What is an interface in Java?
A) A class with all methods implemented
B) A blueprint with abstract method signatures and constants
C) A type of loop
D) A GUI component
✅ Answer: B) A blueprint with abstract method signatures and constants
Explanation: An interface defines a contract — it declares method signatures that implementing classes must
provide.
📚 Cybersecurity
Q76. What is phishing?
A) A network scanning tool
B) Fraudulent attempt to obtain sensitive info by disguising as a trustworthy entity
C) A type of encryption
D) A database attack
✅ Answer: B) Fraudulent attempt to obtain sensitive info by disguising as a trustworthy entity
Explanation: Phishing tricks users into revealing passwords or credit card details via fake emails or websites.
Q77. What does encryption do to data?
A) Deletes it
B) Compresses it
C) Converts it into an unreadable format for unauthorized users
D) Duplicates it
✅ Answer: C) Converts it into an unreadable format for unauthorized users
Explanation: Encryption transforms data into ciphertext using an algorithm and key, only readable by authorized
parties.
Q78. What is a brute force attack?
A) A physical attack on hardware
B) Trying all possible combinations to crack a password
C) Overloading a server with requests
D) Injecting malicious code
✅ Answer: B) Trying all possible combinations to crack a password
Explanation: Brute force attacks systematically try every possible combination until the correct password is
found.
Q79. What is the purpose of two-factor authentication (2FA)?
A) Speed up login
B) Add an extra layer of security beyond just a password
C) Replace passwords entirely
D) Encrypt the database
✅ Answer: B) Add an extra layer of security beyond just a password
Explanation: 2FA requires two forms of verification (e.g., password + OTP), making unauthorized access much
harder.
Q80. What is a DDoS attack?
A) Data Deletion on Server
B) Overwhelming a server with traffic to make it unavailable
C) Decrypting a secure database
D) Downloading data illegally
✅ Answer: B) Overwhelming a server with traffic to make it unavailable
Explanation: A Distributed Denial of Service attack floods a target with massive traffic from multiple sources,
disrupting service.
Q81. What is malware?
A) Useful software
B) A type of hardware
C) Software designed to disrupt, damage, or gain unauthorized access
D) A web browser plugin
✅ Answer: C) Software designed to disrupt, damage, or gain unauthorized access
Explanation: Malware includes viruses, trojans, ransomware, and spyware — all designed to harm systems or
steal data.
📚 Miscellaneous CS Concepts
Q82. What is cloud computing?
A) Storing data on local hard drives
B) Delivering computing services over the internet
C) Building physical server rooms
D) Using only offline software
✅ Answer: B) Delivering computing services over the internet
Explanation: Cloud computing provides on-demand resources like storage, processing, and software over the
internet.
Q83. What does IDE stand for in programming?
A) Integrated Development Environment
B) Internal Design Editor
C) Internet Development Engine
D) Interpreted Data Execution
✅ Answer: A) Integrated Development Environment
Explanation: An IDE combines a code editor, debugger, and compiler into one application (e.g., VS Code,
IntelliJ, Eclipse).
Q84. What is open-source software?
A) Software sold commercially
B) Software whose source code is freely available to view, use, and modify
C) Software with no bugs
D) Software only for education
✅ Answer: B) Software whose source code is freely available to view, use, and modify
Explanation: Open-source software (like Linux, Python) can be freely accessed, modified, and distributed by
anyone.
Q85. What is the function of a compiler?
A) Run code line by line
B) Connect to the internet
C) Translate high-level code to machine code all at once
D) Store files on disk
✅ Answer: C) Translate high-level code to machine code all at once
Explanation: A compiler translates the entire source code into machine language before execution. An
interpreter does it line by line.
Q86. What is a stack overflow error?
A) Too many database queries
B) Running out of stack memory due to deep/infinite recursion
C) A network timeout
D) An arithmetic error
✅ Answer: B) Running out of stack memory due to deep/infinite recursion
Explanation: Stack overflow happens when recursive function calls exceed the available stack memory, causing
a crash.
Q87. What is the difference between compiled and interpreted languages?
A) No difference
B) Compiled languages translate all code at once; interpreted languages run line by line
C) Interpreted languages are faster
D) Compiled languages don't need a CPU
✅ Answer: B) Compiled languages translate all code at once; interpreted languages run line
by line
Explanation: C/C++ are compiled. Python/JavaScript are interpreted. Compiled code generally runs faster.
Q88. What does JSON stand for?
A) Java Serialized Object Notation
B) JavaScript Object Notation
C) Java Standard Output Node
D) Joint Server Object Network
✅ Answer: B) JavaScript Object Notation
Explanation: JSON is a lightweight data-interchange format. It's easy for humans to read and for machines to
parse.
Q89. Which protocol is used to send emails?
A) HTTP
B) FTP
C) SMTP
D) SSH
✅ Answer: C) SMTP
Explanation: SMTP (Simple Mail Transfer Protocol) is used to send emails from client to server and between
servers.
Q90. What is the purpose of an operating system?
A) Write application code
B) Manage hardware resources and provide services to applications
C) Design user interfaces
D) Create databases
✅ Answer: B) Manage hardware resources and provide services to applications
Explanation: The OS manages CPU, memory, storage, and provides a layer between hardware and software
applications.
Q91. What is the full form of OOP?
A) Object-Oriented Protocol
B) Organized Output Programming
C) Object-Oriented Programming
D) Online Output Process
✅ Answer: C) Object-Oriented Programming
Explanation: OOP is a programming paradigm based on objects that bundle data (attributes) and behavior
(methods).
Q92. What is the use of the 'break' statement in a loop?
A) Skips the current iteration
B) Restarts the loop
C) Exits the loop immediately
D) Pauses the loop
✅ Answer: C) Exits the loop immediately
Explanation: The 'break' statement terminates the nearest enclosing loop immediately when executed.
Q93. What is a primary key in a database table?
A) The first column of the table
B) A key that uniquely identifies each row in the table
C) A key shared between two tables
D) A key that allows duplicate values
✅ Answer: B) A key that uniquely identifies each row in the table
Explanation: A primary key uniquely identifies each record. It must be unique and cannot be NULL.
Q94. What does 'www' stand for in a web address?
A) World Wide Web
B) Web Working Wireless
C) Wide World Web
D) World Web Wireless
✅ Answer: A) World Wide Web
Explanation: WWW stands for World Wide Web — the system of interlinked pages accessible through the
internet.
Q95. What is the purpose of the 'continue' statement in a loop?
A) Exits the loop
B) Skips the rest of the current iteration and moves to the next
C) Restarts the entire loop
D) Pauses execution
✅ Answer: B) Skips the rest of the current iteration and moves to the next
Explanation: The 'continue' statement skips the remaining code in the current iteration and jumps to the next
loop cycle.
Q96. What is the difference between a class and an object in OOP?
A) They are the same thing
B) A class is a blueprint; an object is an instance of that class
C) An object is the blueprint; a class is the instance
D) Classes are only used in Java
✅ Answer: B) A class is a blueprint; an object is an instance of that class
Explanation: A class defines structure and behavior. An object is a specific instance created from that class.
Q97. What is a constructor in OOP?
A) A method that destroys objects
B) A special method called automatically when an object is created
C) A static method
D) A type of loop
✅ Answer: B) A special method called automatically when an object is created
Explanation: A constructor initializes an object's attributes. It has the same name as the class and no return type.
Q98. Which data structure is used to implement a function call stack?
A) Queue
B) Array
C) Stack
D) Tree
✅ Answer: C) Stack
Explanation: Function calls are managed using a call stack — each function call is pushed onto the stack and
popped when it returns.
Q99. What does GUI stand for?
A) General Utility Interface
B) Graphical User Interface
C) Global Unified Integration
D) Generated UI Instance
✅ Answer: B) Graphical User Interface
Explanation: GUI provides a visual interface using windows, buttons, and icons, making software user-friendly
compared to command-line interfaces.
Q100. What is big data?
A) Data stored on large hard drives
B) Extremely large and complex datasets that cannot be processed by traditional tools
C) Data in a relational database
D) Data larger than 1GB
✅ Answer: B) Extremely large and complex datasets that cannot be processed by traditional
tools
Explanation: Big data refers to datasets so large or complex that traditional processing software is inadequate. It
is characterized by Volume, Velocity, and Variety (3 Vs).
End of Quiz — Good Luck! 🎓