meta-sql-interview-1

Meta SQL Interview Questions

Leslie B.

Leslie B.

Leslie is an ex-FAANG+ writer for Big Tech Interviews and mentor. She's loves to learning new programming languages and calls Austin, TX her home.

Introduction

Meta which started out as a college networking app has developed and acquired over 94 other companies including WhatsApp, Instagram, and Messenger. It boasts of over $117B in revenue and $165B of assets in management. 

The Meta interview process is one of the most difficult interviews in the tech industry. You should expect fairly ambiguous questions and scenarios that will test your past experience and technical skills using languages like SQL and potentially python. This article will take a closer look at what it takes to pass the Meta interview for analyst, business intelligence analyst, data engineers, and data analyst. 

Most Common Meta/Facebook Interview Format

Round 1: Recruiter phone screen

Overview

The recruiter phone screen is primarily focused on qualifying you as a candidate. On rare occasions, the recruiter will also ask you a few SQL interview questions, but the majority of the interview will be focused on understanding why you applied for the role, compensation expectations, and background. 

Duration: 15 to 30 minutes

Most common Meta/Facebook behavioral questions

  • Tell me about yourself?

  • Why do you want to join Meta?

  • Why did you apply for this job?

Most common Meta/Facebook SQL questions
  • What is the difference between a UNION and a UNION ALL?

  • How would you explain how window functions work to a non-technical person?

Most common Meta/Facebook product/case questions
  • How would you determine the best friends across Facebook users? 

Round 2: Technical screening

Overview

Meta’s technical assessment is primarily focused on testing your SQL and product sense capabilities with various Meta SQL interview questions and challenges. It’ll also potentially include Python, system design, machine learning (ML), and statistics-related questions if you’re interviewing for a data engineer, data analyst, or data science role. Fair warning, this is one of the most common places candidates get rejected. It won’t be an easier interview and you’ll need ample preparation to pass this round. It’s not uncommon for candidates to schedule this technical interview 2-3 weeks from their previous round in order to fully prepare. 

Duration: 45 to 60 minutes

Most common Meta/Facebook technical questions
  • Meta SQL interview questions

    • Count the number of users for each disable_reason in the past 7 days?

  • Meta Python interview questions* 

    • Given list [a,b,c,a,b,c] Please create a function that returns percentiles. 

      • Where each a b c are different

      • Each a is lower bound

      • Each b is upper bound

      • Each c is count

  • Meta Product/case questions
    • What’s the problem with people having too many friends on Facebook? 

  • Meta Statistics questions*: 

    • How would you use the Bayesian Theorem to solve this confidence interval? 

 

* Depending on your role you will have Python, product sense, and potentially Statistics. Check with your recruiter to be sure. 

Round 3: Full loop (3 to 5 back-to-back interviews)

Overview

The final round of your Meta interview will consist of 3-5 senior to senior manager level employees who’ll challenge you with SQL, probability/statistics, product sense, and culture-related questions. I recommend you prepare similar to a product manager interview except without the focus on behavioral or leadership-related questions. 

 

Duration: 135 to 225 minutes

Most common Meta/Facebook behavioral questions

  • Tell me about a time when you had an idea you proposed was not agreed on.

  • Describe a time when your project failed.

  • When you didn’t have enough resources, how did you deliver products?

Most common Meta/Facebook SQL questions
  • Write an SQL query to find the average daily percentage of emails that get removed after being reported as spam, rounded to 2 decimal places.

  • Write an SQL query to report the client_id and client_name of clients who have spent at least $100 in each month of June and July 2019. Return the result table in any order.

  • Write an SQL query to find the ids of items that are both dietary and reusable. Return the result table in any order.

Most common Meta/Facebook product/case questions
  • What would you do if you see a drop in time spent on Facebook?

  • How would you make the decision to roll out a new product or not? 

  • How would you evaluate the negative impact of a new notification release?

Most Common Meta/Facebook SQL Concepts

Joins and Unions

Joins 

  • INNER JOIN: Returns all rows from multiple tables where the join criteria is met.

  • SELF JOIN: Returns combined rows from the same table. It is a situation where each row is attached to itself and other rows in the same table.

  • LEFT JOIN: Returns all rows from the left table, and the matching rows from the right table.

  • RIGHT JOIN: Returns all rows from the right table, and the matching rows from the left table.

  • CROSS JOIN: Returns the Cartesian product of rows from the tables in the join. Said differently, it combines each row from the first table with each row from the second table.

