Amazon Interview Question for Software Engineer / Developers






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

select C1.* from customer C1 where C1.birth_date in (select min(C2.birth_date) from customer C2);

- m@}{ April 20, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

select c1.name from customer c1 where c1.dateOfBirth = (select min(c2.dateOfBirth) from customer c2)

- ash.388235 April 21, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

the question was oldest and not eldest. Put the clause for AcctOpenDate rather

- Ankush April 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

What if there are few customers with the same dateOfBirth ?

- m@}{ April 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

I still did not get it. Why are we to worry about dob column. Say I, age 24 open acct in Bank on Aug-07-2001 and Mr. B, age 50 open acct on jan-01-2009. I shall still be the oldest customer and not the eldest as the question asks for. Plus to it if it happens that there are more than one people opening the acct on the same date and are of same age, the timestamp data type shall help returning the one who has opened earlier.

- Ankush April 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

SELECT * FROM your_table WHERE register_date IN(SELECT MIN(register_date) FROM your_table)

- Anonymous April 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

you are rigth ankush. i didn't understand problem properly.

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

select last(date_coulmn,customer from table...isn't it it will return oldest entery according to date..correct me if m wrong

- Algoseekar April 25, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

SELECT * FROM Customers WHERE age=(SELECT MAX(age) from Customers);

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

nada, try to follow the discussion before giving your great answers..

- anon August 21, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

hahahhahaha

- lilalu August 29, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

SELECT TOP 1 from Customer Order BY CustomerID

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

select C1.* from Customers C1 where not exists( select 1 from Customers C2 where C2.age > C1.age)

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

select name from customer where a=min(customer ID);
I think this query will fetch the right data from the table

- sss January 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

you are correct..

- Anonymous June 14, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

No. Fetching the oldest customer based on customerId seems incorrect to me.
This condition may fail when we have data from two different bank/retail outlet recently merged. (real world scenario)
From my point of view. account open date should be right field to find the oldest customer as mentioned in few of the earlier post.

- pcy February 08, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

select top 1 customer_name,age from customers order by age desc

- sri.cs.nitw July 24, 2014 | 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