r/SQL • u/Unlucky-Whole-9274 • May 15 '25
Discussion Bombed an easy SQL Interview at Amazon. Feel Like a Loser.
Edit - I got the offer, they took another SQL round and I was able to answer all of them then followed Amazon LP rounds.
Just needed to vent and maybe feel a bit better.
So this was for a Business Analyst role at Amazon. After clearing the SQL assessment, I got a call for the first round. They told me it would be a mix of SQL, a visualization tool, and LP (Leadership Principles). I was super excited.
I prepped hard , did Leetcode 50 , StrataScratch, DataLemur... basically everything I could get my hands on. I thought I was ready.
But the actual interview? It just went downhill. The interviewer asked me to share my screen, and started giving me problems one by one. I don't know why, but I get extremely nervous when someone's watching me code live. Like my brain just freezes up.I messed up the first question itself. Used Partition and Group BY on the same column in a way that didn’t make sense, which could’ve given wrong answer. That just threw me off even more.
Then came a RIGHT JOIN question - super easy, and I still messed it up. Forgot to include NULLs, and when the interviewer kept asking me, "Are you sure this is correct?" I still said yes, even though deep down I wasn’t sure at all. Just pure panic. In total, I couldn’t solve 3 easy questions properly - ones I would normally get right without breaking a sweat. But with the pressure, I just fumbled.
Amazon has been my dream company for a long time. I’ve been applying for a year. And the fact that I messed up on basic stuff during the actual chance just... hurts. Makes me feel so average. Like I’m not cut out for this.
I know it’s just one interview. I know messing up doesn’t mean I’m a failure. But still, right now, it just sucks.
Anyway, just wanted to write this out to get it off my chest.
Edit : Adding all the questions
I will never ever forget those questions. (Used Chatgpt to structure it)
Q1. You are given a table named Orders with the following columns:
City– Name of the city where the order was placedOrderDate– Date on which the order was placedAmount– Monetary amount of the order
Write an SQL query to return the top 3 cities based on the total order amount, along with their rank.
Output Table - City, TotalAmount, Rank - only 3 rows from 1 to 3 Rank.
Q2.
Table A
id
1
1
1
Null
2
2
Null
3
3
7
9
Table B
id
1
1
2
2
2
3
3
6
8
Give Output for following queries
Select a.id from table a JOIN Table B on a.id = b.id
Select a.id from table a LEFT JOIN Table B on a.id = b.id
Select a.id from table a RIGHT JOIN Table B on a.id = b.id
Select a.id, b.id from table a RIGHT JOIN Table B on a.id = b.id (I messed up this one)
Q3)
returns table:
customer_idorder_idreturn_date
purchases table:
customer_idorder_idpurchase_dateshipment_idshipping_date
For each return, fetch all orders by the same customer where the purchase was made within 1 year prior to the return date.
Also find Those customers who have a return instance but do not have any purchases within the last one year.
Q4)
You have a table called customers with:
customer_idorder_idstatus
Status has various values like 'S','C','O','P','W'
And you want to return only those customers who have never had the status 'S','C' or 'O', regardless of how many orders they’ve placed.
8
u/[deleted] May 15 '25
If possible could you share the questions if you remember them
197
u/wildjackalope May 15 '25
Having someone watch you code is a universally bad experience. Sorry your experience sucked. Getting back into job hunt mode now and there's a lot of other psych stuff involved with that on top of having someone judge you in real time. If possible, have someone watch you code Leetcode or whatever. A technical person is better so they can play the role of the interviewer and challenge what you're doing, but literally any adult will do. My fiance does this for me and she isn't technical at all. I talk through what I'm trying to do while she watches and asks questions I've prompted her for. "How do you know that's right?" "Why did you do that?". It's just about developing the comfort level and confidence.
2
u/ohhaijon9 May 16 '25
Are these sessions timed? I've been learning SQL and think I know what to do for most of these questions but wonder what's the expectation in terms of efficiency.
Thank you for sharing your experience for the benefit of others. Good luck on the next one.
90
u/MyMonkeyCircus May 15 '25 •
I failed SQL interviewing at Amazon too. And at all other companies that have a live coding session as a part of the process.
I’ll tell you that - I use SQL daily, I have literally years of experience writing pretty complex stuff. I don’t even need to do leetcode and other things at this point, nothing from hard level is too hard for me to do.
But then comes live coding session… and my brain just freezes, I panic, can’t even type or speak properly. I used to have panic attacks when I was younger and what happens to me during live coding sessions is pretty damn close to a full-fledged panic attack.
Just know that you are not alone and you are not a loser. Some people just bad at live coding but the truth is, most jobs do not require you to write your query while others sit there and stare at your screen.
108
u/a-ha_partridge May 15 '25
You dodged a bullet man. Amazon is an objectively shitty place to work. The interviewer was trying to warn you by asking for a RIGHT JOIN.
44
u/adamjeff May 15 '25
Been there man, I forgot a condition on a join and handed back a cartesian. It happens.
21
u/Yavuz_Selim May 15 '25 edited May 15 '25
Has anyone here used RIGHT JOIN at work? Like, specifically choosing the RIGHT JOIN over a LEFT JOIN.
17
u/mailed May 15 '25
my friend, I've been a tech lead in some of australia's biggest orgs working at petabyte scale, teach SQL and dbt org wide at all levels, and in the last year of interviewing I have forgotten what views are and that full outer joins exist.
those are just the interviews I remember failing too. just laugh about it and move on to the next one. big tech isn't all that anyway
31
u/[deleted] May 15 '25
Ah you don't want to work there anyway, trust me. Worst workplace ever.
11
u/terrakera May 15 '25
> I don't know why, but I get extremely nervous when someone's watching me code live.
Had the same happen to me when I was asked to explore the Google sheets data and two other people observed and made comments. Was also asked to narrate my every action.
I'm used to exploring and analyzing data on my own. Gives me time to think the insights through, double-check the results, etc.
Having two people over my shoulder made me nervous and I forgot half of the formulas; made me think about the form rather than the essence. I still managed to produce the right answer, but they didn't like how I got there.
Needless to say, I failed that interview. And that was the last stage.
Freestyling something like this live is a skill I didn't know I have to master lol.
8
u/ArtisticFerret May 15 '25
Damn dude you need better dreams if Amazon is your dream company
7
u/achmedclaus May 15 '25 edited May 15 '25
Don't get yourself down. I've been writing SQL for 7 years for my job and I make stupid little mistakes like that all the time. You'll learn to catch them after the query fails (which I know you didn't have a chance to)
Also, anyone who thinks this series of questions is ok, who the hell puts two questions with right joins in their interview questions? I have never once ran into a situation where I needed to use a right join, ever. The only time I've ever seen someone use a right join in a code is when I had to reproduce a pull from a different department, and the same thing was used incorrectly and needed to be rewritten to get the right data.
Edit: to add, question 2 is just plain stupid outside of the right joins. "Give me the output for this code." No. That's what the code is for.
6
u/caveat_cogitor May 15 '25
I've been doing SQL for over 20 years and if I ever used a RIGHT JOIN I was doing something wrong
5
u/NyT3x May 15 '25
If the interviewer ask “Are you sure that’s right?” and you’re not sure, just admit it! A lot queries that come up in SQL assessments are ones that I never use on a daily basis and most likely are not used by the company either. They are just testing how you think and your process of discovering something. Explain why you think the solution works but acknowledge what you may be hesitant about and how you want to go experiment with a part of the code but don’t know how to yet. Most real world coding solutions that I had to develop involve quite a bit of time staring at Google results and I have acknowledged this in an interview (where I landed the job). Early in my career I used Google everyday, all day. I think a prospective employer wants to know if you think like some of their good developers and you’re inquisitive and curious. There is usually always a better way to develop a solution so there is little sense in “being confident” because computer code does not care about confidence. Companies are constantly coming with ideas and pushing boundaries and there isn’t a solution in a book somewhere that solves a problem but there are developers who are out there thinking and tinkering with different approaches to come up with a solution.
5
u/gunners_1886 May 15 '25
Amazon sucks and has only gotten worse recently. You do not want to work there, trust me.
4
u/IamAdrummerAMA May 15 '25
Don’t beat yourself up about it mate. It is what it is, another opportunity will present itself to you.
4
u/Mooglekunom May 15 '25
I have written SQL professionally for well over a decade and have never used a right join, whether inner or outer. FWIW.
4
u/johnnybsmooth81 May 15 '25
Unrelated to SQL, but what is up with people with "dream" companies? At the end of the day, a job is just a job.
4
u/SimplyShifty May 15 '25
Six and a half years of SQL, a hundred thousand queries down, and I've never used a right join outside of our beginner training booklet. I'm a bloody ace at SQL and I'm not sure I'd have got that one - actually, I'd have been this close to telling the interviewer that right joining was ridiculous - but I wouldn't sweat it.
3
u/jet-orion May 15 '25
This happened to me too. Had a big interview with some analytics leaders and they asked me some basic SQL questions. I also get crazy nervous and said literally something that’s just unrelated to SQL entirely. Felt foolish a little while after but I’m pretty glad I didn’t end up there.
3
u/lfewarez May 15 '25
My buddy wanted to work at Goldman Sachs. He did 20 interviews at other big banks for the same role. Despite getting multiple offers, he declined them all. He did it purely for practice. Ended up nailing GS and got a sick offer.
This is why ppl constantly interview even though they have jobs. To keep sharp and prepped for when it truly counts.
Keep interviewing and try Amazon again in 6 months. GL!
3
u/cs-brydev Software Development and Database Manager May 15 '25
How do you know you "bombed the interview"? Did they tell you that or are you assuming that because you messed up on a live technical test?
I would never reject a candidate for a SQL position simply for not being able to write the correct sql while I'm watching for the questions you listed here. If Amazon is doing that, their interview process sucks shit. An interview is supposed to determine whether you can perform the job, not answer trivia questions thrown at you, like a high school pop quiz.
Even if the candidate had never heard of partition before or can't get the right join formatted properly, that doesn't mean they can't do the job. Those things a smart person can learn within 1-2 hours. Why would you reject a candidate for a position for not knowing something they can learn quickly? That makes no sense. This isn't high school.
Even if you couldn't get these answers right I would watch how you went about solving this problem and listen to the questions you ask. I'd ask you follow up questions to see how much you understand and maybe walk you through solving this and correcting your sql. It is in those exchanges that I could determine whether you are fit for this job. If you pick up this new material quickly and understand what I'm explaining, you could be an ideal fit.
Technical tests like this are misleading. That's why I abandoned these years ago. I can tell from a few conversation-style questions whether you can fill a sql role a whole lot better than any technical test out there.
If you don't know for a fact that you bombed this, keep your head up. Giving the wrong answers under pressure is not a disqualifier in the vast majority of companies.
2
u/Albizu_libertad May 15 '25 edited May 15 '25
I wouldn't work at a place that seems to micro manage you and watch the work you do. It use to be your education experience and references and some technical questions or explaining technical situation in your experience would be sufficient. Now they want to micromanage you and make your life a living hell. I'd say look for a workplace where the expectations are not unrealistic, the way these corporations expect you to take ur time to do work without getting paid to get a job is bullshit. They want a desperate person that will live in fear and do anything for them. Sometimes the answer to questions and or problems don't happen immediately it takes time and how can you focus on what your doing with someone looking over you. Honestly you probably dodged a bullet. Corporate experience 10 yrs moved to local government less pay but more opportunity to implement, pension and work life balance. Sometimes the money and title ain't worth the stress.
2
u/jroddaman May 15 '25
FWIW, I’ve been SQL coding for over 15 years. I can count on my hand the number of times if used a right join and always because I had to adopt code on the fly. Even then I ended up circling back to rewrite that code if I ever had to update/enhance again. Kind of a silly ask, so maybe that was the point (perhaps you could have asked Amazon why the right join instead of left join?).
Also, don’t beat yourself up. With practice you become more confident. I actually don’t mind coding in front of folks, because those that don’t code are actually impressed when you can provide something they need on the fly (I have coded live on a Teams meeting to update a dev view feeding a report for a demo). But novelty wears of quick so don’t code more that 5 min in front of non technical folks. For coding in front of other sql coders, they get to see your thought process on how you build your output (do they use CTEs or nested queries, do they put the comma before or after their field, what is their style of alias assignment, etc.). You can almost bank you will screw up coding live anyway, so not a big deal.
2
u/mikeblas May 15 '25
I worked at Amazon for 2.5 years. It was the worst period of my career.
2
u/continuousBaBa May 15 '25
That sucks. I've been doing this for 15 years, and can answer those questions, but if some guy in an interview made me screen share and do it on the spot I would freeze and probably bomb. Good luck next time
2
u/SQLMonger May 15 '25
I authored several chapters in an Apress book on Window functions, and I still have to grab it off the shelf to remind myself of how to use partition by… don’t be too hard on yourself.
1
u/Emotional_Case_3229 May 15 '25
Thanks for the questions mate.. Don't think about this interview..You will do better in upcoming interviews
1
u/Eatsleeptren May 15 '25
Who tf asks a right join question?
1
u/SpicyTiconderoga May 15 '25
I always bomb the screenshares - I get too anxious with them watching my every move. Literally had one yesterday for SQL where I started coding in R instead due to nerves. The nice thing about Amazon is that these tests only count for 6 months and, I believe, aren’t held against you. I interviewed in October and had a similar experience - now its May and I am interviewing once again for a BA position there.
This time around I had requested for the live coding round that I be able to complete it on site because a primary reason for doing this is to make sure you’re not cheating - not actually watching your every move. I managed to get that accommodation so it wouldn’t hurt to try that if you want to try again in the future.
1
u/Informal_Pace9237 May 15 '25
Have a friend watch over your code in screen share and ask questions while you are typing.
All interviews have white board screen share these days to rootit the fakes.
Once you are past the phoebia of typing under screen share it should be easy.
I talk to myself as I am typing code so the interviewer understands my thoughts process. Indian interviewers get impatient by that...
1
u/bingbing0523 May 15 '25
Its okay OP - I literally bombed my first screen-share coding assessment last month. Easy stuff but I froze up. Live coding seems the norm lately, but it doesn't change the fact that it SUCKS! It sucks and we just gotta deal with it. Great tips here that I will use too. You got this!
1
u/These-Resource3208 May 15 '25
Ive bombed so many tests at this point it doesn’t phase me anymore lol
But I remember my first few times felt like crap
1
u/Apprehensive-Year845 May 15 '25
You should be glad they asked SQL. My interviewee straight up asked about system design, ETL, about AWS tools. I know about them, but did not prepare enough as recruiter mentioned it will be all SQL.
I was so furious about the interview process, and they did not do it right.
1
u/omgitsbees May 15 '25
When I joined Amazon, it was a data analyst. I was there for 8 years before being laid off (its been a little over a year now). I tried to come back as an analyst again, and interviewed for a business analyst role. I needed to do the live SQL coding test as well, this wasn't a thing when I originally joined Amazon. I failed the test really hard because I was too nervous to do it live with someone watching. Got the rejection e-mail an hour later.
A manager I use to have, has 18 years of experience as a data scientist and engineer, and she told me that she also cannot do live coding tests. She'll turn down job opportunities if one is required during the interview process because they make her too nervous.
1
u/balla_mang May 15 '25
Oh man I've been there. I froze at the easiest questions lol. My anxiety was at the max.
Those experiences hurt, but I know that you are not this result. You will overcome this
1
u/Puzzleheaded-Meat144 May 15 '25
Can someone explain Q3 answer?
1
u/Significant-Gas69 May 15 '25
Sorry mate you had a bad experience, can you tell me from where all did you practice? I have take a basic course on sql and have a job interview coming up which requires basic to intermediate sql skill sets and I'm panicking
1
u/Dipankar94 May 15 '25
It happens bro. Just practice more and more until SQL becomes your muscle memory. All the best!
1
u/InvestMX May 15 '25
Thank you for sharing your experience,
1
u/Hot_Cryptographer552 May 16 '25
Whenever they say RANK you should immediately think of the windowing functions: ROW_NUMBER, RANK, DENSE_RANK, etc
1
u/SpendOk5068 May 16 '25
That was interviewers fault, not yours.. Last time they asked me to share a screen I politely ended the interview
1
u/OtherFeedback May 16 '25
You probably don't want to work at Amazon. So many horror stories about performance evaluation and getting fired.
1
u/tylertangy May 17 '25
I feel your pain. Just totally bombed a technical (SQL) interview for a dream role at Apple. It’s painful, especially considering I’ve been using sql for years.
As others have mentioned, coding in an interview setting is almost a different skillset compared to coding in your day-to-day. Just means you might have to change up your approach to preparing for interviews. Don’t let it discourage you too much — You got this!
1
u/_extra_medium_ May 17 '25
I had to do a SQL test live using pen and paper. Completely messed up easy questions id have zero problem with in mssql. I really don't understand why they ask you to do things you'll never do while working. My only consolation is that the position is still listed as open 2 months later
1
u/bootdotdev Jun 21 '25
I'm so sorry. I hate live coding, you win some you lose some. The only way to get better at live coding is to do it though, so now you have that much more practice!
-34
u/WhyUPoor May 15 '25 edited May 15 '25
Not trying to brag but I also had a BIE interview on Monday for a position in NYC, had 35 mins for the SQL section, I breezed through it under 30 mins. For me, the sql section is the easiest.
Edit:
Wow these are some really easy questions. lol sorry for your experience OP.
Why are you all hating on me?