Amazon Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
0
of 0 vote

binary search of z*z*z = X

- Anonymous June 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

can u plz explain more ??

- kumar June 20, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I havn't verifed this code!

int qroot(int x) {
  int a=0,b=x,r;
  for (;;) {
    r = (b + a) / 2;
    int t = r*r*r;
    if (a==b) return r;
    if (t<x) a -= (b-a)/4;
    else b += (b-a)/4;
  }
}

- AL June 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Can you share the source or the name of the algorithm?

- King@Work June 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

float qroot(float x) {
float a=0,b=x,r,i=0;
for (;i<1000;i++) {
r = (b + a) / 2;
float t = r*r*r;
if (a==b) return r;
if (t<x) a=r;
else b=r;
}
return r;
}

- atul October 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

binary search :)

- AL June 21, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Use Newton Raphson Method. As this is what i think the interviewer is looking for.

- Nascent Coder June 22, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

int findCube(int x)
{



}

- addi October 19, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

int exponent=3;
int pow( int base,int exponent)
{
if (exponent == 0) return 1; // base case;
int temp = pow(base, exponent/2);
if (exponent % 2 == 0)
return temp * temp;
else
return (base * temp * temp);
}

- addi October 19, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

ok its not cube...it cube root..sorry for above code

- addi October 19, 2011 | Flag


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More