Big O and Design

38 MCQs Covers time and space complexity, Big O notation (O(1), O(log n), O(n), O(n²)), efficiency and scalability.

MCQs

38 questions · 35 min · 38 marks

Want to try first? Take the free Computer Science test: SDLC and Waterfall Model

Sample questions

The first 5 of 38. Try each one, then tap to see the answer.

  1. Question 1

    What does time complexity measure?

    • AThe amount of memory an algorithm uses
    • BHow the runtime increases with input size
    • CThe number of programmers needed
    • DThe cost of the algorithm
    Show answer

    Answer: B

    Time complexity shows how running time grows as the input grows.

  2. Question 2

    What does Big O notation describe?

    • AThe smallest possible runtime
    • BThe cost of hardware
    • CThe number of programmers
    • DThe upper bound on runtime as input size grows
    Show answer

    Answer: D

    Big O gives the worst-case growth of an algorithm.

  3. Question 3

    Which of the following is an example of O(1) time complexity?

    • AAdding two numbers
    • BSearching a list
    • CBubble sort
    • DComparing every student with every other student
    Show answer

    Answer: A

    Adding two numbers takes the same time whatever the input.

  4. Question 4

    What is space complexity?

    • AThe time taken by an algorithm
    • BThe number of programmers
    • CThe amount of memory used by an algorithm
    • DThe cost of the computer
    Show answer

    Answer: C

    Space complexity measures memory use as input grows.

  5. Question 5

    Divide and Conquer works by:

    • AMaking random guesses
    • BBreaking a problem into smaller parts and solving each part
    • CIgnoring the problem
    • DUsing only one step
    Show answer

    Answer: B

    The results of the parts are combined, as in Merge Sort.

More tests in Algorithms and Problem Solving

Practise with a free account

Save your scores, see which chapters need work, and keep a notebook of every question you got wrong.

Create free account