## Amazon Interview Question for Quality Assurance Engineers

Country: United States
Interview Type: Phone Interview

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

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

int result=1;
int powerofNumber (int num, int power)
{
if (power==1)
return result;
result=num*powerofNumber(num,power-1)
}

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

really @@@ this question ?

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

public class XpowerOfY
{
public static void main(String args[])
{
int x,y, pow=1;
Scanner in = new Scanner(System.in);

System.out.println("enter the value of x");
x = in.nextInt();
System.out.println("enter the value of y");
y = in.nextInt();

for(int i=0;i<y;i++)
{
pow = pow * x;
}

System.out.println("x power of y= "+pow);
}
}

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

TC1 : Input->x,y values->Invalid data->Input
TC2 : Input->x,y values->valid data->x power y->Display value->end

Automation scope : TC2 needs to be automated based on x and y input combinations.

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

TC1: x and y are 0
TC2: x is positive and y is negative
TC3: x is negative and y is positive
TC4: x and y are positive
TC5: x and y are negative

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

As an Automation Tester, concentrate more on data :
1. A Function will be build where this function will supply the input values x & y to the API / Program and captures the response from the API / Program.
2. once the response is captured. compare the expected outcome with the actual outcome, by calling the respective API / Program, say Test data is residued in Spread sheet .
3. Frame all Positive, Negative, Boundary, Exceptional conditions are covered as input in the Spreadsheet.

Here are few scenarios:
Positive
1. x = positive integer , y = negative integer, outcome = valid response
...

Negative
2. x = non numeric number, y = postive integer, outcome = invalid response (Error message)

Exceptional;
3. x = 0, y =0 , Outcome = invalid response (Error message)

Boundary / Memory Leak;
4. x= Big positive integer, y = Big Positive integer, outcome = invalid response (Error message)

Rounding the outcome
5. x= postive integer, y = Big Negative integer, outcome = Response with rounding the decimal value

and many more scenarios like:
1. if x, y are irrational like, i = sqrt(-1).
2. x = character, y = integer...............

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.

### 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.