14 Comments

I've been asked to solve a "n-th highest salary" problem without using a WINDOW function.

Solution:

1) a first CTE with ordered salaries in descending order limit to n row. (e.g. if it's the 3rd highest salaries then LIMIT 3)

2) Another CTE reversing the order of the above one limited to the first row. (LIMIT 1)

note: it only works if there are no rows with duplicated salaries

note2: LIMIT and OFFSET weren't allowed

Expand full comment

If LIMIT is not allowed in steps 1 and 2, you have used LIMIT. Is this something wrong in my understanding

Expand full comment

In the screener interview part, in the bullet point about CTE’s. You have “It’ll help you maintain readability while also” - did you mean to write something here?

Expand full comment

Lemme edit that. I meant while also keeping your thought process clear

Expand full comment

On point and very helpful! This goes in my archives that I need to read up before DE interview. Thanks Zach

Expand full comment

Awesome article. Is there a version for Python interviews?

For instance, is there methods to review in Data Structures and Algorithms?

Expand full comment

I’ll be publishing an article on this in coming weeks!

Expand full comment

Is Pandas considered acceptable, or is SQL format the only option for interviews?

Expand full comment

Just SQL

Expand full comment

Thank you for this! I'm a recent graduate and currently interviewing for an entry level Data Engg role. How much of this would likely be included in my tech interview for an entry level role? Which skills/concepts should I focus on? I'll really appreciate it if you could give some advice. Thank you so much!!

Expand full comment

Super concise!

Expand full comment

There should be something like neetcode for these type of stuff, but for SQL. That is, it is kind of pointless to practice extensively on SQL exercises unless you learn what fundamentals you learn from each exercise. I think your blog article is going somewhere, but its all crammed together to digest these stuff. We really need a neetcode, but for SQL. That is, practice, practice, practice. Repeat them again until you get it. There is nothing that can replace in the end to yield the results of your practice with real pet projects and work experience.

Expand full comment

Hello Zach! Thank you for sharing this! 🙏 It would be great if you could share your guidance about System Design interviews. They’re not so common for data engineers comparing to SWEs, and there are not so many guides related to Data Engineering System Design in the internet. Thank you in advance!

Expand full comment

Great brief, especially on solving without window functions when there is a direct use of window functions. This often gets missed

Expand full comment