Uploaded November 2020 | Updated September 2026, 4 hours ago
This SQL data science interview question was asked by Facebook. Iβll cover both the question and answer and give a detailed explanation of the approach. I walkthrough each step of my answer, assumptions, approach, and explain every line of code I write. This is literally how I would answer every data science interview question and prepare for every data science interview at FAANG companies and others.
Link to question: platform.stratascratch.com/coding/10284-popularity-percentage?python=&utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
This question is marked as hard from Facebook. The question involves manipulating your datasets so that you first are calculating total number of users in the table using a UNION of the two columns. Youβll then calculate the number of friends a user has by also using another UNION. These two queries become subqueries and youβll be using a SQL JOIN ON 1=1. These concepts are what makes the question hard. Once you have the two SQL subqueries, you can implement the percentage formula.. This question covers concepts that are commonly found in data science interviews at Facebook and Google.
______________________________________________________________________
This series is for both beginner and intermediate data scientists and analysts interested in learning how to solve common data science interview questions in SQL. These are real data science interview questions. For some background context and an intro about what this series is about: bit.ly/36kKbxG
π Subscribe to my channel: bit.ly/2GsFxmA
π Playlist for more data science interview questions and answers: bit.ly/3jifw81
π Playlist for data science interview tips: bit.ly/2G5hNoJ
π Practice more real data science interview questions: platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
______________________________________________________________________
Timestamps:
Intro: (0:00)
Interview Question: (0:11)
Exploring The Datasets: (0:44)
Developing The Framework For The Solution: (1:09)
Coding The Solution (Total Number Users On Platform): (4:21)
Coding The Solution (Total Friends): (7:03)
The Trick!: (8:00)
Coding The Solution (Percentage): (9:50)
Trick 2! JOINING 1=1: (10:40)
______________________________________________________________________
About The Platform:
I'm using StrataScratch, a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and python), statistics, probability, product sense, and business cases.
I created this platform because I wanted to build a resource to specifically help prepare data scientists for their technical interviews and to generally improve their analytical skills. Over my career as a data scientist, I never was able to find a dedicated platform for data science interview prep. LeetCode and HackerRank were the closest but these platforms specifically serve the computer developer community so their questions focus more on algorithms that working with data.
So, if you want more interview practice with real data science interview questions, visit platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link. All questions are free and you can even execute SQL and python code in the IDE, but if you want to check out the solutions from me or from other users, you can use ss15 for a 15% discount on the premium plans.
______________________________________________________________________
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
______________________________________________________________________
This SQL data science interview question was asked by Facebook. Iβll cover both the question and answer and give a detailed explanation of the approach. I walkthrough each step of my answer, assumptions, approach, and explain every line of code I write. This is literally how I would answer every data science interview question and prepare for every data science interview at FAANG companies and others.
Link to question: platform.stratascratch.com/coding/10284-popularity-percentage?python=&utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
This question is marked as hard from Facebook. The question involves manipulating your datasets so that you first are calculating total number of users in the table using a UNION of the two columns. Youβll then calculate the number of friends a user has by also using another UNION. These two queries become subqueries and youβll be using a SQL JOIN ON 1=1. These concepts are what makes the question hard. Once you have the two SQL subqueries, you can implement the percentage formula.. This question covers concepts that are commonly found in data science interviews at Facebook and Google.
______________________________________________________________________
This series is for both beginner and intermediate data scientists and analysts interested in learning how to solve common data science interview questions in SQL. These are real data science interview questions. For some background context and an intro about what this series is about: bit.ly/36kKbxG
π Subscribe to my channel: bit.ly/2GsFxmA
π Playlist for more data science interview questions and answers: bit.ly/3jifw81
π Playlist for data science interview tips: bit.ly/2G5hNoJ
π Practice more real data science interview questions: platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
______________________________________________________________________
Timestamps:
Intro: (0:00)
Interview Question: (0:11)
Exploring The Datasets: (0:44)
Developing The Framework For The Solution: (1:09)
Coding The Solution (Total Number Users On Platform): (4:21)
Coding The Solution (Total Friends): (7:03)
The Trick!: (8:00)
Coding The Solution (Percentage): (9:50)
Trick 2! JOINING 1=1: (10:40)
______________________________________________________________________
About The Platform:
I'm using StrataScratch, a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and python), statistics, probability, product sense, and business cases.
I created this platform because I wanted to build a resource to specifically help prepare data scientists for their technical interviews and to generally improve their analytical skills. Over my career as a data scientist, I never was able to find a dedicated platform for data science interview prep. LeetCode and HackerRank were the closest but these platforms specifically serve the computer developer community so their questions focus more on algorithms that working with data.
So, if you want more interview practice with real data science interview questions, visit platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link. All questions are free and you can even execute SQL and python code in the IDE, but if you want to check out the solutions from me or from other users, you can use ss15 for a 15% discount on the premium plans.
______________________________________________________________________
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
______________________________________________________________________