Unions

  • UNION: Returns the combined results with no duplicate rows of two or more SELECT statements.

  • UNION ALL: Returns the results of two or more SELECT statements without removing the duplicate rows. 

  • INTERSECT: Returns the rows that are common to all the tables in the query.

  • EXCEPT: Returns the rows in the first that are not in the second query.  

Aggregating and Grouping Data

Beginner SQL Aggregations

  • AVG: Returns the average of a column in the query.

  • COUNT: Returns the number of items of a column in the query.

  • MAX: Returns the maximum value of a column in the query.

  • MIN: Returns the minimum value of a column in the query.

  • SUM: Returns the sum of all or distinct values of a column in the query.

Intermediate SQL Aggregations

  • DENSE_RANK: Returns the rank of a row in an ordered group of rows and returns the rank as a NUMBER. 

  • RANK: Returns the rank of a value in a group of values. The rank is one plus the number of rows preceding the row that are not peer with the row. Unlike DENSE_RANK, values that are the same in the ordering will produce gaps in the sequence.

  • ROW_NUMBER: Returns a unique, sequential number for each row, starting with one, based on the order of the rows in the window partition.

  • LEAD: Returns a row at a specified physical offset which follows the current row.

  • LAG:  Returns the previous rows data as per defined offset value.

Advanced SQL Aggregations

  • STD SAMP: Returns the sample and population standard deviation of a set of numeric values (integer, decimal, or floating-point).  

  • STDEV: Used to calculate the Standard Deviation of total records (or rows) selected by the SELECT Statement.

  • REGR_COUNT: Calculates the linear regression coefficient for the count of pairs of x and y values where x and y are not null. 

  • CUME_DIST: Returns the cumulative distribution of a value in a group of values. The result is the number of rows preceding and including the row in the window ordering of the window partition divided by the total number of rows in the window partition. Rows with the same values in the ordering will evaluate to the same distribution value.

Filtering & Ordering Data

Filtering Data

  • WHERE: Used to filter records into rows before they are grouped. The data should specify or meet the mentioned condition, for example WHERE = PRICE > 365. 

  • HAVING: Used to filter the record from the groups based on the specified condition.

  • LIMIT: Restricts how many rows are returned from the results.

  • DISTINCT: Used in conjunction with the SELECT statement to remove all the duplicate records and returns only unique results.

Ordering Data

  • ORDER BY ASC: Used to return the results in ascending order.

  • ORDER BY DESC: Used to return the results in descending order.

Subqueries and Common Table Expressions (CTEs)

Subqueries

  • SUBQUERY: Used as query within another SQL query and embedded within the WHERE clause. This is also called INNER query OR NESTED query.

Common Table Expressions (CTEs)

  • CTE: Returns the results of a query which exists temporarily and for use only within the context of a larger query. It cannot be used in other queries even within the same session.

meta-sql-interview-0

The Business Analyst Meta/Facebook Interview

Overview of Business Analyst at Meta/Facebook

  • Compensation:

    • Salary range: $100,000 to $132,000 USD*

    • Bonus: to $6,000 to $17,000

    • Equity: $5,000 to $25,000

  • Responsibilities: 

    • Lead the development of reporting, and insights to amplify the performance of teams such as sales, finance, or marketing. 

    • Own project optimization, lead prioritization, forecasting, or a variety of other domains supporting various teams.

    • Provide business requirements and collaborate with internal teams on data capture strategy that will support accurate reporting and insights on sales patterns and consumer behavior.

    • Define key performance metrics.

    • Create reports and self-service dashboards to provide ongoing insight to business stakeholders, support leadership in making effective, analytically driven, and strategic decisions.

    • Perform ad-hoc and in-depth analyses and then report/present insights.

    • Automate reporting via SQL and Python-based ETL framework.

  • Qualifications: 

    • BS Degree in Business, Economics, Statistics, Mathematics, Applied Mathematics, Finance, and other quantitative areas.

    • 3+ years experience in sales/business reporting/analytics.

    • Experience with visualizations and dashboards.

    • Experience in querying and manipulating technical concepts and analysis implications clearly to varied audiences and to translate business objectives into actionable analyses.

    • Experience working independently and as a member of a cross-functional team.

Round 1: Recruiter phone screen

Overview

Similar to the standard recruiter phone screen, the recruiter is focused on qualifying you as a candidate before moving you on to the next round. It’s typically 30 minutes and a great opportunity for you to get a better understanding of the role and why they’re hiring for it. Occasionally, analysts will report they were asked SQL or product sense questions in this round albeit it’s fairly rate. If you’re worried you’ll have a technical screen during this portion of the interview, ask your recruiter. 

Duration: 15 to 30 minutes

