Interview Question

Interview

What is the sum of 1-40?

Answer

Interview Answer

5 Answers

0

820

Interview Candidate on Feb 11, 2010
2

We can have the sum by using the following formula N * (N + 1) / 2 So we have: 40 * (40 + 1) / 2 = 820

blue on Mar 21, 2010
0

Since he isn't asking to sum all the numbers from 1 to 40: sum of 1 and 40 = 41 OR sum of 1 + -40 = -39

Evandro on Dec 30, 2010
3

Any sum like this is easy. take the lowest and highest... 1 +40 = 41, then the next highest and the next lowest. 2 + 39 = 41. Realize that there are 20 such pairs. 20 * 41 = 820. For the numbers 1 - 100, 1 + 100 = 101, 2 + 99 = 101; there are 50 such pairs, so 50 * 101 = 5050

scienceguy on Jan 11, 2011
0

http://brainteaserbible.com/interview-brainteaser-sum-of-the-numbers-from-1-to-50

an87 on Jun 13, 2011

Add Answers or Comments

To comment on this, Sign In or Sign Up.