Amazon Interview Question for Quality Assurance Engineers


Country: United States
Interview Type: Phone Interview




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

public class Engine
{
 	public string manufacturer;
	public float displacementSize;
	public boolean turboCharged;
	public int cylinders
	public int mileCount;
	
}
public class Transmission
{
 	public boolean isAutomatic;
	public int gearCount;
}
public class Wheel
{
	public int size;
	public string manufacturer;
	public string model;
}
public abstract class Vehicle
{
	public String make;
	public String model;
	public int year;
	public int personCapacity;
}

public abstract class WheelVehicle extends Vehicle //bicycle would extend this
{
	public Wheel[] wheels;
}

public abstract class PropelledWheelVehicle extends WheelVehicle //segway could extend this, as could motorcycle
{
	public Engine e;
	public Transmission t;

}
//this is likely the class a car would extend.
public abstract class PropelledWheelVehicleWithDoors extends PropelledWheelVehicle
{
	public Door[] doors;
}
public class Car extends PropelledWheelVehicleWithDoors
{
	
}

- mckeejm July 27, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 3 vote

How about having a basic interface
car {
make
model
year
engine
tires //array of tire objects
move_forward()
move_backward()
turn_left()
turn_right()
}
2_door_car implements car {
left door
right door
}
4_door_car implements car{
left door
right door
back left door
back right door
}
And so on for 2 seater or 4 seater. We can have engine as an interface too that have many different types of engine implementation.

- ambu.sreedharan July 25, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

I think they expect you to use composition (or maybe aggregation) inside car class. Car "has-a" steering system, gear system, engine, etc.

- bibbsey July 28, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

cs.cmu.edu/~adamchik/15-121/lectures/Class%20Design/classes.html

- akie July 25, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

public class Car
{
String Id;
List<Wheel> wheels
Engine engine;
List<Tier> tiers;
List<Attributes> atts;


}

- Anonymous August 03, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This is a very good example of composition.

Having declared each part class separately and then from them composing the car.

- Anonymous October 05, 2013 | Flag Reply


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