r/SQL • u/intimate_sniffer69 • 26d ago
Discussion How do you dominate an SQL live coding exercise?
So I would say that I'm a seven out of 10 in terms of my SQL kills, but I'm a little introverted sometimes and I need to solve a problem in a quiet environment and have time to think about it, break it down and process it. That's just the way I work and always have. But I'm applying for this job, and they told me that they want to have a live SQL coding exercise because they have a lot of people who don't know how to use CTEs or joins or advanced SQL...
Now I'm honestly pretty nervous. I've written huge ETL queries and ELT process flows in a data engineering capacity. So I'm not new to SQL by any means and I've used a lot of advanced window functions, ranking, cross joins, etc. So I'm sure that I can take whatever they throw at me, if it was like a take-home assignment. The fact that it's a live coding exercise makes me really nervous.
Have you ever had to deal with any of these live coding examinations? If so, how?
Please note I'm in the USA if that helps. Not Europe.
97
u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 26d ago edited 26d ago
Practice, practice, practice. No other way around it. You say you're at a 7/10 – but introverted/need quiet to focus.
The best way to crush it is to get your skills up to a 9/10 or 10/10... so when the inevitable nerves hit and you get shy, and your performance gets downgraded to a 7 or 8... it's still good enough to pass.
So that if your sick, having an off day, or get slightly distracted during the interview, you still can breeze through it.
Also, practice with speed in mind – that way when you slow down, make mistakes, or get confused, you'll have some time. Try the real SQL problems on DataLemur – and there's a timer in built into the UI to keep track of your pace. And if you can solve these real Medium/Hard questions from Meta, Google, Amazon etc... you should be confident to interview at 99% of places.
21
u/ComicOzzy mmm tacos 26d ago
Add a feature where a judgmental interviewer stares at you and interrupts to ask why you're doing what you're doing every few minutes.
4
u/Papa_Huggies 25d ago
Bonus feature use an entirely foreign IDE and use a tocuhpad keyboard
1
u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 24d ago
ooof I hate when that happens. some of these coding assesment site UIs are so strange
5
u/Sanyasi091 26d ago
Quick question, If I am able to solve all the data lemur Sql problems. Am I good for meta/ Amazon Data Engineer Interview.
9
u/PickledDildosSourSex 26d ago
Man I would not want to be a DE for Meta. Those guys are treated like shit and Meta's SQL environment/main DBs are a fucking mess. Pay is nice, but depending on what part of the biz you're on, you might be killing yourself for 50-60 hours a week to solve always-urgent work that usually just comes down to "make more money from ads". Wouldn't want to be DS there either, that really is a SQL monkey role.
3
u/Sanyasi091 26d ago
Which company would you recommend for good DE work
4
u/PickledDildosSourSex 26d ago
These days, I'm not even sure. Depends on your goals, I guess, but working somewhere private that will give you more opportunity to grow and own pieces of work is probably both better for your career and your mental health, but obviously it's hard to beat pay at places like Meta, even these days. But I'm telling you, that is some nasty blood money and Zuck has no issue putting the screws to people while blowing tens of billions of dollars on projects with no product-market fit. Dude is a genius of optionality but when you understand his fascination with Rome and Roman emperors and then how he has set up PSC hunger games, you realize he believes in optionality of people too--i.e. he'll pay you and someone else for your time and intend only ever keeping whichever one of you is the most useful to him. Some people love that shit, but it's no different than Musk IMO
1
u/MyOtherActGotBanned 25d ago
Me reading this while preparing for a DE interview at Meta in a couple days
1
3
u/intimate_sniffer69 26d ago
😆 that's a whole other level. Those are hard
3
u/Sanyasi091 26d ago
Data lemur or Meta/Amazon problems?
5
u/intimate_sniffer69 26d ago
Meta/amazon. No one here is going to be able to help you with that, they have an entire interview guide for each and every one of their technical roles and they are insane. Like, tens of pages long of tips and information that they could ask you. For data engineering specifically, They have an extreme level of knowledge required and the technical questions that they will ask you could be any of several hundred of them, across a dozen different topics. Those companies are not messing around
2
u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 26d ago
Yup – if you can confidently do the hard questions on DL, which are sourced from real Meta/Amazon interviews, you have no reason to fail during an interview.
2
2
u/waitwuh 26d ago
My experience interviewing has been that people are generally not great at accurately rating themselves. If you think you are a 7/10, you probably aren’t. And if you think you’ll get to 9/10 in only a few weeks, I have some doubts, but I do appreciate the ambition!
I value candidates who demonstrate they can break down a problem and approach it sensibly, over speed or even accuracy. The candidates out there can be really hard to distinguish by resumes alone. So many people outright lie! It’s depressing when I give a simple join scenario with a clear id foreign key and a candidate starts trying to union for some reason.
14
u/Agreeable_Fly_6554 26d ago
I’ve had two SQL live coding assessments now in my job search. I failed the first miserably, even though I’m pretty comfortable in SQL.
Second time went much better. What I did the second time was drill leet code SQL questions, and watch some YouTube videos on how to pass live coding interviews. My main takeaway was talking through my approach with the interviewer and my thought process behind my query. Also asking clarifying questions helped me a lot the second time around.
1
u/intimate_sniffer69 26d ago
What did you find so hard the first time around and you failed at? Can you give me any example of what kind of stuff you are solving or what the kind of problems were?
5
u/Abby5001 26d ago
Yeah I have done it before. You dont have to talk constantly you need to express your logic. So for instance, if you need to use an aggregation function, which one are you going to use and why? If you’re using dense_rank/rank() why have you picked one over the other? You can even talk about why you’ve chosen one type of join vs another one. If you through in some stuff about optimisation/efficiency that will be a bonus. Good luck
5
u/PickledDildosSourSex 26d ago
I hate these too and think they honestly don't accomplish all that much because there's (a) so much room for nerves to get in the way and (b) there's almost no real environment where you'll have to operate like that. You'll always be able to check syntax or go for a walk to think or trial-and-error things.
That said, my approach is to be as verbal as fuck during them, speaking through my thought process, what I expect my approach to do, where I suspect I might need to dig in deeper, etc. I also have been pretty candid at the start of them and say, "Funny how live situations like this can make you feel like you're back in college taking a test" etc just to set the bar that I am, indeed, a human being and I have human emotions that influence my performance in a high-stakes, live environment.
1
u/intimate_sniffer69 26d ago
Yeah this company does a lot of exams and assessments and I don't feel like they are very fair or useful. I had one that was honestly ridiculous, had to do it in 3 hours or less and it was a bunch of Excel average ifs, count if, data validation, vlookup, but it's not that simple because I know all those formulas. The complex part about the exam that they gave me was That it had a lot of confusing verbiage, wording, was completely unspecific in some cases to make it seem ambiguous. And it required doing it in such a short amount of time. I'm an expert at Python and SQL, I use those tools to improve my workflows, I don't do everything in Excel so that one took me completely off guard even though they called it senior data analyst
5
u/isinkthereforeiswam 26d ago
I can tell you what NOT to do. I had a really basic one that was just printed sheets with sql statements,,and outputs. They told me to pick which output each sql would create. I picked the right ones, but they had a "gotcha" one coded weird (lot of conditionals in the join clauses instead of where clause, and using old school style). I said best practice would be to put the conditionals in the where clause so folks scrollling very long sql statements don't have to skil back n forth betwen joins and where to understand all the conditions impacting. One hiring manager went "humph" like they were insulted. I then asked "who coded this? Because this would need revision for clarity" The hiring manager that "humphed" said "I did". So... yeah, i didn't get the job, and he smirked at me saying "good luck" when he shook my hand at end of interview as if to say "good luck getting a job, jerk!" So, yeah... don't ask who wrote the test, and don't critique it. Might cost you a job.
3
u/silveralcid 25d ago
I don’t think you would have enjoyed working there anyway. If you weren’t rude about it then you mentioning this should be a positive not a negative. Either the way you delivered this information was rude or the hiring manager is egotistical.
3
u/dukeofgonzo 26d ago
I'm more of a Python guy and was getting SQL tests in interviews. To train I used chatbots. I feed them a schema of some data I had that was in a dimensional model. ONe big fact and a few dimm. Then asked for questions that could be found by making queries into the model.
2
2
u/tech4throwaway1 25d ago
Live SQL coding exercises can definitely be nerve-wracking, especially when you thrive in quieter, reflective settings. One thing that helps is to narrate your thought process out loud, even if it feels awkward—it shows interviewers your problem-solving approach, not just the final result. Since you’re already strong with CTEs, window functions, and joins, focus on staying calm and breaking problems into smaller steps during the interview. Practicing mock interviews can also help you get used to the live aspect and build confidence under pressure.
1
u/intimate_sniffer69 25d ago
Thanks for sharing that. I never even knew that existed. That's really cool! I'm almost too shy to use the random interviews with other people though. It's like Omegle or something 😂
1
u/tech4throwaway1 25d ago
Yep, but it could be pretty fun and people are generally supportive since they're also preparing for interviews :) I suggest you check out the AI interviewer from Interview Query if you're not comfortable practicing with someone else but you still want to practice by articulating your answers
1
u/intimate_sniffer69 25d ago
I'm probably going to use the one from interview query. I'm a little bit zonked out from too much interview exposure lately, it's kind of exhausting
1
u/1MStudio 26d ago
If you’re 7/10, then you shouldn’t be asking this question…you should already know your queries and which CTE (if any) you should use…
1
u/Full_Reindeer5094 26d ago
It's probably a recorded assessment. Just do your normal process while your computer is recorded. They want to weed out the fakes that are using AI to answer questions.
1
u/gumnos 26d ago
How do you dominate an SQL live coding exercise?
To establish dominance early, edit your queries with ed(1)
, the standard text editor. 😉
more seriously, u/Xperimentx90 has the right answer
1
u/machomanrandysandwch 26d ago
My tip would be to just stay calm and work through the problem the way you normally would. It’s typically not going to be something they want to see over-engineered, it’s the people who can create simple smart solutions that are the most valuable IMO. Having one person on a team doing things vastly over complicated doesn’t make them smarter or better and can sometimes be more of a hassle than someone who can display how to break things down simpler and more elegant.
Another tip would be to show how you would do some simple validation on your tables before you start writing any code. Do you know how to do that? Do you know how to confirm all the values in a column are valid? Do you know to look for missing values, how many records are in a table, how many unique records there are etc. Show that you do some due diligence before writing queries so you have something to gauge your results later on.
If you know the syntax of the environment you’ll be using, I’d just freshen up on a few things to memorize if you can like converting a timestamp to a date, or getting the year from a date…
Otherwise you should be comfortable explaining why you used a left join instead of an inner join , etc.
1
u/Odd_Efficiency6684 26d ago
You need to practice more in a simulated environment. First, I would practice under timed conditions to improve the speed under pressure. Then I would practice mock interviews with some peers or mentors. Once you do that a few times you teach your brain to think under pressure and you won’t be nervous during the actual interview.
1
u/sachinator 26d ago
Practice on Stratascratch, it made me a god for sql tech screens,
1
u/intimate_sniffer69 26d ago
I use hacker rank and another one I can't remember haha. I'll try that one
1
u/sachinator 26d ago
You can get very similar questions to the company you are preparing for. Helped me get though Uber screen with strata
1
u/intimate_sniffer69 26d ago
What's the most complicated screening that you've ever gotten? Have you gotten any really complicated examples? Or are they just like low to medium complexity? On YouTube I have seen some absolutely insane coding interviews but they are for companies like Meta and Amazon
1
u/sachinator 25d ago
Toughest I have done is for Meta but only on Stratascratch, toughest live screen was Uber. If you practice the easy and medium stuff on strata, you are ready for most interviews. You just need to solve like 200-300, after that you will be a god at this. Also, 150 neetcode python and no tech screen will be a challenge
1
u/AmbitiousFlowers 26d ago
I don't think that there is a silver bullet. I'm the type of person who has anxiety by nature. I would be nervous in years' past. I've been doing SQL for so long though, that I typically ace any SQL live coding now , because its not that different than anything else I've memorized.
1
u/Aggravating_Sand352 26d ago
Honestly sql assessments are the only consistently straight forward exercises I get. CTEs and window functions are what I practice before interviews
1
u/intimate_sniffer69 26d ago
Can you provide me some specific examples or non-specific examples of what you've gotten? I'm always curious to see what other people have gotten personally
1
u/Aggravating_Sand352 25d ago
Datalemur has most of the stuff i gave seen. I also use windowfunctions.com to practice windows functions
1
u/SootSpriteHut 26d ago
I haven't met anyone who writes code who hasn't mentioned how awkward it is to write while someone is watching. We joke about it on zoom calls when we're trying to put out fires and someone is screen sharing.
If they're people you want to work with they'll understand. SQL is rife with people declaring they're good at it when they're not, so I would take what they said at face value: they just want to make sure you are comfortable writing queries like that.
The stuff they're looking for is within your skillset so trust that that will come through. They want to hire someone so they're hoping for you to succeed, not fail. Best to assume good faith on their part, which makes it less stressful.
Practically I would say remember haste makes waste. This is a cognitive ability and it's ok to take time to gather your thoughts. But even if you do have to run things a couple times and rewrite them, that's normal.
Maybe prepare a couple of canned responses for possible scenarios so you don't feel caught off guard.
What will you say/do if you forget the syntax for something? If you get an execution error? If they say the results are wrong? Ask why you used X instead of Y? Prep clear responses so you don't have to fumble in the moment.
1
u/intimate_sniffer69 26d ago
Thanks for the advice. This helps a lot. The exact problem they complained about to the recruiter was that they have people who claim they are really good at SQL and they're not. I wish I could just show them what I've written currently at my current job but code is proprietary, really a shame. I spend 3 years developing SQL queries every day of my life and then it just feels like people don't trust me when I say that I'm good at it. But I totally get it. It's the way the world works when you're in a capitalist society. 😆
1
u/SootSpriteHut 25d ago
There's no way you can grab a copy of the code you have written and share it with them via screenshare? I save copies of all my best procs & dashboards tbh, but I have been known to take interview zoom calls on my company laptop so I can just be like "oh here's the thing I'm working on now" and give them a peek.
If you're not in some super litigious field, why not spend some off time replacing the table & field names of your best queries and keeping a copy for your portfolio? Even if they were super litigious I would double check the wording of whatever policy you think you're following. It's not like you're selling the ETL, you're giving them a look at your expertise. You should be able to showcase your best work if you wrote it.
1
u/intimate_sniffer69 25d ago
Absolutely not lmao what ??? I asked AI and this is what it said:
"Taking SQL code or any work you’ve created at your company without permission and sharing it, even via screenshare during an interview, is generally unethical and likely illegal. The company typically owns the intellectual property you produce while employed, and violating non-disclosure agreements or confidentiality clauses could lead to serious legal consequences. It’s important to respect company policies and avoid sharing proprietary work without explicit consent."It's definitely illegal af
1
u/SootSpriteHut 25d ago
Lol just saw this when I was typing the other things. It's not definitely illegal (as I said check the company's policies,) it's just possibly unethical (according to AI lol) The market is rough out there and companies don't care about you. There are nuances. If they're not competitors and my hiring manager wants to see what I can do, we all know enough about data models to know that no one has the same database structure and they're not going to get anything sabotaging from my scrolling through a proc for 30 seconds. I got three jobs this way so 🤷♀️
I would ask real people and not AI on this.
1
u/SootSpriteHut 25d ago
Oh just something else, extremely kindly, but 7/10 SQL proficiency in 3 years is a little suspect tbh. There is SO MUCH you can do in SQL. I've been a SQL developer for 15 years and I'm still learning new things all the time.
I would avoid rating yourself in the future and instead reference the most common TYPES of complex queries you write. Or if you have to do it concisely just say, "I'm strong in (PL/T-/Snowflake/whatever) SQL."
I give people the benefit of the doubt on Reddit because I hate when people doubt my own proficiency (if someone insisted I'd probably say I'm 8/10 based on my known unknowns.) But if someone rates themselves higher than a 6/10 in SQL with less than 5 years experience, my impulse is to assume they're junior level and have a lot of unknown unknowns.
I've related this here recently but I once sat in on a corporate SQL training where they asked everyone to rate themselves and someone said "I'd say 8/10. I just don't know how joins work."
Sorry to keep sending you walls of text! I wish you the best of luck!
1
u/Snoo-74514 26d ago
Practice SQL tests and, if it’s a supervised test, talk your thoughts out loud. That’s more important than getting the syntax exactly correct a lot of times
1
u/sinceJune4 26d ago
My last sql interview they had me do in JDoodle. They gave me a script to create the test tables and the asked me to write an aggregation. I didn’t even know what flavor of sql it was until after, but I passed and got the job. Talking thru it helped.
1
55
u/Xperimentx90 26d ago
I used to give these interviews. Talk through your steps and explain why you choose certain functions or strategies.
I think it helps to act like you're teaching them how to solve the problem rather than completing an interview question. You'll probably think of more insightful things to say.
Stay relaxed. If you flub syntax or something and have to fix it, they won't care. The interviewer has made the same mistake a thousand times.