Amazon Interview Question for Quality Assurance Engineers


Team: Kindle
Country: India
Interview Type: Written Test




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

Ask what type of values can be passed to Grade function.
If its in string format, then we need to Parse the values to Int.
If its a string format, then it can be null or empty or can have spaces in between.

Test data to test function Grade(ObtainedMarks, TotalMarks):
1. Boundary conditions.
Test each individual grades for their boundary conditions.
i.e MarksObtained = 0, 40, 41, 60, 61, 80, 81 and 100, assuming that TotalMarks = 100.
If total marks != 100, then change the values to test those Percentages.

2. Negative conditions.
MarksObtained = -10, total marks = 0.
This will cause divide by Zero Exception.

3. Invalid conditions:
Marks obtained = 110. Total Marks = 100.
Passing alphanumeric or special characters.

4. All possible combination of numbers of a number scale. i.e negative values, zero and positive values for both the parameters, MarksObtained and TotalMarks.

- undefined September 21, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

var obtainedMarks = 20;
            var totalMarks = 40;
            var gradeCalculation = 100*(obtainedMarks/totalMarks);
            var result = string.Empty;

            if (gradeCalculation >= 0 && gradeCalculation <= 40)
            {
                result = "D Grade";
            }
            else if (gradeCalculation >= 41 && gradeCalculation <= 60)
            {
                result = "C Grade";
            }
            else if (gradeCalculation >= 61 && gradeCalculation <= 80)
            {
                result = "B Grade";
            }
            else if (gradeCalculation >= 81 && gradeCalculation <= 100)
            {
                result = "A Grade";
            }
            else
            {
                result = string.Empty;

}

- Anonymous September 26, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

const int obtainedMarks = 20;
            const int totalMarks = 40;
            var gradeCalculation = 100*(obtainedMarks/totalMarks);
            var result = string.Empty;

            if (gradeCalculation >= 0 && gradeCalculation <= 40)
            {
                result = "D Grade";
            }
            else if (gradeCalculation >= 41 && gradeCalculation <= 60)
            {
                result = "C Grade";
            }
            else if (gradeCalculation >= 61 && gradeCalculation <= 80)
            {
                result = "B Grade";
            }
            else if (gradeCalculation >= 81 && gradeCalculation <= 100)
            {
                result = "A Grade";
            }
            else
            {
                result = string.Empty;
            }

- gunjan.prmr September 26, 2016 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Test Data for grade:
-1,0,1,40,41,59,60,61,65,80,81,99,100,101

Exteme Conditons:
-1111111111111111111111111111111111
99999999999999999999999999999999999

- geeknanda13 May 22, 2017 | Flag Reply
Comment hidden because of low score. Click to expand.


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