Amazon Interview Question for Software Engineer / Developers






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

Order(id long pk, userId long fk, rentedOn date, returndate date)
payment(id long pk, amount double, paid boolean)
User(id long pk, username string, password string, email string)
user_order(userid long references user(id), order_id long references order(id)) 1:m
order_payment(order_id long references order(id), payment_id references payment(id)) 1:m
Movie(id long pk, name string, year short)
Order_movie(order_id long references order(id), movie_id long pk references movie(id)) 1:m
StarCast(id long pk, name string)
Movie_starcast(movie_id long references movie(id), cast_id long references starcast(id))
role(id long pk, title string)
cast_role(cast_id id fk references starcast(id), role_id fk references role(id)) 1:m

- Amol March 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
3
of 3 vote

@Karthik
As far as my knowledge goes and what I learnt is.. any enterprise application development starts from identifying entities/objects, relationships among them and them map to persistence store.

- Amol March 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

User(id long pk, username string, password string, email string)
Movie(id long pk, order_id fk, title string, year short, genre string, category string)
Order(id long pk, userId long fk, dateOfRent date, dateOfReturn date, active boolean)
Order_Payment(id long pk, amount double, order_id long fk, success boolean)
StarCast(id long pk, name string, movie_id long fk)
Role(id long pk, title string, star_id long fk)

- Piyush June 05, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

employee (empid, name)
disk (diskid, name, in_stock, arrived_date)
rent(empid, diskid, borrow_date, due_date, return_date, client_id, charge, overdue_charge, payment_type, card_type,care_number, .....)

- Anonymous February 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 3 vote

My solution:

Before design the Classes; I would consider designing a database for this system. Once developed, it would obviously simplify the Classes Design [Consider composition, inheritance and delegation]. Consider creating Interface for most of the classes for extensibility. Consider creating Abstract class and inherit methods and properties from it; if there is a code reusage.

The major design patterns to be considered are:
1. Singleton for Processing classes
2. Data Access Objects for Database
3. Plain Old Java Objects for Database
4. Entity Classes for Database
5. Util Classes for Delegation
and there are few I don't know. :)

- Karthik February 20, 2011 | 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