Most common Meta/Facebook behavioral questions

  • Why do you want to work at Meta?

  • How do you comfortable with SQL and Python?

  • Name one thing on your resume that you are proud to have worked on/contributed towards?

Most common Meta/Facebook product/case questions
  • Instagram stories have gone down by 10%, how would you diagnose the root cause of this?

Round 2: Technical screening

Overview

Meta SQL interviews for business, product, or operations analysts are fairly similar as the core focus surrounds testing your SQL skills with advanced experience with data manipulation. For example, you’ll need to know how to effectively use SELF JOINS, HAVING, and WINDOW FUNCTIONS. Additionally, you’ll have the option to solve the questions using Python as well. It’s worth mentioning, that Meta is notorious for having fairly ambiguous SQL questions. It’s important that you remain calm and walk your interviewer through logic and assumptions. I’d recommend practicing this technical assessment round with a friend and speaking out loud as you answer the questions before your next interview.

Duration: 45 to 60 minutes

Most common Meta/Facebook technical questions
  • Meta SQL interview questions

    • What are the top five (ranked in decreasing order) single-channel media types that correspond to the most money the logistics startup has spent on its promotional campaigns?

    • Of sales that had a legitimate advertisement, the head of finance wants to know what % of transactions occur on either the very first day or the very last day of a promotion campaign.

  • Meta Python interview questions* 

    • Write a function to return the number of times a character appears in a string. The character can be the empty string.

  • Meta Product/case questions
    • How would you design a new feature for Facebook?

 

* Certain analyst roles will not test your experience with Python.

Round 3: Full loop (3 to 5 back-to-back interviews)

Overview

The final round of your Meta analyst interview will consist of 3-5 Meta employees ranging from entry to senior level. There will be a mix of technical, product, and behavioral interviews. Expect to go deeper with experience with SQL, probability/statistics, product sense, and culture. Make sure to come prepared with relevant examples that relate to the role you’re interviewing for and to stick with the STAR format.

 

Duration: 135 to 225 minutes

Most common Meta/Facebook behavioral questions

  • Why do you want to join Meta? 

  • Describe yourself in 3 words.

  • What problems do you think Facebook faces with security?

  • What interests you about this role?

Most common Meta/Facebook SQL questions
  • Can you explain to me what linear regression is?

  • What percent of all products in the logistic startup catalog are both low fat and recyclable?

  • The COO is interested in understanding how the sales of different product families are affected by promotional campaigns. To do so, for each of the available product families, show the total number of units sold, as well as the ratio of units sold that had a valid advertisement to units sold without an advertisement, ordered by increasing order of total units sold.

Most common Meta/Facebook product/case questions
  • We’re launching a new ads feature, how would you define the success metric? 

  • How would you decide if we should swap the launch of ads with a new e-comm panel? 

  • How would you create and validate a recommendations feed? 

 

meta-sql-interview-1

The Data Engineer Meta/Facebook Interview

Overview of Data Engineer at Meta/Facebook

  • Compensation:

    • Salary range: $100,000 to $132,000 USD*

    • Bonus: to $10,000 to $20,000

    • Equity: $30,000 to $100,000

  • Responsibilities: 

    • Partner with leadership, engineers, program managers, and data scientists to understand data needs.

    • Lead, influence, and set direction on domain areas as a subject matter expert to drive complex solutions for strategic problems.

    • Design, build and launch extremely efficient and reliable data pipelines to move data across a number of platforms including Data Warehouse, online caches, and real-time systems.

    • Educate your partners: Use your data and analytics experience to ‘see what’s missing’, identifying and addressing gaps in their existing logging and processes.

    • Leverage data and business principles to solve large-scale web, mobile, and data infrastructure problems.

    • Contribute to shared Data Engineering tooling and standards to improve the productivity and quality of output for Data Engineers across the company.

    • Actively mentor and identify rising talent, and serve as a positive leader across the scope of the organization.

  • Qualifications: 

    • Bachelor’s degree in Computer Science, Computer Engineering, relevant technical field, or equivalent practical experience.

    • 7+ years of Python development experience.

    • 7+ years of SQL experience.

    • 5+ years of experience with workflow management engines (i.e. Airflow, Luigi, Prefect, Dagster, Digdag, Google Cloud Composer, AWS Step Functions, Azure Data Factory, UC4, Control-M).

    • 7+ years experience with Data Modeling.

    • Communications skills.

    • Experience understanding requirements, analyzing data, discovering opportunities, addressing gaps and communicating them to multiple individuals and stakeholders.

    • 7+ years experience in custom ETL design, implementation, and maintenance.

    • Experience working with cloud or on-prem Big Data/MPP analytics platforms (i.e. Snowflake, AWS Redshift, Google BigQuery, Azure Data Warehouse, Netezza, Teradata, or similar).