![[Part 1]: Exploring and Visualizing Data For A Facebook Data Science Project of Movie Ratings
Join us as we dive into a data science project from Facebook to predict Rotten Tomatoes movie ratings. We explored two different approaches. In the first approach, we focus on using numerical and categorical features, while in the second approach, we analyze the sentiment of movie reviews. Throughout the video, we compare our models predictions to actual data to evaluate their performance. By the end of this series, youll have a deeper understanding of how Rotten Tomatoes movie ratings can be predicted and gain valuable insights into machine learning techniques. Dont forget to subscribe to stay tuned and learn more about data science.
Watch the full tutorial:
π[Part 2]: Exploring Decision Tree Classifiers For A Facebook Data Science Project of Movie Ratings: https://youtu.be/Ih6G5hnn30Q
π [Part 3]: Random Forest Classifier For A Facebook Data Science Project of Movie Ratings:
https://youtu.be/J4rheMtvu6g
Go to the project through the link below and follow along with meπ
https://platform.stratascratch.com/data-projects/rotten-tomatoes-movies-rating-prediction?utm_source=youtube&utm_medium=click&utm_campaign=YT+rotten+tomatoes+1
π Subscribe to my channel: https://bit.ly/2GsFxmA
π Playlist for more data science interview questions and answers: https://bit.ly/3jifw81
π Playlist for data science interview tips: https://bit.ly/2G5hNoJ
π Playlist for data science projects: https://bit.ly/StrataScratchProjectsYouTube
π Practice more real data science interview questions: https://platform.stratascratch.com/coding?code_type=1&utm_source=youtube&utm_medium=click&utm_campaign=YT+rotten+tomatoes+1
Timeline:
Intro: (0:00βββ)
Take-home assignment: (0:09)
Exploring the data: (1:48)
Summary of the data: (4:53)
Content rating variable visualization: (5:22)
Audience status visualization: (6:40)
Distribution of each audience status category: (7:04)
Take away: (10:03ββ)
About The Platform:
Im using StrataScratch (https://platform.stratascratch.com/coding?code_type=1&utm_source=youtube&utm_medium=click&utm_campaign=YT+rotten+tomatoes+1), a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and Python), statistics, probability, product sense, and business cases.
So, if you want more interview practice with real data science interview questions, visit https://platform.stratascratch.com/coding?code_type=1&utm_source=youtube&utm_medium=click&utm_campaign=YT+rotten+tomatoes+1. All questions are free and you can even execute SQL and Python code in the IDE. Still, if you want to check out the solutions from other users or from me, you can use ss15 for a 15% discount on the premium plans.
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
#datascienceproject [Part 1]: Exploring and Visualizing Data For A Facebook Data Science Project of Movie Ratings](https://i.ytimg.com/vi/cM12QtrhdLo/mqdefault.jpg)


![Tricky Data Science Interview Question [By Facebook]
Today well cover a tricky data science interview question asked by Facebook. Its not so much a tricky problem as it is a problem with a non-obvious solution. But these types of questions are asked all the time on interviews because theyre scenarios that youd have to handle everyday as a data scientist. Lets cover what this questions all about. Follow along with me by going to the question below.
Link to question: https://platform.stratascratch.com/coding/10064-highest-energy-consumption?python=&utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
This series is for both beginner and intermediate data scientists and analysts interested in learning how to solve common data science interview questions in SQL.
π Subscribe to my channel: https://bit.ly/2GsFxmA
π Playlist for more data science interview questions and answers: https://bit.ly/3jifw81
π Practice more real data science interview questions: https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link
Timestamps:
Intro: (0:00)
Question: (1:40)
Exploring the datasets: (2:03)
The 1st trick!: (2:40)
Write out approach: (4:34)
The 2nd trick!: (5:35)
Coding the solution: (6:35)
Conclusion: (10:50)
About The Platform:
Im using StrataScratch, a platform that allows you to practice real data science interview questions. There are over 1000+ interview questions that cover coding (SQL and python), statistics, probability, product sense, and business cases.
So, if you want more interview practice with real data science interview questions, visit https://platform.stratascratch.com/coding?utm_source=youtube&utm_medium=click&utm_campaign=YT+description+link. All questions are free and you can even execute SQL and python code in the IDE, but if you want to check out the solutions from me or from other users, you can use ss15 for a 15% discount on the premium plans.
Contact:
If you have any questions, comments, or feedback, please leave them here!
Feel free to also email me at nathan@stratascratch.com
#sql #datascience #sqlinterviews Tricky Data Science Interview Question [By Facebook]](https://i.ytimg.com/vi/eC7MdwKCCOE/mqdefault.jpg)
