Bank of America Interview Question
709 Interview Reviews |
Back to all Bank of America Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Quantitative Developer at Bank of America:
How many numbers between 1 and 1000 contain a 3?
See more for this Bank of America Quantitative Developer Interview
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (6)
0 of 2 people found this helpful
Helpful Answer?
Yes |
No
Inappropriate?
2 of 2 people found this helpful
The same logic holds for 101-200, 301-400, 401-500, 501-600, 601-700, 701-800, 801-900, and 901-1000. That is 19 * 8 = 152.
There are 20 numbers between 201-300 that contain a 3: 203, 213, 223, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 243, 253, 263, 273, 283, 293, 300. That brings the sum up to 152 + 20 = 172.
Finally, 99 numbers from 301-400 contain a 3. The final sum is 172+99=271.
Of course, there are much more intelligent ways to count. For example, instead of counting how many numbers contain a 3, count how many do NOT contain a 3. That means that there are 9 possibilities for the 1st number (0-9 except 3), 9 possibilities for the 2nd number, and 9 possibilities for the 3rd number. Thus, there are 9 * 9 * 9 = 729 that do not contain a 3 which means that there are 1000 - 729 = 271 numbers that do contain a 3.
Helpful Answer?
Yes |
No
Inappropriate?
1 of 1 people found this helpful
For 300 to 399 = 100 numbers
For other x00 to x99 = 19 numbers each
= 19 x 9 = 171 numbers
Total of 271 numbers
Helpful Answer?
Yes |
No
Inappropriate?
4 of 4 people found this helpful
9^3 = 729 permutations of a base 9 numbering system (a system with no number 3) with 3 digits, since 10^3 = 1000; 10^3 - 9^3 = 271 thus 271 numbers have a 3 in them.
Helpful Answer?
Yes |
No
Inappropriate?
basically the same thing
Helpful Answer?
Yes |
No
Inappropriate?
To comment on this
question,
Sign In with Facebook or
Sign Up
2 of 4 people found this helpful
by Interview Candidate: