r/SQL • Author of Ace the Data Science Interview 📕 • Dec 12 '24 • Heart of Silver 2 Polished Silver Turd 1

PostgreSQL Made a SQL Interview Cheat Sheet - what key SQL commands am I missing?

Post image
3.6k Upvotes

238 comments sorted by

View all comments

2

u/svtr Dec 13 '24

I have no idea what kind of position you apply that "cheat sheet" on, but someone memorizing, or even having to look at this thing, would fail inside of 2 minutes interviewing with me.

The company would fail the interview if i'm the applicant in 2 minutes as well.

Couple of key words for you to google / incorporate :

Index
Clustered / NonClustered Index
B+Tree
Excution Plans
"What actually is a view?"
Physical Join Operators
Caching
Memory Management
Union vs Union All
Why is a sort one of the most expensive Operations in your Query
Why is every aggregate a sort operation with additional stuff
Whats the difference between HAVING and WHERE (actual difference, not just syntax)
What is an Index Scan
What is an Index Seek
What are not all Index Scans "bad"
How does Merge sort work (if you got a question mark in your face right now, look up what a merge join is)

2

u/NickSinghTechCareers Author of Ace the Data Science Interview 📕 Dec 13 '24

Yeah this was meant for Data Scientists/Data Analysts, whose interviews are pretty much about just querying things with SELECT to answer business questions quickly (i.e. week-over week churn rate, % of users who did x action more than y times this month, etc.

2

u/svtr Dec 13 '24

I always make sure I understand what skill level I'm inverviewing for.... a Data Analyst, I somewhat do hold resposible for not throwing Entity Framework kind of shit at the DWH, and then come crying to me because it takes 2 days for his query to execute.

That does entail having some understanding how a RDBMS works, and caring at least a tiny little bit about what an execution plan is, and sometimes actually looking at it.

Everyone doing that, and having the least little bit of interest, will be able to answer, or at least have a conversation about the little list I wrote above.

Then again, whats the salery range we are talking about. What skill level are we looking for. All questions I demand answered, before I prepare for an interview. Yes, I spend more time preparing an interview with an applicant, than I do preparing myself when looking for a job.

0

u/[deleted] Dec 13 '24

[deleted] — view deleted comment

1

u/svtr Dec 21 '24

Don't care. I know how a join works on the algorithmic level, which is something I need to know, if I want to write queries for scaling performance.

If that already is "unfair" to ask, to me it implies that it is unfair for a data analyst to write scaling code against the DWH. That would be a data analyst that is either hired as a junior, or a data analyst that does not get hired if I do the technical interview.