Round 1: Recruiter phone screen

Overview

Similar to the standard recruiter phone screen, the recruiter is focused on qualifying you as a candidate before moving you on to the next round. It’s typically 30 minutes and a great opportunity for you to get to better understanding of the role and why they’re hiring for it. Occasionally, analysts will report they were asked SQL or product sense questions in this round albeit it’s fairly rate. If you’re worried you’ll have a technical screen during this portion of the interview, ask your recruiter. 

Duration: 15 to 30 minutes

Most common Meta/Facebook behavioral questions

  • Why do you want to work at Meta?

  • How do you comfortable with SQL and Python?

  • Name one thing on your resume that you are proud to have worked on/contributed towards?

Most common Meta/Facebook product/case questions
  • Instagram stories have gone down by 10%, how would you diagnose the root cause of this?

Round 2: Technical screening

Overview

Meta technical interviews for data engineers consist of two sections that primarily focus on SQL and Algo-related questions. I’d recommend you start with whichever section you feel most comfortable with as it will build your confidence and buy you time to solve the more difficult section. You can expect 3-5 questions in the interview that may contain multiple parts. Your data engineer experience will be put to the test as you’ll be tested over advanced SQL concepts such as ETL, window functions, cross-joins, data modeling, and more. It’s worth covering that Meta loves to test candidates over ambitious questions that require the candidate to make logical assumptions. It’s important that you practice out loud with a friend solving SQL and Algo questions before your next interview. 

Duration: 45 to 60 minutes

Most common Meta/Facebook technical questions
  • Meta SQL interview questions

    • What are the top five (ranked in decreasing order) single-channel media types that correspond to the most money the logistics startup has spent on its promotional campaigns?

    • Of sales that had a legitimate advertisement, the head of finance wants to know what % of transactions occur on either the very first day or the very last day of a promotion campaign.

  • Meta Python interview questions* 

    • You do have two sorted array: A = [1,2] B = [3,4,5,x,y]

The size of last part of array B – [x,y] is the same size of A always. You have to replace the last part of B with A and Sort B

Expected Result : [1,2,3,4,5]

Here are the restrictions for the solution, they need to be done with two conditions, these restrictions are mandatory for your solution acceptance.

  1. You can’t create a new array for computation and inline computation need to be done.

  2. You can’t use any inbuilt method to sort.

  • Meta Product/case questions
    • How would you design a new feature for Facebook?

 

* Certain analyst roles will not test your experience with Python.

Round 3: Full loop (3 to 5 back-to-back interviews)

Overview

The final round of your Meta analyst interview will consist of up to 6 Meta employees with the last round a chance to get to know the team/hiring manager and will not be included in the candidate evaluation. The onsite will contain the following interviews,

 

  • Meta SQL and python interview

  • Meta strategy and partnership interview

  • Meta behavioral interview

  • Meta SQL coding interview

  • Meta product sense/case interview

  • Hiring manager meeting 

 

Duration: 135 to 225 minutes

Most common Meta/Facebook SQL and python questions

  • Write a function to count the number of times each character appears in a string and rewrite the string in that format. Eg. “I am back.” should become “i1 2a2m1b1c1k1.1”

  • Match all words in a document against a name dictionary and anonymize them using a hash.

  • What is the performance difference between union/union all?

  • What is the priority of building a data pipeline?

 

Most common Meta strategy and partnership interview

  • After the launch, we found that the UK ads revenue has decreased, but the US has increased. What should we do?

  • We’re considering launching a new partnership that will require either an in-house or outsourced data solution, which would you pick and why? 

Most common Meta/Facebook behavioral questions

  • Why do you want to be data engineer at Meta?

  • Describe the project you’re most proud of and why?

  • Tell me about a time you encountered a challenge?

Most common Meta/Facebook ETL questions
  • Design a table schema for this data to be used by data scientists to query metrics such as process with max average elapsed time and they can plot each process.

  • Design an ETL in python to load data to the above data model /table.
    • How to optimize the process to parse the file and load it to the table. Can it be done with constant memory?
    • There can be multiple machines m0..mN, and each machine can have millions of process entries. How you will scale.
Most common Meta/Facebook product/case questions
  • How do you measure Facebook Group’s health?

  • How do you evaluate its impact? What metrics will you use, and why?

  • Let’s say you were in charge of posts at Facebook. How would you think about this space and what new features or products would you launch and what old ones would you consider deprecating?

 

