Facebook practice guide
Stay inside one business context for a few reps in a row while still working from the same live bank used across practice, tracks, and reviews.
Explore 13 Facebook-tagged SQL scenarios focused on aggregation, filtering, joins.
Context, not signal
Company labels help frame practice in a familiar business context. They are directional study aids, not official interview guidance from the companies listed.
Sign in to track progress while you browse this guide.
Questions
13
Estimated prep time
255 min
Progress tracking
Sign in to track progress
Concept focus
The most common patterns in the current Facebook-tagged set.
Aggregation
9
Filtering
9
Joins
6
Date functions
2
Mix at a glance
Use the difficulty and path mix to decide whether you want fundamentals, breadth, or stretch reps.
Suggested rhythm
Start with the easiest scenario in the set, then move upward while tracking accuracy and retry speed. This keeps the context stable while the difficulty rises.
Suggested next scenarios
The next best reps from this company-tagged set based on what you have not solved yet.
Facebook Pages and Likes Analysis
Practice joins through a Facebook-tagged business scenario.
10. Difference between BETWEEN and IN operators
Practice filtering through a Facebook-tagged business scenario.
9790 Number Of Processed Complaints
Practice aggregation through a Facebook-tagged business scenario.
Question list
The current Facebook-tagged list with learning objectives and your latest status.
Facebook Pages and Likes Analysis
Assume you're given two tables containing data about Facebook Pages and their respective likes (as in "Like a Facebook Page"). Write a query to return the ID...
Practice joins through a Facebook-tagged business scenario.
10. Difference between BETWEEN and IN operators
BETWEEN is used to select rows that match a range of values, whereas the IN operator checks for values in a specified list of values. For example, to find ca...
Practice filtering through a Facebook-tagged business scenario.
9790 Number Of Processed Complaints
SELECT type, COUNT(complaint_id) FILTER(WHERE processed='TRUE') AS processed_complaints, COUNT(complaint_id) FILTER(WHERE processed='FALSE') AS non_processed...
Practice aggregation through a Facebook-tagged business scenario.
10088 Liked Posts
SELECT COUNT(DISTINCT p.post_id) as n_posts_with_a_like FROM facebook_posts p JOIN facebook_reactions r ON p.post_id = r.post_id and r.reaction = 'like'
Practice joins through a Facebook-tagged business scenario.
9789 Find The Total Number Of Approved Friendship Requests In January And February
SELECT COUNT(*) as n_approved FROM facebook_friendship_requests WHERE date_approved BETWEEN '2019-01-01' and '2019-02-28' -- NOTE: solved on first attempt
Practice aggregation through a Facebook-tagged business scenario.
Closed Account Ratio
Use this Facebook scorecard to work on closed account ratio. The account integrity team wants the share of accounts that were closed on 2020-01-10. Return on...
Practice aggregation through a Facebook-tagged business scenario.
Average Employee Popularity By Location
Facebook wants a scorecard for average employee popularity by location. The workplace insights team wants to compare employee survey popularity by office loc...
Practice joins through a Facebook-tagged business scenario.
Posts With Heart Reactions
At Facebook, analysts are preparing a scorecard focused on posts with heart reactions. The engagement team wants the full post records for posts that receive...
Practice joins through a Facebook-tagged business scenario.
34 Email Table Transformation
-- Each Facebook user can designate a personal email address, a business email address, and a recovery email address. -- Unfortunately, the table is currentl...
Practice aggregation through a Facebook-tagged business scenario.
01 Active User Retention
-- Assume you're given a table containing information on Facebook user actions. Write a query to obtain number of monthly active users (MAUs) in July 2022, i...
Practice aggregation through a Facebook-tagged business scenario.
2081 Recommendation System
-- Problem Statement: -- You are given the list of Facebook friends and the list of Facebook pages that users follow. Your task is to create a new recommenda...
Practice joins through a Facebook-tagged business scenario.
9777 Successfully Sent Messages
WITH success_or_not as ( SELECT ms.message_id, CASE WHEN mr.message_id IS NOT NULL THEN 1 ELSE 0 END as receive_success FROM facebook_messages_sent ms LEFT J...
Practice joins through a Facebook-tagged business scenario.
9793 Average Time Between Steps
WITH step_differences AS ( SELECT feature_id, user_id, step_reached, timestamp, LEAD(timestamp) OVER (PARTITION BY feature_id, user_id ORDER BY step_reached)...
Practice aggregation through a Facebook-tagged business scenario.