What is the sum of all the numbers from 1 to 200?
What the interviewer is testing
Spotting structure instead of brute force.
Answer it out loud firstTake 30–60 seconds, as you would in the room. Then compare with the model answer.
Show the model answer
Pair them: 1 + 200, 2 + 199, and so on — each pair is 201, and there are 100 pairs, so 20,100. Equivalently, the average is 100.5 and there are 200 numbers: 100.5 × 200 = 20,100. The general formula is n(n + 1) ÷ 2.
The full answer
Sum of 1 to n = n × (n + 1) ÷ 2 = 200 × 201 ÷ 2 = 20,100
Variants
- Sum of the even numbers from 2 to 200: 2 × (1 + … + 100) = 2 × 5,050 = 10,100.
- Sum from 50 to 150: 101 numbers with an average of 100 → 10,100.
Mistakes to avoid
Starting to add the numbers one by one.
Follow-ups they may ask
How did your answer compare?
Log in to keep track of the questions you’ve mastered.