Python: Which statement about Prefix Sums is the strongest interview answer?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

Which statement about Prefix Sums is the strongest interview answer?

  1. Prefix Sums is mostly a naming style choice and has little effect on runtime behavior or design tradeoffs.
  2. Prefix Sums exists mainly to reduce the number of files in a Python project.
  3. A prefix-sum structure stores running totals so many range-sum queries can be answered with subtraction instead of rescanning.
  4. Prefix Sums matters only for frontend scripting and not for backend or automation code.

Hint

Start with the core rule behind Prefix Sums.

Answer and rationale

Correct answer: C. A prefix-sum structure stores running totals so many range-sum queries can be answered with subtraction instead of rescanning.

A prefix-sum structure stores running totals so many range-sum queries can be answered with subtraction instead of rescanning. This is the base concept interviewers commonly test first.

Track: Python