Interview Question for Nones


Country: United States
Interview Type: In-Person




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

The field in Customer_branch are cust_id and branch. What is branch is it branch_id or branch_nm.

The query according to me should be:

SELECT cust_id from Customer_Branch CB, Deposit_branch DB
LEFT JOIN Bank_Branch ON CB.branch_id = BB.Branch_id
AND CB.cust_id = DB.cust_id

- Sameer August 03, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

I dont see Branch id in deposit_branch. How join condition works here ??

- Sriharsha August 23, 2019 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

To find out the customers who made deposits in all the branches in a given city is not just possible without the date range though assuming that branch_id is IFSC code.

- anonymous August 06, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Something like this:
select DB.Customer_Id, count(*)
from Bank_Branch BB
left join Deposit_Branch DB on BB.Branch_NM = DB.Branch_NM
where BB.city = 'city'
and DB.Deposit_date = 'Date'
and DB.Branch_NM IS NULL
GROUP BY DB.Customer_Id
HAVING count(*) = 0

- Andrew August 14, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

select cust_id,count(distinct branch_name) from deposit_branch group by cust_id having count(cust_id) = (select count( distinct branch_id) from bank_branch)

åHere total count of branch id should match with the count for the cust_id

- Sriharsha August 23, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

select cust_id,count(distinct branch_name) from deposit_branch group by cust_id having count(cust_id) =
(select count(distinct branch_id) from bank_branch)

Here distinct total count of branch id should match with the distinct count for the cust_id in depostit_branch

- sriharsha.vemuri31 August 23, 2019 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

select cust_id,count(distinct branch_name) from deposit_branch group by cust_id having count(distinct branch_name)= select count(distinct branch_name) from bank_branch

- Anonymous February 29, 2020 | 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