39 practice questions for Meta Data Scientist interviews
Meta data scientist interviews test statistical reasoning, ML model design, SQL proficiency, A/B testing methodology, and Python-based algorithm implementation.
Category: Graph coding problem# Question Your task is to implement a simple in-memory cloud storage system that maps objects (files) to their metadata (name, size, etc.). You...Input: Graph (nodes and edges) Output: Array
codingHardVerified Question#2
2. OA[CodeSignal] Design Banking System
Category: Graph coding problem# Question Design a banking system that supports account management, transactions, and various financial operations.Input: Graph (nodes and edges) Output: Computed result
codingMediumVerified Question#3
3. Friend Requests Sent
Category: Algorithm coding problem# Question Given a list of ages representing users in a social network, calculate the total number of friend requests each user will send based on...Input: List Output: Computed result
codingHardVerified Question#4
4. Minimum Prefix Subset
Category: Tree coding problem# Question Given a list of strings, find the minimum subset of prefixes that can represent the entire input set. A string is "represented" if it...Input: Array of strings Output: Integer
codingMediumVerified Question#5
5. Shortest Substring with Alphabet
Category: Sliding window coding problem*This is a popular twist Meta interviewers often put on the classic leetcode problem to find a minimum window substring.* Given an input string and...Input: String Output: Integer
codingMediumVerified Question#6
6. Shortest Substring with N Unique Characters
Category: String coding problem# Shortest Substring with N Unique Characters *This is a variation of the leetcode problem* Given a string s and an integer n, find the length of...Input: String Output: Computed result
codingHardVerified Question#7
7. OA[CodeSignal] In-Memory Database
Category: Graph coding problem# Description Implement a simplified in-memory database that supports record manipulation with various operations. The system should handle basic...Input: Graph (nodes and edges) Output: Array
codingEasyVerified Question#8
8. [CodeSignal] Count Non-Dominant Elements
Category: Array coding problem# Question Given an array of integers numbers, count all elements that are not equal to numbers[0] or numbers[1] (if those indices exist in the...Input: Array of integers Output: Computed result
codingEasyVerified Question#9
9. [CodeSignal] Sort Words By Vowel Consonant Difference
Category: Array coding problem# Question You are given a string text consisting of unique lowercase English words separated by spaces. For each word, compute the absolute...Input: Array Output:** Computed result
codingMediumVerified Question#10
10. [CodeSignal] Warehouse Robot Commands
Category: Matrix coding problem# Question In a highly automated warehouse, a robot organizes packages stored in a rectangular grid. The grid is represented as a 2D list of integers...Input: Matrix (2D array) Output: Computed result
codingHardVerified Question#11
11. [CodeSignal] House Segments After Destruction
Category: Array coding problem# Question You are monitoring the building density in a district of houses. The district is represented as a number line, where each house is located...Input: Array of integers Output: Array
codingMediumVerified Question#12
12. Distribution Center Placement
Category: Array coding problemA logistics company is expanding its distribution network along a single highway. You are given an array of integers locations representing the...Input: Array of integers Output: Computed result
codingHardVerified Question#13
13. Expression Simplifier
Category: String coding problemGiven an algebraic expression string containing single lowercase-letter variables, the operators + and -, and parentheses ( and ), simplify...Input: String Output: Computed result
codingMediumVerified Question#14
14. Minimum Sum Tree Path
Category: Binary tree coding problem# Minimum Sum Tree PathInput: Binary tree Output: Computed result
technicalMediumVerified Question#15
15. How to pass AI Enabled Coding Rounds From FAANG Interviewer
Category: Algorithm coding problem# Tips For AI Coding Rounds AI coding rounds are not as different from regular coding rounds as you might think. The interviewer still needs to get...Input: Given input Output: Computed result
ml designSeniorml pipeline#1
1. Design a Model Versioning Registry for Meta AI Models
Meta requires a robust way to manage various versions of machine learning models used across different services. The Model Versioning Registry should provide capabilities to track changes, roll back, and retrieve model metadata efficiently. Problem statement: Implement a class ModelVersioningRegistry that handles the versioning of ML models: - def __init__(self): Constructs an empty model registry. - def add_model(self, model_id: str, version: str, metadata: Dict[str, Any]) -> None: Adds a new model version to the registry. - def get_model(self, model_id: str, version: str) -> Dict[str, Any]: Retrieves metadata for a specific model version from the registry. - def rollback_model(self, model_id: str) -> str: Rolls back to the previous version of the specified model. Constraints: - 1 <= len(model_id) <= 255 - 1 <= len(version) <= 50
ml designSeniorml pipeline#2
2. Design a Feature Growth Simulator for Instagram Reels Viral Spread
Meta wants to analyze and simulate the growth patterns of user engagement on Instagram Reels as different features go live. Design a simulator to project user adoption and interactions over a given time period based on historical usage data. Problem statement: Create a class FeatureGrowthSimulator that simulates viral growth patterns for Instagram features: - def __init__(self, initial_users: int, growth_rate: float): Constructs the simulator with initial number of users and growth rate. - def simulate_growth(self, months: int) -> List[int]: Simulates the growth for the given number of months and returns a list of user counts at the end of each month. - def set_growth_rate(self, new_growth_rate: float) -> None: Updates the growth rate based on external factors. Constraints: - 1 <= initial_users <= 10^6 - 0 < growth_rate <= 1 - 1 <= months <= 24
codingHardgraph#3
3. [OA] Dijkstra's Algorithm — Shortest paths between user networks on Messenger
Meta aims to improve communication speed on Messenger by analyzing network distances. You need to determine the shortest path between users based on a network graph where nodes represent users and edges represent direct communication paths with weights representing latency. Problem statement: Implement Dijkstra's algorithm to find the shortest path from a given starting node to all other nodes in a weighted graph. - Method Signature: def dijkstra(graph: Dict[int, List[Tuple[int, int]]], start: int) -> Dict[int, int] Example 1: Input: graph = {0: [(1, 1), (2, 4)], 1: [(2, 2)], 2: []}, start = 0 Output: {0: 0, 1: 1, 2: 3} Explanation: The shortest path from node 0 to node 1 is 1 and to node 2 is 3 (0 -> 1 -> 2). Constraints: - 1 <= len(graph) <= 1000 - 0 <= weights <= 1000
codingMediumsliding window#4
4. [OA] Sliding Window — Analyze user engagement metrics on Facebook Live
Meta needs to optimize user engagement on Facebook Live. You are tasked with analyzing user interaction data in real-time to identify active segments of the audience during a live event. Problem statement: Given an array of integers engagements where each integer represents the number of interactions at each timestamp, determine the maximum number of interactions in any k consecutive timestamps. - Method Signature: def max_engagement(engagements: List[int], k: int) -> int Example 1: Input: engagements = [1, 2, 3, 4, 5], k = 2 Output: 9 Explanation: The maximum interactions in any 2 consecutive timestamps is 4 + 5 = 9. Constraints: - 1 <= len(engagements) <= 10^5 - 1 <= k <= len(engagements)