Blog

Ace your data science interview

Practice real questions asked during interviews at top companies
no spam. unsubscribe at any time.

How we'll prepare you

Sample a data science interview question

Sign up for our free newsletter to receive the answer

This question was asked by Facebook.

Given a users table and a user_comments table, write a SQL query to generate a histogam of number of comments per user in the month of January 2019. Assume bin buckets intervals of one.

`users` table
columns type
id int
name varchar
joined_at datetime
city_id int
device int
`user_comments` table
columns type
user_id int
body text
created_at datetime
ready to compare your answer?
see the solution

People who landed jobs with our help

Join premium today

Get access to detailed solutions for all questions

sign up for premium
We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. You consent to our cookies if you continue to use our website. 🙅 disagree ✅ consent