AceTheInterview
Jobs in Pune | Work better in teams | Socialize with friends | Submit Q&A | Tell a friend
Search site for 

Top 100 Interview Questions & Answers in a convenient and easy to read book!

“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”

– Ravi, California

Read more comments...

Interview Questions And Answers RSS Feed

Answers »

  1. Submitted By: xianfeng — October 6, 2006
    +30 votes
      + -

    n<<3 - n = 7n

  2. Submitted By: WILLL — October 6, 2006
    -26 votes
      + -

    N<<3+N=7N

  3. Submitted By: deep — October 6, 2006
    -8 votes
      + -

    this will work only for integers !!
    what about doubles , floats ????

  4. Submitted By: colo — April 26, 2007
    +5 votes
      + -

    deep,
    If interviewer asks you to do this for float or doubles.. you need to say “there is no way except ‘7*N’ “.

    Hope you are happy now.

  5. Submitted By: alchemist_85182@yahoo.co.in — June 29, 2007
    -1 votes
      + -

    Just a correction :

    N

  6. Submitted By: s.v.v.satyanarayana — June 30, 2007
    +0 votes
      + -

    Give a fast way to multiply a number by n.

  7. Submitted By: h — July 18, 2007
    -1 votes
      + -

    deep,

    Depending on the architecture and instruction timings, something like

    const double A = N+N;
    result = (A+A)+(A+N);

    might be faster (4 additions, and maybe two of them can run in parallel) than just doing
    result = N*7.0;

  8. Submitted By: Srikanth — September 30, 2007
    -3 votes
      + -

    7N = N

  9. Submitted By: whisky — October 8, 2007
    +1 votes
      + -

    Assuming binary numbers,
    7 can be broken down as (4 + 2 + 1)
    So the multiplication with x becomes

    x*(4+2+1) giving x*4 + x*2 + x
    Using shift operations and addition, multiplication should be faster.

    I’m not sure about the correctness of this answer though.

  10. Leave an Answer/Comment

    To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
    Click to hear an audio file of the anti-spam word

Our Sponsors
Our Sponsors
Contact Us | FAQ | Sitemap | Terms of Use | Privacy Policy | Tell a Friend

Copyright © 1999-2006 Jeeve Technologies LLC. All rights reserved.