Computer Science Quiz
Free practice quiz on Computer Science Quiz with detailed solutions for government exam preparation.
About This Quiz
Computer Science Quiz — Questions with Solutions
All 25 questions from this quiz with the correct answer and explanation. Attempt them yourself first, then open each solution to check your reasoning.
Q1.A compiler is used to:
- A.Translate high-level code into machine code
- B.Print documents
- C.Connect to the internet
- D.Store data permanently
Show answer
Answer: A. Translate high-level code into machine code
A compiler translates source code into executable machine code.
Q2.Which data structure follows the Last-In-First-Out (LIFO) principle?
- A.Queue
- B.Stack
- C.Array
- D.Linked list
Show answer
Answer: B. Stack
A stack follows LIFO: the last element added is removed first.
Q3.Which data structure follows the First-In-First-Out (FIFO) principle?
- A.Stack
- B.Queue
- C.Tree
- D.Graph
Show answer
Answer: B. Queue
A queue follows FIFO: the first element added is removed first.
Q4.Binary number system uses which two digits?
- A.0 and 1
- B.1 and 2
- C.0 and 9
- D.2 and 8
Show answer
Answer: A. 0 and 1
Binary numbers are represented using only 0 and 1.
Q5.Which of the following is an object-oriented programming language?
- A.Java
- B.HTML
- C.CSS
- D.SQL
Show answer
Answer: A. Java
Java is a widely used object-oriented programming language.
Q6.An algorithm is best described as:
- A.A step-by-step procedure to solve a problem
- B.A type of hardware
- C.A programming language
- D.A network protocol
Show answer
Answer: A. A step-by-step procedure to solve a problem
An algorithm is a defined sequence of steps to solve a problem.
Q7.Which of these is a type of computer memory that is non-volatile?
- A.RAM
- B.ROM
- C.Cache
- D.Register
Show answer
Answer: B. ROM
ROM retains data even when power is switched off.
Q8.SQL is mainly used for:
- A.Managing and querying databases
- B.Designing web pages
- C.Editing images
- D.Playing music
Show answer
Answer: A. Managing and querying databases
SQL (Structured Query Language) is used to manage relational databases.
Q9.Which sorting algorithm repeatedly swaps adjacent elements if they are in the wrong order?
- A.Bubble sort
- B.Binary search
- C.Merge sort (not primarily)
- D.Quick sort (not primarily)
Show answer
Answer: A. Bubble sort
Bubble sort works by repeatedly swapping adjacent out-of-order elements.
Q10.A variable in programming is used to:
- A.Store data that can change
- B.Print output only
- C.Connect to a network
- D.Format text only
Show answer
Answer: A. Store data that can change
Variables store data values that can be modified during program execution.
Q11.Which of these is an example of a high-level programming language?
- A.Python
- B.Assembly language
- C.Machine code
- D.Binary code
Show answer
Answer: A. Python
Python is a high-level, human-readable programming language.
Q12.A loop in programming is used to:
- A.Repeat a block of code multiple times
- B.Delete a program
- C.Compile code
- D.Encrypt data
Show answer
Answer: A. Repeat a block of code multiple times
Loops allow repeated execution of a code block.
Q13.Which logic gate outputs true only when both inputs are true?
- A.OR gate
- B.AND gate
- C.NOT gate
- D.XOR gate
Show answer
Answer: B. AND gate
An AND gate outputs true only if all its inputs are true.
Q14.Which of the following best describes a 'database'?
- A.An organized collection of data
- B.A single computer file
- C.A type of printer
- D.A network cable
Show answer
Answer: A. An organized collection of data
A database is a structured collection of data.
Q15.Which memory is used to speed up processor access to frequently used data?
- A.Cache memory
- B.Hard disk
- C.ROM
- D.Optical disk
Show answer
Answer: A. Cache memory
Cache memory provides fast access to frequently used data.
Q16.Which of the following is a version control system used in software development?
- A.Git
- B.MS Word
- C.Excel
- D.Photoshop
Show answer
Answer: A. Git
Git is widely used for tracking changes in source code.
Q17.An IP address version that uses 32-bit addressing is called:
- A.IPv4
- B.IPv6
- C.IPv8
- D.IPv2
Show answer
Answer: A. IPv4
IPv4 uses 32-bit addresses; IPv6 uses 128-bit addresses.
Q18.Which of these best describes 'debugging'?
- A.Finding and fixing errors in code
- B.Deleting a program
- C.Compiling source code
- D.Formatting a hard disk
Show answer
Answer: A. Finding and fixing errors in code
Debugging is the process of identifying and correcting code errors.
Q19.A 'function' in programming is best described as:
- A.A reusable block of code that performs a specific task
- B.A type of variable
- C.A hardware component
- D.A network device
Show answer
Answer: A. A reusable block of code that performs a specific task
Functions encapsulate reusable logic for specific tasks.
Q20.Which number system is commonly used to represent memory addresses in a compact form?
- A.Hexadecimal
- B.Binary only
- C.Decimal only
- D.Roman numerals
Show answer
Answer: A. Hexadecimal
Hexadecimal is often used for compact representation of binary data/addresses.
Q21.Which of the following best defines an 'operating system'?
- A.Software that manages hardware resources and runs applications
- B.A hardware component
- C.A type of virus
- D.A network cable
Show answer
Answer: A. Software that manages hardware resources and runs applications
An OS manages hardware and provides a platform for applications.
Q22.In object-oriented programming, encapsulation refers to:
- A.Bundling data and methods that operate on that data together
- B.Deleting unused variables
- C.Compiling code faster
- D.Connecting to the internet
Show answer
Answer: A. Bundling data and methods that operate on that data together
Encapsulation bundles data and related methods within a single unit (class).
Q23.Which of these is a common file extension for a Python script?
- A..py
- B..exe
- C..txt
- D..doc
Show answer
Answer: A. .py
Python scripts commonly use the .py file extension.
Q24.A 'bug' in programming refers to:
- A.An error or flaw in a program
- B.A type of computer virus only
- C.A hardware fault only
- D.A network attack
Show answer
Answer: A. An error or flaw in a program
A bug is a defect or error that causes a program to behave incorrectly.
Q25.Which of these is an example of an interpreted programming language?
- A.Python
- B.C (compiled)
- C.C++ (compiled)
- D.Assembly
Show answer
Answer: A. Python
Python code is generally executed by an interpreter rather than compiled directly to machine code.
Frequently Asked Questions
Is Computer Science Quiz free to attempt on AajExam?
Yes. Computer Science Quiz is completely free. You only need a free AajExam account to track your score, view detailed solutions and unlock cross-attempt analytics.
How long does it take to complete Computer Science Quiz?
Computer Science Quiz runs on a 25-minute timer in real exam-style conditions. The clock starts the moment you click Start, mirroring the time pressure of the actual exam.
Are detailed solutions provided?
Yes. Every question on Computer Science Quiz ships with a complete step-by-step solution, the underlying concept, and (where applicable) shortcut tricks. You can also discuss any question with the AajExam community.
Can I attempt Computer Science Quiz multiple times?
Yes. You can attempt this quiz as many times as you like. Each attempt is recorded separately so you can track improvement in score, accuracy and time-management.
Which government exams does this quiz prepare me for?
Computer Science questions appear regularly in SSC CGL, CHSL, MTS, GD; IBPS PO, Clerk; SBI PO, Clerk; RRB NTPC, Group D; UPSC prelims and most State PSC exams. The specific weightage varies by exam — check the exam pattern on the corresponding AajExam exam page for details.