Goldman Sachs Interview Question for Software Engineer / Developers






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

I am making below assumptions

1)Customer( CustomeID,Fname,Lname)
2)Order(OrderID,CustomerId)

Final query is "Select * from order where CustomerId in ( Select CustomerId from Customer where Lname like '<input_from_user>' )"

- Amit April 20, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I hope this way also it will work.


select * from Customer C , Order O where C.CustomerID=O.CustomerID and C.CustomerLastName='Das'

- Mohan November 11, 2009 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

I think it is better to re-write the above subquery to a standard outer join.

Select * from order, customer where order.customerid = customer.customerid and customer.Lname like '<input>'

- webchic April 20, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

how would you track order ? we need order table as well.

- Amit May 04, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Aslo need to have inventory table. It is needed to check if the goods is avaialbe or not.

- Anonymous May 09, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1) Customer(CustId, FName, LName)
2) Inventory(InvId, Item)
3) Orders(OrderId, CustId)
4) Order_Items(OrderId, InvId)

SELECT * 
FROM customer c JOIN orders o ON c.custId=o.custId
JOIN order_items oi ON oi.OrderId=o.OrderId
JOIN inventory i ON oi.invId=i.invId
WHERE c.LName=:lname;

**NB: Breaking Order_items into a separate table to prevent a many-to-many relationship. For interview, this is probably not necessary

- Tazzy July 15, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Create Table Customer
( Customer ID
Customer First Name
customer last Name
Customer Address
)

Create Table Inventory
(
ProductID
ProductName
ProductQuantity
)

Create Table Order
(
OrderID
ProductID
ProductName
QuantitySold
Date
CustomerID
)


select * from Customer C , Order O where C.CustomerID=O.CustomerID and C.CustomerLastName ='Das'

- Mohan November 11, 2009 | 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