Interview Question: Square Root of 123456.

Discussion on investment and retail banking, equities, trading, derivatives, consultancy.

Announcements Posted on
Enter our travel-writing competition for the chance to win a Nikon 1 J3 camera 21-05-2013
Interview discussion rules - please read before posting! 12-01-2013
Sign in to Reply
  1. Jamil1987's Avatar
    • Exalted Member
    • Location: Hertfordshire
    • Posts: 373
    • Warning points: 2
    Interview Question: Square Root of 123456.
    If you were asked this at an interview how would you tackle it given just a pen and paper. (No Calculator im afraid lol)
  2. salmon1's Avatar
    • Full Member
    • Location: Bucks
    • Posts: 84
    Re: Interview Question: Square Root of 123456.
    300 squared is 90,000; 400 squared is 160,000; so about 340 or 350? How accurate do you have to be and how much time do you have?

    I'm sure there is an elaborate way of getting to the answer in 3 seconds but that's how i'd go about it
  3. Manitude's Avatar
    • TSR Idol
    • Location: The Grim North West
    • Posts: 8,330
    Re: Interview Question: Square Root of 123456.
    Well it's going to end in 6 (I think) and as salmon says will begin with 3.
    So that narrows it down to ten options, assuming an integer solution.

    Just checked, it's not an integer solution so disregard this.
    (It's a little over 351 and a third)
    Last edited by Manitude; 19-05-2012 at 23:47.
  4. Teenage Pirate's Avatar
    • Overlord in Training
    • Posts: 3,232
    Re: Interview Question: Square Root of 123456.
    roughly like this: it's the square root of 1234.56 * 100, so it's 10 times root of 1234.56. which in turn is root of 100 * 12.3456, so 10 times root of 12.3456. so it's 100 times root of 12.3456, root of 12.3456 is root of 4 times c. 3, so it's 200 times root of c. 3, approximate root of 3 as 1.732 (using birth of George Washington as the rule of thumb), so you get 200 * c. 1.8, = 200 + 160 = c. 360

    pretty close?
  5. Intriguing Alias's Avatar
    • TSR Idol
    • Location: Yorkshire
    Re: Interview Question: Square Root of 123456.
    (Original post by Jamil1987)
    If you were asked this at an interview how would you tackle it given just a pen and paper. (No Calculator im afraid lol)
    Yeah probably as teenage pirate did, or simple interval bisection will cause you to guess 350. When you try that you'll get pretty damn close (I imagine they set it up to be fairly close to an obvious number).
  6. M1011's Avatar
    • Overlord in Training
    • Location: London
    • Posts: 2,604
    Re: Interview Question: Square Root of 123456.
    (Original post by Jamil1987)
    If you were asked this at an interview how would you tackle it given just a pen and paper. (No Calculator im afraid lol)
    I'd politely make my excuses and leave.
  7. Mize's Avatar
    • New Member
    • Posts: 2
    Re: Interview Question: Square Root of 123456.
    use Teenage Pirate's break down of:
    square root of 123456= 100 x square root of 12.3456

    1. then make a guess at the square root of 12.3456:
    should be between 3 and 4 because 3x3=9 and 4x4=16
    make a guess of 3.5

    2. Divide 12.3456 by 3.5
    that answer = 3.5273

    3. find the average of 3.5 and 3.5273
    (3.5+3.5273)/2 = 3.51365

    To get more accurate, let 3.51365 be your new guess and do steps 2 and 3 again.

    Checking the answer so far: 3.51365 x 3.51365 = 12.3457 ....which is pretty close already

    But don't forget that you want square root of 123456 = 100 x square root of 12.3456
    =100 x 3.51365 = 351.365

    This method of finding the square root without a calculator is called the Babylonian method.
    Where I learned it and a little better explanation and formula is here square root without calculator

    It's still a bit tedious without a calculator though...that is for sure.
  8. miml's Avatar
    • Overlord in Training
    • Location: Warwickshire
    • Posts: 3,103
    Re: Interview Question: Square Root of 123456.
    Other options include approximating the solution to the relevant Pell equation, or using generalised continued fractions.
  9. M1011's Avatar
    • Overlord in Training
    • Location: London
    • Posts: 2,604
    Re: Interview Question: Square Root of 123456.
    Is this for an IB position? Perhaps the appropriate response should be along the lines of; "I don't deal in numbers that small, sorry."
  10. Jamil1987's Avatar
    • Exalted Member
    • Location: Hertfordshire
    • Posts: 373
    • Warning points: 2
    Re: Interview Question: Square Root of 123456.
    (Original post by M1011)
    Is this for an IB position? Perhaps the appropriate response should be along the lines of; "I don't deal in numbers that small, sorry."
    lol, this particular question was IB Tech @ Nomura
  11. Intriguing Alias's Avatar
    • TSR Idol
    • Location: Yorkshire
    (Original post by Mize)
    2. Divide 12.3456 by 3.5
    that answer = 3.5273.
    Woah woah, so how did you manage this without trouble
  12. Intriguing Alias's Avatar
    • TSR Idol
    • Location: Yorkshire
    (Original post by Jamil1987)
    lol, this particular question was IB Tech @ Nomura
    I don't really understand the need in such a question. No ones ever going to need to randomly approximate a difficult calculation. It takes longer to work it out than to get your phone out and click calculator

    I guess it somewhat shows critical thinking if you'd never done this kind of thing before, but if you had it seems completely useless/unfair on the people who hadn't.
    Last edited by Intriguing Alias; 21-05-2012 at 10:02.
  13. uxa595's Avatar
    • Peer Of The TSR Realm
    • Posts: 1,568
    Re: Interview Question: Square Root of 123456.
    How long did you have. It took me 1min to get it through trial and error.
    did 500x500, too big
    400x400, too big
    300x300, too small
    350x350, about right.
    351x351, close enough
  14. miml's Avatar
    • Overlord in Training
    • Location: Warwickshire
    • Posts: 3,103
    Re: Interview Question: Square Root of 123456.
    (Original post by uxa595)
    How long did you have. It took me 1min to get it through trial and error.
    did 500x500, too big
    400x400, too big
    300x300, too small
    350x350, about right.
    351x351, close enough
    Although that's how most people would do it, your method isn't algorithmic.

    When you get to 350^2 and see that this is too small, so the square root lies in the interval (350,400). A bisection method would go to 375, not 350. The only reason you go to 351 is because |350^2 - 123456| << |400^2 - 123456| so you know the square root is going to be much closer to 350 than it is to 400. Putting this into an algorithm is a trickier (requires a fair amount of pen and paper work at least) than a bisection method, but it's a lot faster. I suppose this is the crux of the question, and is why they've asked it.

    Although it could be that they just want to see the candidate they are interviewing can multiply.
  15. delasandro's Avatar
    • Exalted and Worshipped Member
    • Posts: 951
    Re: Interview Question: Square Root of 123456.
    Do they ask these types of maths questions at IB interviews? :O
    I always thought they were about yourself etc and why you want to work for company etc not actual maths questions?
  16. lego's Avatar
    • Full Member
    • Posts: 143
    Re: Interview Question: Square Root of 123456.
    I did not see the 'pen and paper' comment so that's how I did it in my mind:
    300^2 = 90,000
    400^2 = 160,000
    so it's between 300 and 400
    I know by heart that 35^2 = 1225 and 36^2 = 1296. 1296 - 1225 ¬ 70, 360-350=10, so for an increase of ¬10 (from 1225 to 1235) we should go up by 10/70*10 ¬ 1.4, so it's 351,4 which is as close as I could get.
    On an interview, however, I'd just say 350 in about 10 seconds. I believe they will be more impressed that I know 35^2 by heart and can answer the question quickly than if I take like a minute to solve it on the paper and give them a more precise answer.
  17. poohat's Avatar
    • Adored and Respected Member
    • Posts: 595
    Re: Interview Question: Square Root of 123456.
    (Original post by miml)
    When you get to 350^2 and see that this is too small, so the square root lies in the interval (350,400). A bisection method would go to 375, not 350. The only reason you go to 351 is because |350^2 - 123456| << |400^2 - 123456| so you know the square root is going to be much closer to 350 than it is to 400. Putting this into an algorithm is a trickier (requires a fair amount of pen and paper work at least) than a bisection method, but it's a lot faster. I suppose this is the crux of the question, and is why they've asked it..
    If you wanted to be efficient then you wouldnt use bisection, you'd interpolate between the values since you know its monotonic increasing, then pick your next guess based on that. A linear interpolation is going to be inefficient (since the square function is nowhere near linear) but its still a lot better than a bisection. If you linearly interpolate between 350^2 = 122500 and 400^2 = 160000, then your next guess for x^2 = 123456 is going to be much closer to 350 than to 400.
    Last edited by poohat; 22-05-2012 at 13:32.
  18. Mize's Avatar
    • New Member
    • Posts: 2
    Re: Interview Question: Square Root of 123456.
    But for me, it took longer (more math steps) to do by linear interpolation than by the babylonian method.
    Would be interesting to know the percentage of people that were able to come up with a good answer...say within 5 minutes.
    If I were the interviewer, I would ask how would you go about finding the answer....and listen....to see how their brain works. If they already knew a set way to do it, I would have a backup question.
  19. Breadster™'s Avatar
    • Peer Of The TSR Realm
    • Location: I live wiv yo mamma
    • Posts: 1,407
    Re: Interview Question: Square Root of 123456.
    (Original post by poohat)
    If you wanted to be efficient then you wouldnt use bisection, you'd interpolate between the values since you know its monotonic increasing, then pick your next guess based on that. A linear interpolation is going to be inefficient (since the square function is nowhere near linear) but its still a lot better than a bisection. If you linearly interpolate between 350^2 = 122500 and 400^2 = 160000, then your next guess for x^2 = 123456 is going to be much closer to 350 than to 400.

    lol owned.
Sign in to Reply
Share this discussion:  
Useful resources
Article updates
Moderators

We have a brilliant team of more than 60 volunteers looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

Reputation gems:
The Reputation gems seen here indicate how well reputed the user is, red gem indicate negative reputation and green indicates a good rep.
Post rating score:
These scores show if a post has been positively or negatively rated by our members.