sql Interview Questions
40 interview questions in our bank cover sql, most of them Coding & Leetcode-style Questions. They average 3.0/5 difficulty — medium — and each one was reported by a candidate after a real interview. Companies known to ask about sql: Notion, Zoox, Discord, Airbnb, Salesforce, and 15 more.
Practice these on the problems board →Companies that ask about sql
Question mix
- Coding & Leetcode-style Questions18
- ML Fundamentals & Algorithms17
- System Design for ML4
- MLOps & Deployment1
Difficulty
- 2/5 — easy3
- 3/5 — medium33
- 4/5 — hard3
- 5/5 — very hard1
Questions tagged sql
In-Memory Database with SQL Operations
3/5Reported during technical interviews at OpenAI, this coding task requires building an in-memory database that handles fundamental query processing operations directly through native method calls rather than parsing raw text strings. Developers must progressively implement core features such as table creation, record insertion, column projection, conditional filtering, and sorted output, followed by an architectural discussion on indexing optimizations. Unlock the full problem description, edge case analyses, and a complete model solution by purchasing a site subscription.
Coding & Leetcode-style QuestionsOpenAISQL: User Login Streaks and Active-Day Users
3/5Designed to evaluate advanced data manipulation capabilities, this Pinduoduo interview question focuses on analyzing historical database logs to extract temporal user engagement patterns. Candidates need to write complex queries that isolate continuous login streaks within constrained sliding timeframes as well as across an entire timeline. Additionally, the task involves filtering and counting distinct active periods to pinpoint loyal platform participants. Unlock the full database schema requirements and optimized SQL query by subscribing today.
ML Fundamentals & AlgorithmsPinduoduoMost Popular Plan Type for the Top Event Type
3/5Data aggregation and relational database manipulation are critical skills for data professionals, frequently highlighted in evaluations like this reported Notion interview question. You will need to write an efficient query to identify the most active category of user actions and subsequently determine the predominant subscription tier linked to those specific interactions. The challenge evaluates your capability to join multiple relational tables and handle complex many-to-one relationships. Unlock the full problem breakdown and expert SQL solution with a subscription.
ML Fundamentals & AlgorithmsNotionData Engineering: Movie Success Pipeline
3/5This Netflix data engineering assessment explores movie launch analytics through relational queries, production pipeline resiliency, and event stream classification. It evaluates your skills in writing advanced database aggregations, handling data skew, and processing real-time user behavior metrics efficiently. Access to the full exercise details and verified solutions requires a paid subscription.
MLOps & DeploymentNetflixImplement Basic SQL Query Operations
3/5This Retool interview question explores the fundamentals of database query processing by asking you to implement core retrieval operations from scratch. You will need to parse relational structures, filter records based on specific conditions, and apply pagination rules programmatically. The task evaluates your understanding of data structures, relational logic, and algorithm design when standard database engines are unavailable. Unlocking the complete problem details, test scenarios, and the model solution requires a subscription.
ML Fundamentals & AlgorithmsRetoolSQL: Project Duration & Budget per Employee
3/5This data engineering technical screen reported from Snowflake focuses on relational database querying and data aggregation. Candidates must write SQL queries to extract employee names based on project duration thresholds and compute proportional budget allocations per worker across shared initiatives. The task tests advanced filtering, multi-table joins, and aggregate mathematical operations within a business schema context. Gain access to the full database schema, prompts, and verified SQL solutions with a paid subscription.
ML Fundamentals & AlgorithmsSnowflakeTop 3 Vendors by Total Charged Dollars in Last 2 Years
3/5This Zoox data engineering assessment tests your ability to write complex analytical database queries involving financial logs and vendor dimensions. You will filter historical purchase records over a specific timeframe, appropriately handle refund relationships, and aggregate monetary values to isolate top performers. It evaluates proficiency in relational database operations, filtering logic, and data grouping. Discover the full evaluation criteria and complete query implementation with a subscription.
ML Fundamentals & AlgorithmsZooxSQL Query Plan Optimizer With Predicate Pushdown
5/5This Databricks interview question challenges you to build a relational query plan optimizer capable of executing predicate pushdown transformations. You will work with a tree structure of query operators like scans, filters, and joins, ensuring that rewritten plans remain fully evaluable and semantically correct. This advanced problem evaluates deep architectural thinking, AST manipulation, and optimization theory. Access to the complete problem description and an optimal model solution requires a subscription.
Coding & Leetcode-style QuestionsDatabricksCountry with the Most Events
3/5This Notion interview question tests your ability to write efficient data aggregation queries over large relational datasets. You will need to calculate activity metrics per geographic region and extract the top-performing territory while handling potential ties correctly. The scenario evaluates how well you structure relational operations to scale smoothly under heavy data volumes. Access to the full problem description and complete model solution requires a subscription.
ML Fundamentals & AlgorithmsNotionMLE Onsite - Domain Round (ML Coding + SQL Window Function)
3/5Encountered during an onsite round at Coinbase, this domain-specific interview combines a brief machine learning coding warmup with a complex relational database challenge. The SQL portion heavily tests your mastery of advanced window functions, common table expressions, and sequential event tracking across user partitions. It is designed to filter candidates who can move past basic aggregations into sophisticated analytical querying. Access the complete problem scenario, tactical advice, and reference solution by obtaining a subscription.
ML Fundamentals & AlgorithmsCoinbaseTop 3 Vendors by Total Charged Amount in the Last 2 Years (Net of Refunds)
3/5This data aggregation and analytics challenge, reported from interviews at Zoox, evaluates your ability to write complex relational database queries involving financial records and vendor metadata. You are tasked with calculating net financial activity over a multi-year window by properly accounting for purchases and their corresponding refunds, then ranking the top performers accordingly. The exercise tests your mastery of SQL joins, date filtering, conditional aggregation, and window functions. Access to the complete prompt, schema details, and optimized query solution requires a subscription.
ML Fundamentals & AlgorithmsZooxBlock Type with the Most Children
3/5This Notion interview question tests your ability to write advanced database queries and aggregate large-scale hierarchical information efficiently. You are tasked with analyzing a massive relational table representing nested elements to determine which classification type possesses the highest cumulative descendant count. The challenge emphasizes query optimization and grouping techniques to handle extensive data volumes smoothly. To view the complete problem statement, optimal SQL approach, and detailed implementation steps, a subscription is required.
ML Fundamentals & AlgorithmsNotionEvent Type with the Most Events
2/5This Notion data-focused interview question asks you to analyze a large-scale activity log to identify the most frequently occurring categorical entries. Using standard database querying techniques, you will need to aggregate records and correctly handle ties when multiple categories share the peak frequency. The challenge assesses your proficiency with grouping operations and performance considerations when operating on massive datasets. Unlock the complete problem description, optimized query strategies, and expert solutions with a subscription.
ML Fundamentals & AlgorithmsNotionIn-Memory SQL Engine with CSV Parser
4/5Featured in Microsoft interviews, this advanced coding challenge asks you to build a lightweight in-memory database engine complete with a custom CSV parsing mechanism from scratch. You will handle complex data ingestion challenges including quoted strings and escaped characters, followed by implementing foundational query operations like filtering and sorting. This comprehensive task tests your parser design capabilities and data manipulation logic under strict constraints. Gain access to the full problem description and the model solution with a subscription.
Coding & Leetcode-style QuestionsMicrosoftSQL Screening (Joins / Aggregation / Window Functions)
3/5This relational database screening evaluation was featured in a Notion engineering interview, focusing on complex querying over multiple business tables. You will tackle practical data retrieval scenarios involving advanced joins, subqueries, and window functions to extract precise metrics. The exercise measures your ability to write performant queries while correctly managing nulls and row aggregation. Get the complete set of prompts and verified SQL solutions by subscribing today.
ML Fundamentals & AlgorithmsNotionSQL Cloud Resource Utilization Dashboard
2/5Featured in Akuna Capital data engineering interviews, this SQL challenge tasks you with creating a unified dashboard view by aggregating and filtering cloud resource metrics across multiple applications. You will need to write a clean query that calculates average usage percentages for specific time frames, applies conditional thresholds, and formats output columns precisely. This scenario tests your proficiency with intermediate aggregation functions, conditional filtering, and data sorting. To view the complete schema details and the optimized SQL query, a subscription is required.
ML Fundamentals & AlgorithmsAkuna CapitalAuction Web Service – Lot Winners
3/5Test your relational database querying capabilities with an e-commerce bidding scenario often seen in data-centric roles at Blizzard. This problem evaluates your mastery of SQL aggregation and table joining techniques, requiring you to extract peak financial offers for individual marketplace lots using conditional grouping clauses. Writing optimized queries for relational data manipulation is the core focus here. The full problem and model solution require a subscription.
ML Fundamentals & AlgorithmsBlizzardTop 3 vendors by city and state in the last 2 years
3/5This Zoox SQL query problem requires you to analyze transactional data to identify top-performing vendors. You need to aggregate transaction amounts for each vendor within specific geographical regions (state and city) over the past two years, calculating a net amount that accounts for both purchases and refunds. The final output should list the top three vendors for each unique state-city combination, ranked by their net amount. This question specifically tests your proficiency with SQL window functions for ranking and data aggregation. The full problem statement and a model solution are available with a subscription.
ML Fundamentals & AlgorithmsZooxCumulative Deduped Time Calculation
3/5Reported as a Nuro interview challenge, this problem requires calculating the exact non-overlapping duration for distinct execution sessions from a log of timestamp intervals. You will need to design robust logic in both database queries and procedural code to merge overlapping time spans accurately and compute cumulative totals. This exercise examines your data manipulation skills, temporal overlap handling, and analytical query writing. Unlock the complete problem context, dataset specifications, and reference solutions with a subscription.
ML Fundamentals & AlgorithmsNuroData Cleaning Pipeline and SQL Analytics Screen
3/5This Tesla screening task combines data wrangling with advanced database querying. The first part challenges you to sanitize a messy transaction log containing inconsistent date formats, malformed monetary figures, and structural anomalies. The second part requires writing sophisticated relational database queries involving cumulative metrics, recursive hierarchies, and conditional aggregations. It tests both your scripting proficiency and analytical capabilities for data engineering roles. Unlock the complete technical guide, dataset details, and optimal solutions with a subscription.
ML Fundamentals & AlgorithmsTeslaPercentage of Blocks Never Edited
3/5Reported from a Notion analytics interview, this SQL challenge involves relational tables tracking workspace documentation and user activity logs to calculate the proportion of untouched content. The task tests proficiency in set operations, conditional aggregation, and handling multi-event relationships efficiently. It measures the ability to translate product usage definitions into clean analytical queries. Access to the full schema, test cases, and optimal SQL solution requires a subscription.
ML Fundamentals & AlgorithmsNotionSQL Windowed Aggregation: Past 7/14/30 Days per Day and Country
3/5Mastering advanced relational database querying is a key requirement for data-focused engineering roles, as highlighted in technical rounds at Discord. This analytics task evaluates your proficiency in utilizing windowed aggregation functions to compute rolling metrics over specific past intervals grouped by calendar days and regions. You must carefully handle deduplication logic and construct efficient queries to process multi-day sliding time frames accurately. Unlock the complete problem statement and verified model solution with a subscription.
Coding & Leetcode-style QuestionsDiscordIn-Memory SQL Database
4/5This open-ended Airbnb coding interview requires you to design and implement a simplified relational database from scratch, supporting table creation, data insertion, and conditional querying. The prompt deliberately leaves room for ambiguity, testing your ability to clarify requirements, establish a solid minimum viable product, and handle stretch goals like indexing or filtering. Architectural vision and clean code organization are paramount for success. The full problem and model solution require a subscription.
Coding & Leetcode-style QuestionsAirbnbAnalytics Engineer: SQL + Python Sessionization
3/5Practice dual-domain data processing combining advanced relational database queries and Python-based sessionization algorithms, highlighted in analytics engineering loops at Robinhood. This problem tests your ability to handle sharded datasets with complex join conditions and group event logs into distinct time-capped sessions. It is designed to evaluate practical data transformation skills used in production data pipelines. The full problem documentation, datasets, and complete model solutions require an active subscription.
Coding & Leetcode-style QuestionsRobinhoodSQL Aggregation: Video Calls per Country per Day
3/5This database interview challenge, frequently reported at Discord, requires candidates to write efficient queries grouping large-scale telecommunication records by geographical region and chronological date. This assessment evaluates relational database manipulation, handling massive datasets, and writing performant aggregations. Access to the complete problem breakdown, optimal SQL queries, and performance tuning strategies requires a paid subscription.
Coding & Leetcode-style QuestionsDiscordData Engineer Screen — SQL Collaborator Model + IPv4 Validation
3/5This data engineering technical screen, featured at Figma, evaluates proficiency in both relational database querying and string manipulation. The first portion involves analyzing user activity logs to identify initial design shares and modeling close collaborator relationships, while the second part requires parsing and validating network address strings. The complete problem requirements, dataset schema, and model solutions are available exclusively to subscribers.
Coding & Leetcode-style QuestionsFigmaSQL Pair Programming (Data Engineer)
3/5This data engineering pair programming session, commonly encountered during technical interviews at Shopify, tests your practical query-writing proficiency through a live coding environment. You will work through escalating relational database challenges involving data cleansing, temporal aggregation, and string manipulation across multiple interconnected tables. To view the complete set of prompts and verified query solutions, a subscription is required.
Coding & Leetcode-style QuestionsShopifyCode Review OA — Python Files (Salesforce / Slack)
3/5This Salesforce and Slack joint assessment tests your code comprehension and software evaluation abilities in a realistic take-home format. You will inspect a small codebase containing Python scripts and database interactions to uncover hidden defects, architectural flaws, and maintainability concerns. The task measures your attention to detail and ability to communicate professional engineering feedback effectively. Gain full access to the source repository overview and the complete grading rubric by purchasing a subscription.
Coding & Leetcode-style QuestionsSalesforceTransactions Status Report SQL
3/5Practice an advanced database querying task featured in Intuit online assessments that requires generating comprehensive transaction status reports from raw relational data. This exercise tests your proficiency in data normalization, complex aggregation techniques, frequency ranking, and string concatenation methods within relational database management systems. Solving this problem highlights your capability to transform messy logs into clean business intelligence summaries. The complete dataset schemas, query requirements, and optimal SQL solutions are available exclusively to subscribers.
Coding & Leetcode-style QuestionsIntuitData Engineer AI-Native Full-Stack Round
4/5This comprehensive Meta data engineering interview round simulates a high-stakes scenario combining business case evaluation, dimensional data modeling, and SQL debugging within a single session. It evaluates end-to-end data architecture expertise, problem-solving under constraints, and analytical communication. The full prompt, database schemas, and expert model solutions require a subscription.
Coding & Leetcode-style QuestionsMetaLLM SQL Chatbot Access Control and Query Safety
3/5Explore a complex system architecture challenge reported from NVIDIA interviews focusing on the secure design of a natural language interface for database querying. The scenario requires balancing user accessibility with strict authorization boundaries, ensuring that generated queries respect enterprise permission levels while protecting downstream data infrastructure from catastrophic resource exhaustion. Candidates must address query validation, mitigation of hallucinated syntax, and resource management to prevent cluster instability. Gain full access to the complete design blueprint and expert recommendations with a subscription.
System Design for MLNVIDIAData Modeling and DAU Query for a Fitness App
3/5Tackle a practical analytics engineering challenge featured by DoorDash, focusing on database schema design for health tracking applications. You will establish metrics for daily active users and write efficient querying logic to extract vital user engagement insights over customized time intervals. This exercise tests database design principles and aggregation proficiency. Unlock the full case study and expert solution by subscribing.
System Design for MLDoorDashWebsite Activity Analytics: Unique Users + Session Time
3/5This reported Google coding interview challenge evaluates your ability to process web log data effectively. You are asked to compute distinct visitor totals for various actions alongside calculating the average duration users spend browsing the platform. The exercise tests your data aggregation skills and requires careful handling of edge cases rather than just pristine code. The complete problem statement, underlying logic, and verified model solution require a subscription.
Coding & Leetcode-style QuestionsGooglePython + SQL Technical Round (Typing, Debugging, Joins)
3/5Prepare for a senior engineering technical evaluation modeled after real-world Okta interview assessments. This multi-faceted discussion spans core language competencies, including static typing annotations, bug fixing, performance complexity analysis, and database querying via relational joins. It is designed to evaluate your deep technical fluency and architectural communication skills across backend domains. Unlock the complete breakdown of discussion points, code snippets, and expert answers by securing a subscription.
Coding & Leetcode-style QuestionsOktaDE/AE Screen: SQL + Python (Sliding Window + Joins)
3/5This comprehensive DoorDash technical screening combines relational database queries with an algorithmic Python task involving sliding windows and data aggregation. Candidates must demonstrate proficiency in writing complex analytical SQL statements utilizing window functions and conditional grouping, alongside implementing an efficient sequence processing script. It thoroughly assesses database design comprehension and algorithmic efficiency under time constraints. View the complete problem breakdown, query requirements, and model solutions by upgrading to a paid subscription.
Coding & Leetcode-style QuestionsDoorDashCoffee Ordering System Design
3/5Used during technical evaluations at Salesforce, this system design prompt asks candidates to construct an end-to-end beverage ordering and management platform. The interview scenario prioritizes relational database modeling, efficient query design for complex business metrics, and reliable real-time status notification pipelines for customers and vendors. Architects must address tricky edge cases and lifecycle state transitions within strict time limits. Unlocking the complete architectural design and database schemas requires an active subscription.
System Design for MLSalesforceElection Exit Poll by State Report (Top-3 states per candidate with ties)
3/5This Point72 database query challenge requires extracting and ranking electoral poll statistics from relational tables. Candidates must write an advanced SQL script to aggregate votes by territory and identify top-performing candidates across distinct vote volume tiers while correctly handling tied outcomes. This problem evaluates proficiency with window functions, subqueries, and complex data grouping. To view the complete database schema, test queries, and optimal SQL script, a paid subscription is required.
Coding & Leetcode-style QuestionsPoint72Host Listings Page — Aggregation Optimization
3/5This Airbnb system design interview question focuses on diagnosing and resolving performance bottlenecks in a host dashboard application. When rendering aggregated reservation and pricing metrics across numerous listings for a specific date range, naive data joining causes unacceptable latency. You will learn how to optimize database schemas, leverage caching or pre-aggregation, and achieve sub-second response times. Access to the comprehensive architectural analysis and recommended design pattern requires a subscription.
System Design for MLAirbnbIn-Memory SQL-Like Database
3/5Tackle an extensive system-building problem frequently asked during technical evaluations at Two Sigma, where you are tasked with creating a lightweight relational database entirely in memory. This exercise tests your ability to design efficient data structures, parse custom query commands, and execute conditional filtering logic with multiple predicates. You will need to balance clean architecture principles with performance considerations for data insertion and retrieval operations. Elevate your coding capabilities by learning how to structure complex state management and command interpreters from scratch. Unlock the detailed system requirements and complete reference solution with a subscription.
Coding & Leetcode-style QuestionsTwo SigmaBasic SQL Query Aggregation
2/5Database querying and data aggregation are essential competencies for backend developers, as evaluated in foundational SQL assessments like this one from Demonware. This challenge requires you to design a relational table structure and write a database query that groups records to compute statistical metrics, such as category averages. It tests your understanding of relational database design, group-by clauses, and basic aggregate functions. Unlock the full exercise details and verified SQL solution by subscribing today.
Coding & Leetcode-style QuestionsDemonware
Studied alongside
sql interview FAQ
- How many sql interview questions are there?
- 40 reported questions, mostly Coding & Leetcode-style Questions.
- Which companies ask sql questions?
- Notion (6), Zoox (3), Discord (2), Airbnb (2), Salesforce (2), DoorDash (2), OpenAI (1), Pinduoduo (1).
- How hard are sql questions?
- They average 3.0 out of 5: 3 at 2/5, 33 at 3/5, 3 at 4/5, 1 at 5/5.