Free Practice Quiz Question List

01. Introduction to Programming and Algorithmic Problem Solving Online Quiz Questions

Use this free practice quiz with 20 questions to review 01. Introduction to Programming and Algorithmic Problem Solving, test your knowledge, and prepare for your next test or exam.

20 questions
01
True or false
1 point

True or false: A program can have valid syntax but still have incorrect semantics.

  1. A

    True

  2. B

    False

02
Choose one
1 point

Which example is an expression rather than a statement?

  1. A

    2 + 3

  2. B

    x = 2 + 3

  3. C

    print(x)

  4. D

    if x > 0:

03
True or false
1 point

True or false: Binary search requires the input collection to be sorted.

  1. A

    True

  2. B

    False

04
Written response
1 point

What programming problem-solving process breaks a larger task into smaller operations?

05
Fill in the blank
1 point

A finite, ordered procedure for solving a problem is an .

06
Choose one
1 point

In age = 21, what programming concept is represented by age?

  1. A

    A data type

  2. B

    A Boolean expression

  3. C

    A variable

  4. D

    An index

07
Choose all
1 point

Which categories should a thorough test plan include? Select all correct choices.

  1. A

    Normal cases

  2. B

    Boundary cases

  3. C

    Special cases

  4. D

    Invalid cases

  5. E

    Only cases with positive integers

08
Written response
1 point

How many times does this code print Repeat?

for count in range(3):
print("Repeat")

09
Fill in the blank
1 point

A named, reusable block of code that may accept inputs and return an output is a .

10
Choose one
1 point

In an if/elif/else structure, what happens after one tested condition matches?

  1. A

    Every branch whose condition is true executes

  2. B

    Only the first matching branch executes

  3. C

    Only the else branch executes

  4. D

    Branches execute in reverse order

11
Choose all
1 point

Which two measures are commonly used to evaluate an algorithm's resource use? Select all correct choices.

  1. A

    Syntax complexity

  2. B

    Time complexity

  3. C

    Space complexity

  4. D

    Name complexity

  5. E

    Comment complexity

12
Open ended
1 point

Explain a reliable workflow for turning a vague programming requirement into a tested and refined solution. Describe the purpose of the major stages and how they relate to one another.

13
Choose one
1 point

Given colors = ["red", "green", "blue"], which element does colors[0] access?

  1. A

    The second element

  2. B

    The last element

  3. C

    The first element

  4. D

    An element chosen at random

14
Choose one
1 point

Which statement correctly distinguishes decidability from efficiency?

  1. A

    Decidability asks only whether an algorithm is fast

  2. B

    Decidability asks whether a universally halting correct algorithm exists

  3. C

    Decidability and efficiency are exactly the same question

  4. D

    Efficiency determines whether every problem has an algorithm

15
True or false
1 point

True or false: An algorithm can be described in natural language or pseudocode, but a program must follow the formal rules of a programming language.

  1. A

    True

  2. B

    False

16
Choose one
1 point

The following algorithm starts with the first item as the current largest and replaces it whenever a larger item is found. What value does it return for [7, 2, 10, 4]?

  1. A

    4

  2. B

    10

  3. C

    7

  4. D

    2

17
Written response
1 point

What is the single term for breaking a programming task into smaller operations, such as reading scores, calculating an average, comparing boundaries, and displaying a result?

18
Choose one
1 point

A program runs until it attempts to divide by zero and then stops. Which category best describes this defect?

  1. A

    Syntax error

  2. B

    Logic error

  3. C

    Runtime error or exception

  4. D

    Efficiency problem

19
Choose one
1 point

Which question is primarily about decidability rather than algorithmic efficiency?

  1. A

    Whether an algorithm exists that always gives the correct answer and halts for every valid input

  2. B

    Whether an algorithm uses less memory than another algorithm

  3. C

    Whether a program has syntactically valid statements

  4. D

    Whether a loop repeats a fixed number of times

20
Written response
1 point

A program must represent whether a user account is active or inactive. What data type is the most appropriate for this value?