How To Ace Any SQL Interview
How To Ace Any SQL Interview
approach
(& ace) any
SQL interview
Dawn Choo
Data role?
ying for a
Appl
Here is my ultimate
fool-proof approach
for any SQL interview:
Let’s use this interview
question as an example
Interview Question
You work for a social media company. A
post is considered “viral” if it receives
more than 100 likes in the first hour
after posting. Calculate the percentage
of posts made in the last 7 days that
went viral.
Original question
A post is considered “viral” if it receives more than 100 likes
in the first hour after posting. Calculate the percentage of
posts made in the last 7 days that went viral.
Reframed question
We need to analyze posts from the past week to
determine how many went viral. Our definition of
“viral” is any post that got over 100 likes in its first
hour. We'll need to calculate this as a percentage
of all posts made during that time period.
What are edge cases that the query did not catch?
What are edge cases that the query did not catch?
Posts haven't had a full hour to accumulate likes,
which might skew our results.
Repost it