meta-sql-interview-1

The Data Analyst Meta/Facebook Interview

Overview of Data Analyst at Meta/Facebook

  • Compensation:

    • Salary range: $125,000 to $160,000 USD*

    • Bonus: to $15,000 to $25,000

    • Equity: $20,000 to $60,000

  • Responsibilities: 

    • Build new analytics and reporting capabilities to support program evaluation and operations

    • Handle ad hoc reporting and analytics requests, while addressing stakeholder long-term needs and driving insights for Human Resource Partners and Executives using existing dashboard, Human Resource Information System (HRIS) data, and leveraging our people data ecosystem

    • Effectively communicate with cross-functional partners and internal teams to deliver solutions in a timely fashion

    • Proactively manage stakeholder expectations, manage escalations and resolve issues in a timely manner

  • Qualifications: 

    • 4+ years of experience working with SQL or relational database

    • 2+ years of experience with data visualization tools (e.g., ggplot2, Tableau)

    • Experience initiating and driving projects to completion with minimal guidance

    • Experience working in a fast-paced and demanding environment

    • Experience having effective conversations with clients about their support needs and requirements, managing the intake process, and asking the right questions to scope and solve the requests

    • Demonstrated judgment and discretion when dealing with highly sensitive people data and business issues

Round 1: Recruiter phone screen

Overview

The recruiter phone screen primarily focuses on your background, past experiences, and why you applied to Meta. They also potentially ask you technical SQL concepts during this round. Their main focus is to screen you for any red flags before you move onto the next round. Additionally, this is a great opportunity for you to ask the recruiter about the culture and logistics of the role. 

Duration: 15 to 30 minutes

Most common Meta/Facebook data analyst behavioral questions

  • Why do you want to work at Meta?

  • Tell me about your current role in analytics?

  • Tell me about a time you automated an otherwise manual process?

  • What’s your experience using BI tools?

Most common Meta/Facebook data analyst SQL questions

  • Would you use union or union all if there were no duplicates?

  • Does creating a view require any storage in a database?

  • When would you not want to use a window function?

Round 2: Hiring manager screening

Overview

The hiring manager phone screen will be behavioral-based and a time for the hiring manager to assess your skill set and background for the role. It typically lasts 30-60 minutes and will be a good opportunity to gain a better understanding of the team, management style, and culture. 

Duration: 30 to 60 minutes

Meta behavioral interview questions
    • Why this role at Meta?

    • Tell me about a time you started an analysis with certain expectations, and then got unexpected results?

    • How would you measure X? Can you propose a plan to monetize from Y?

Round 3: Onsite interview (3 to 5 back-to-back interviews)

Overview

Congrats! You’ve made it to one of the hardest rounds. If you can pass this then you’ll be looking good. The technical round will involve primarily SQL and occasionally python, check with your recruiter to be sure. The technical interview will also include an open-ended case where you’ll be assessed on how you analyze the case, make a hypothesis, and validate it. The case can touch on a number of things like ETL, data modeling, KPIs, reporting, etc. 

The final round of your Meta analyst interview will consist of 3-5 Meta employees ranging from entry to senior level. There will be a mix of technical, product, and behavioral interviews. Expect to go deeper with experience with SQL, probability/statistics, product sense, and culture. Make sure to come prepared with relevant examples that relate to the role you’re interviewing for and to stick with the STAR format.

Duration: 135 to 225 minutes

Most common Meta/Facebook behavioral questions

  • Why do you want to join Meta? 

  • Why do you think privacy is important?

  • What are you like at work?

  • Tell me about a time you had a conflict with a coworker? 

Most common Meta/Facebook SQL questions
  • Given a table of users and whom they sent friend requests to, what is the average number of friend requests sent in the last week?

  • Over the last 7 days, how many users made more than 10 searches?

  • What is the null value in SQL?

Most common Meta/Facebook product/case questions
  • You run a restaurant and 2 of the chefs call in sick 2 hours before your dinner service. What data before, during, and after do you need to ensure the experience is still memorable for your customers? What steps do you take to resolve this issue?

  • How would you identify spam using AI?

Conclusion

The Meta interview process is very thorough and it’ll be crucial that you prepare for both the technical and behavioral sections of the interview process. Utilize online resources to practice and don’t forget to reach out to friends at Meta to get an inside perspective on the company culture and interview process.

Do you want to ace your SQL interview?

Practice free and paid real SQL interview questions with step-by-step answers.

Do you want to Ace your SQL interview?

Practice free and paid SQL interview questions with step-by-step video solutions!