Computer Science MCQs with Answers

Computer knowledge is tested in jobs ranging from clerical posts to IT positions. Practice MCQs on computer fundamentals, hardware, software, MS Office, networking, internet, databases and programming concepts, and see your score as soon as you finish.

Take a timed Computer Science quiz: Free account required to save your score.

Q241. What is an array?

  1. A function
  2. A loop
  3. A single variable
  4. A collection of elements of the same type
Show answer and explanation

Correct answer: D. A collection of elements of the same type

Arrays store multiple values.

Q242. Which command in Windows lists files in a directory?

  1. show
  2. ls
  3. dir
  4. list
Show answer and explanation

Correct answer: C. dir

dir lists directory contents in Windows CMD.

Q243. What is the time complexity of binary search?

  1. O(1)
  2. O(n^2)
  3. O(log n)
  4. O(n)
Show answer and explanation

Correct answer: C. O(log n)

Binary search halves the range each step.

Q244. Which of the following is a relational database?

  1. Neo4j
  2. MySQL
  3. Redis
  4. MongoDB
Show answer and explanation

Correct answer: B. MySQL

MySQL is relational.

Q245. Which SQL JOIN returns only matching rows from both tables?

  1. CROSS JOIN
  2. INNER JOIN
  3. LEFT JOIN
  4. FULL JOIN
Show answer and explanation

Correct answer: B. INNER JOIN

INNER JOIN returns matches.

Q246. Which unit is used to measure CPU clock speed?

  1. Hertz (GHz)
  2. Watt
  3. Pixel
  4. Byte
Show answer and explanation

Correct answer: A. Hertz (GHz)

Clock speed is measured in hertz.

Q247. What does FTP stand for?

  1. File Transport Process
  2. Fast Transfer Protocol
  3. File Transfer Protocol
  4. File Transmission Program
Show answer and explanation

Correct answer: C. File Transfer Protocol

FTP transfers files.

Q248. What is a primary key?

  1. A unique identifier for each record
  2. A null value
  3. A duplicate value
  4. A foreign column
Show answer and explanation

Correct answer: A. A unique identifier for each record

A primary key uniquely identifies a row.

Q249. Which generation of computers used integrated circuits?

  1. First generation
  2. Fifth generation
  3. Second generation
  4. Third generation
Show answer and explanation

Correct answer: D. Third generation

Third generation used ICs.

Q250. What is the decimal value of binary 1010?

  1. 8
  2. 10
  3. 12
  4. 14
Show answer and explanation

Correct answer: B. 10

1x8 + 0x4 + 1x2 + 0 = 10.

Computer Science MCQs by exam

Other subjects

Looking for a job? Apply while you prepare: browse the latest government and private jobs on PK JOBs Hub.