Questions 1–200 of 238
What are database indexes, how do they work, and when do their benefits outweigh their costs?
Asked in 32 of 612 interviews · last asked Oct 14 · Concept · Junior
Show answer
Database indexes are extra data structures that help find rows faster. A B-tree index keeps keys ordered, allowing searches for matches or ranges without scanning every row. Indexes need storage and maintenance on inserts, updates, and deletes. Their benefits outweigh their costs when frequent queries save more work than maintaining the indexes adds.
- Index columns used often in filters, joins, and sorting.
- A table scan can be cheaper for small tables or queries returning many rows.
- Where supported, clustered indexes organize table data by key, helping range queries.
- Non-clustered indexes provide separate lookup paths using keys and row references; exact storage details vary by database.
What the interviewer checks: The interviewer checks whether you understand how indexes speed up queries and balance read benefits against write costs.
Common mistake (in 7 of 17 reviewed answers): Many answers forget that indexes cost storage and slow writes, so choose them based on the read and write workload.
Other ways it was asked
- “What is indexing?”
- “What is an index?”
- “What are database indexes, and what are they used for?”
How would you identify, investigate, and optimize slow SQL queries?
Asked in 31 of 612 interviews · last asked Oct 20 · Scenario · Mid-level
Show answer
I find slow or costly queries using query logs and monitoring, then record their runtime and resource use. I inspect execution plans and runtime metrics to locate the bottleneck. Based on the cause, I add suitable indexes, update statistics, or rewrite the query. I rerun it under similar conditions and compare performance, while checking that results stay correct.
- Prioritize queries by runtime, frequency, and total resource use.
- Check plans for expensive scans, joins, sorts, and inaccurate row estimates; check waits for blocking.
- Choose fixes based on evidence; extra indexes use space and slow writes.
- Compare elapsed time, CPU, and reads before and after using representative parameters.
What the interviewer checks: The interviewer checks whether you measure the problem, choose a targeted fix, and verify the improvement.
Common mistake (in 6 of 12 reviewed answers): Many answers forget that execution plans and runtime metrics should guide the fix, rather than guessing.
Other ways it was asked
- “How would you optimize a slow SQL query?”
- “What can you do to improve the performance of a slow SQL query?”
- “How would you optimize slow database queries?”
What is the N+1 query problem, and how can you avoid it?
Asked in 12 of 612 interviews · last asked Oct 7 · Concept · Mid-level
Show answer
The N+1 query problem happens when one query loads a list, then a separate query loads related data for each item. These extra database calls can make the application slow as the list grows. Avoid it by using joins, eager loading, or batch queries to fetch related data together.
- Lazy loading in an ORM can trigger a query each time related data is accessed.
- Batch loading fetches related data for many items in one query instead of one query per item.
- Joins can repeat parent data when each parent has multiple related rows.
- Check query logs to spot repeated queries.
What the interviewer checks: The interviewer is checking whether you recognize repeated database calls and know how to fetch related data efficiently.
Common mistake (in 3 of 6 reviewed answers): Many answers forget that the pattern is one query for the list, followed by one extra query per item.
Other ways it was asked
- “What is the N+1 query problem, and how do you fix it?”
- “What is the N+1 query problem?”
- “How can you avoid the N+1 query problem?”
What types of database indexes are there, and how do clustered and non-clustered indexes differ?
Asked in 11 of 612 interviews · last asked Oct 10 · Concept · Mid-level
Show answer
Common index types include clustered, non-clustered, unique, columnstore, and full-text; support varies by database. In SQL Server, a clustered rowstore index stores table rows at its leaf level, ordered by key. A non-clustered index stores keys and row locators separately from the table. Indexes speed up reads but add storage and write costs.
- SQL Server allows one clustered index per table and multiple non-clustered indexes.
- Choose clustered keys for common range queries; prefer narrow, stable keys.
- Use non-clustered indexes for other filters and joins; included columns can avoid extra row lookups.
- Only ORDER BY guarantees query result order, even with a clustered index.
What the interviewer checks: The interviewer checks whether you understand index storage, access patterns, and the trade-off between faster reads and slower writes.
Other ways it was asked
- “What is the difference between clustered and nonclustered indexes?”
- “In SQL, what is the difference between clustered and nonclustered indexes?”
- “What is the difference between clustered and nonclustered indexes in how they store data in SQL Server?”
What are the disadvantages of database indexes, and how can too many hurt performance?
Asked in 8 of 612 interviews · last asked Oct 2 · Concept · Mid-level
Show answer
Indexes can speed up reads, but they use extra storage and slow down writes. Inserts, deletes, and updates to indexed values also require index changes. Too many indexes add disk work, compete for memory, and increase maintenance costs, especially when few queries use them.
- Indexes help locate rows without scanning the whole table, but not every query benefits.
- Writes must maintain affected indexes, so extra indexes can reduce write speed.
- Indexes need storage and can compete with table data for cache space.
- Check query plans and index usage before removing unused or overlapping indexes.
What the interviewer checks: The interviewer is checking whether you can balance faster reads against write, storage, and maintenance costs.
Other ways it was asked
- “What are the disadvantages of database indexes?”
- “Why can using database indexes increase the number of operations?”
- “What are the drawbacks of using database indexes?”
How do you determine which database columns should be indexed?
Asked in 5 of 612 interviews · last asked Sep 28 · Scenario · Mid-level
Other ways it was asked
- “How do you determine which database indexes to create and which columns to index?”
- “Which database columns would you index, and how would you decide?”
- “How would you choose which columns to index in a database?”
What are SQL execution plans, and how can you use them to investigate query performance?
Asked in 5 of 612 interviews · last asked Oct 22 · Concept · Mid-level
Other ways it was asked
- “What is a SQL execution plan, and how do you use it to investigate query performance?”
- “How do you use SQL execution plans to diagnose and optimize queries?”
- “How do you read a SQL execution plan, and what information can it provide?”
What’s the difference between EXPLAIN and EXPLAIN ANALYZE?
Asked in 3 of 612 interviews · last asked Oct 13 · Concept · Mid-level
Other ways it was asked
- “What is the difference between EXPLAIN and EXPLAIN ANALYZE?”
How do offset pagination and cursor pagination differ?
Asked in 3 of 612 interviews · last asked Oct 14 · Concept · Mid-level
Other ways it was asked
- “What is the difference between using an offset and a cursor for database pagination?”
- “Explain the trade-offs between offset pagination and cursor pagination.”
How would you approach diagnosing an intermittent performance regression in an Entity Framework Core query without changing the database schema?
Asked in 2 of 612 interviews · last asked May 16 · Scenario · Senior
Other ways it was asked
- “How would you approach diagnosing an intermittent performance regression in an EF Core query without changing the database schema?”
Which data structure is commonly used for indexing in a database management system?
Asked in 2 of 612 interviews · last asked Aug 27 · Concept · Junior
Other ways it was asked
- “What data structures are commonly used to implement database indexes?”
When would you use table partitioning in a database?
Asked in 2 of 612 interviews · last asked Sep 24 · Concept · Mid-level
Other ways it was asked
- “If a database table is partitioned, when might splitting the data into separate tables still be necessary?”
When you filter or aggregate early to improve performance, what concrete validation checks do you run to prove the KPI results stay equivalent or quantify the delta?
Asked in 2 of 612 interviews · last asked Oct 15 · Scenario · Senior
Other ways it was asked
- “When you aggregate or filter before a join, how do you verify you haven't introduced bias or changed KPI definitions? What checks do you run?”
Does keyset pagination work when IDs aren’t numerical or don’t grow linearly?
Asked once · last asked Oct 19 · Concept · Mid-level
Other ways it was asked
- “Can keyset pagination work when IDs aren’t numerical or don’t grow linearly, such as random UUIDs?”
- “Assuming employee IDs grow linearly, will keyset pagination work?”
In a query joining a large fact table to multiple dimensions, what indicators tell you the plan is inefficient?
Asked once · last asked Aug 23 · Scenario · Senior
Other ways it was asked
- “When a query joining a large fact table to multiple dimensions has an inefficient execution plan, what indicators would you look for, and what indexing or partitioning changes would you try first?”
For a table with roughly 1.5–2 billion rows, how would you choose between range and hash partitioning for performance optimization, and what factors would guide your decision?
Asked once · last asked Dec 15 · Scenario · Senior
Other ways it was asked
- “For a table with roughly 1.5–2 billion rows, how would you choose a hash partition count, and when would hash partitioning be preferable to range partitioning?”
For a status column with few distinct values, what index strategy would you consider, and why?
Asked once · last asked Jan 28 · Scenario · Senior
When would a bitmap index scan be useful compared with a sequential scan?
Asked once · last asked Jan 28 · Concept · Senior
Why should you avoid adding indexes to every column, and how can indexes affect performance?
Asked once · last asked Jan 28 · Concept · Mid-level
Given a SQL query, how would you optimize it, and what would your first step be?
Asked once · last asked Jan 31 · Scenario · Mid-level
What is the difference between an index scan and a table scan?
Asked once · last asked Jan 31 · Concept · Mid-level
If you see very high CPU usage in SQL Server, how would you identify and troubleshoot it?
Asked once · last asked Feb 7 · Scenario · Senior
What methods and processes do you use to optimize database queries?
Asked once · last asked Feb 19 · Tooling · Mid-level
How would you approach optimizing a database query, and what methods would you use?
Asked once · last asked Feb 19 · Behavioral · Mid-level
Other ways it was asked
- “Tell me about a recent database query optimization you performed and the methods you used.”
What is a B-tree index, and how does it work?
Asked once · last asked Feb 23 · Concept · Mid-level
What types of database indexes are there besides B-tree indexes?
Asked once · last asked Feb 23 · Concept · Mid-level
What are the drawbacks of database indexes, and why shouldn't you index every column?
Asked once · last asked Feb 23 · Concept · Mid-level
How do composite indexes work? If you create an index on first_name and last_name, how many indexes are created?
Asked once · last asked Feb 23 · Concept · Mid-level
Which fields in a user profile and phone-number schema would you index, and why?
Asked once · last asked Feb 23 · Scenario · Mid-level
Should you create an index for each phone number field in a user database?
Asked once · last asked Feb 23 · Scenario · Mid-level
What indexes should you add to a phone-number table besides its primary key, and is an index on a foreign key created automatically?
Asked once · last asked Feb 23 · Concept · Mid-level
Can you describe a specific time you optimized a slow database, including what was going wrong and what you did to fix it?
Asked once · last asked Feb 24 · Behavioral · Senior
When troubleshooting database performance issues, what steps do you usually follow to identify the root cause?
Asked once · last asked Feb 24 · Scenario · Senior
How would you identify bottlenecks and common causes of slow SQL queries under heavy database load, and what improvements would you consider?
Asked once · last asked Mar 6 · Scenario · Mid-level
Other ways it was asked
- “What would you do if SQL queries became slower while the database was heavily loaded? What common issue might cause this, how could you improve it, and how would you find the bottleneck?”
What performance challenges can arise when using plain JPA with large database tables?
Asked once · last asked Mar 6 · Concept · Mid-level
If a stored procedure in SQL is running very slowly, how would you optimize or improve it?
Asked once · last asked Mar 12 · Scenario · Senior
A read-only REST service retrieves records containing a BLOB but fails under 30 to 100 simultaneous requests. How would you develop an end-to-end solution?
Asked once · last asked Mar 17 · Scenario · Senior
Other ways it was asked
- “For a read-only REST service that retrieves records containing a BLOB and fails under 30 to 100 simultaneous requests, what changes would you consider to the database table structure?”
A query is slow because it returns many records. What strategies would you use to improve its performance?
Asked once · last asked Mar 18 · Scenario · Mid-level
When redesigning a REST API to handle higher traffic, what database query challenges might arise, and how would you address them?
Asked once · last asked Mar 25 · Scenario · Senior
In a high-traffic PHP app using MySQL, what steps would you take to diagnose and reduce slow requests caused by database access?
Asked once · last asked Mar 26 · Scenario · Senior
Does the order of columns matter in a composite database index?
Asked once · last asked Apr 4 · Concept · Mid-level
When are database indexes updated as new rows are inserted, and how would this work with an ingestion rate of 15 million rows per day?
Asked once · last asked Apr 4 · Scenario · Senior
How are data and indexes physically stored on disk in a database?
Asked once · last asked Apr 4 · Concept · Mid-level
What does the SQL EXPLAIN command show, and how can you use it to analyze a query?
Asked once · last asked Apr 4 · Tooling · Mid-level
How can you assess whether a database query is efficient and identify which indexes it uses with EXPLAIN?
Asked once · last asked Apr 9 · Tooling · Mid-level
What are the limitations of hash indexes, and when might they be unsuitable?
Asked once · last asked Apr 13 · Concept · Senior
If a query filters on multiple columns that each have a separate index, will the database use all of those indexes or only one?
Asked once · last asked Apr 15 · Concept · Senior
If several microservices and BI tools are sending queries to one overloaded database, how would you identify where the queries originate, and what tool would you use?
Asked once · last asked Apr 17 · Scenario · Senior
How would you find the source of queries overloading a database when you have no logs or request IDs?
Asked once · last asked Apr 17 · Scenario · Senior
Apart from query optimization, what else can you do to make database queries run faster?
Asked once · last asked Apr 23 · Scenario · Mid-level
When would you use an index, and when would you use a view?
Asked once · last asked May 5 · Concept · Mid-level
How do you inspect a database query execution plan?
Asked once · last asked May 7 · Tooling · Mid-level
How would you design an API endpoint that returns paginated results from a large dataset? How would you address performance and user experience concerns?
Asked once · last asked May 8 · Design · Mid-level
How do you provision and configure databases, write SQL queries, and identify opportunities to optimize performance, such as adding indexes?
Asked once · last asked May 12 · Tooling · Mid-level
How do logical and physical query execution differ in SQL, and how can join types affect a query's execution plan?
Asked once · last asked May 13 · Concept · Mid-level
What factors do you consider when tuning a database query?
Asked once · last asked May 19 · Scenario · Senior
How do you identify a slow query? What method do you use?
Asked once · last asked May 22 · Scenario · Mid-level
After reviewing a query execution plan, what steps would you take to optimize the query?
Asked once · last asked May 22 · Scenario · Mid-level
When using EXPLAIN to investigate a slow query, what do you check first to identify the problem?
Asked once · last asked May 22 · Scenario · Mid-level
How would you index a notification storage schema to keep queries fast as the data grows?
Asked once · last asked May 23 · Design · Senior
How do you approach SQL tuning?
Asked once · last asked May 26 · Concept · Mid-level
An API is slow when searching the father's-name column in a student table with 20–30 million rows. How would you reduce its latency?
Asked once · last asked Jun 11 · Scenario · Mid-level
How would you create an index for a query that searches the father's-name column in a large student table?
Asked once · last asked Jun 11 · Scenario · Mid-level
Do you need to create an index on a column that is already a key?
Asked once · last asked Jun 17 · Concept · Mid-level
How would you investigate database utilization reaching 100% and determine whether the cause is insufficient resources or another issue?
Asked once · last asked Jun 18 · Scenario · Senior
When database utilization reaches 100%, how would you decide whether to add resources or optimize queries and indexes?
Asked once · last asked Jun 18 · Scenario · Senior
Should every column used as a dashboard or user-facing filter be indexed, and what are the effects of creating too many indexes?
Asked once · last asked Jun 18 · Concept · Senior
How can changes to a query improve database performance apart from adding indexes?
Asked once · last asked Jun 18 · Scenario · Mid-level
How do you measure database performance and identify problems as a system scales, and what limitations should you consider?
Asked once · last asked Jun 24 · Scenario · Senior
What techniques or data structures would you use to improve database search performance?
Asked once · last asked Jun 25 · Scenario · Mid-level
In a large ETL merge or upsert into a fact table, how would you decide between MERGE and INSERT APPEND plus a separate UPDATE, and what performance risks would you watch for?
Asked once · last asked Jun 25 · Scenario · Senior
How would you optimize the performance of a complex SQL query?
Asked once · last asked Jun 26 · Scenario · Senior
Other ways it was asked
- “Describe a complex SQL query you have written. How did you optimize its performance, and what approaches did you use?”
What is a compound index in a database, and when would you use one?
Asked once · last asked Jul 16 · Concept · Mid-level
In SQL Server, how would you investigate and fix a slow query without changing the application's behavior?
Asked once · last asked Jul 16 · Scenario · Senior
What can prevent SQL Server from using an index?
Asked once · last asked Jul 16 · Concept · Mid-level
What performance issues can database indexes cause?
Asked once · last asked Jul 16 · Concept · Mid-level
How can database indexes affect write performance and disk operations?
Asked once · last asked Jul 16 · Concept · Mid-level
An Oracle 19c batch process is extremely slow. How would you diagnose whether the bottleneck is CPU contention, I/O, or locking?
Asked once · last asked Jul 16 · Scenario · Senior
What are database indexes, what are their pros and cons, and how are they built internally?
Asked once · last asked Jul 23 · Concept · Mid-level
Let's say a query in production is running slowly. Walk me through what to do: how do you find out why and how do you fix it?
Asked once · last asked Jul 23 · Scenario · Senior
How would you rewrite a SQL query so that an index can be used?
Asked once · last asked Jul 24 · Scenario · Mid-level
Your SQL query is taking too long on a large transaction table. How would you optimize it?
Asked once · last asked Jul 25 · Scenario · Mid-level
When you use UUID primary keys at scale, what techniques do you use to reduce index bloat and page splits, for example around UUID version choice or insertion patterns?
Asked once · last asked Jul 27 · Concept · Senior
In a large multi-tenant PostgreSQL schema, when would you choose partitioning by tenant versus keeping a single table with a tenant_id, and what performance or maintenance tradeoffs drive that choice?
Asked once · last asked Jul 27 · Design · Senior
How do you design indexes for multi-tenant tables to keep them selective and avoid cross-tenant hotspots? Do you generally lead with tenant_id, and when would you not?
Asked once · last asked Jul 27 · Concept · Senior
How do you choose between GIN indexes on JSON and functional B-tree indexes on specific JSON paths, accounting for operational concerns such as write overhead, vacuuming, and bloat?
Asked once · last asked Jul 27 · Concept · Senior
Other ways it was asked
- “Do you decide between GIN on JSON versus functional B-tree indexes on specific JSON paths? And what operational downsides do you watch for with GIN writes, like vacuum or bloat?”
How would you improve database read performance?
Asked once · last asked Jul 27 · Scenario · Mid-level
How would you efficiently handle an API that needs to return data from 10,000,000 student records in a Postgres database?
Asked once · last asked Jul 27 · Design · Senior
How does having an index affect the choice between a row-based RDBMS and a columnar database?
Asked once · last asked Jul 29 · Concept · Mid-level
How can you analyze the performance of a MySQL query?
Asked once · last asked Jul 31 · Tooling · Mid-level
If a MySQL query scans all 2 million rows, what would you do first to reduce the number of rows it scans?
Asked once · last asked Jul 31 · Scenario · Mid-level
What type of MySQL index would you choose to reduce the number of rows scanned by a query, and why?
Asked once · last asked Jul 31 · Concept · Mid-level
What are the considerations for using indexes in Greenplum and other MPP systems?
Asked once · last asked Jul 31 · Concept · Senior
A database query that used to take 300 milliseconds now takes two minutes after another team's deployment, even though the query has not changed. How would you find the root cause?
Asked once · last asked Jul 31 · Scenario · Senior
If a transaction table contains hundreds of millions of records and data is queried directly from the database, why might performance still be slow, and what are the likely causes?
Asked once · last asked Aug 4 · Scenario · Senior
How would you investigate and optimize a slow query fetching user analytics data?
Asked once · last asked Aug 5 · Scenario · Senior
What does EXPLAIN ANALYZE do, and how would you use it safely in production environments?
Asked once · last asked Aug 5 · Tooling · Senior
How would you diagnose and optimize a complex Azure SQL Database query that joins multiple large tables and suffers from slow joins and high memory consumption, while minimizing resource usage?
Asked once · last asked Aug 10 · Scenario · Senior
Other ways it was asked
- “You're tasked with optimizing a complex SQL query that joins multiple large tables in Azure SQL database. The query is performing poorly due to slow joins and high memory consumption. How would you identify the root cause of the performance bottleneck? And what strategies would you implement to improve the query's efficiency while minimizing resource usage?”
When joining multiple large tables or when the smaller table cannot fit in memory, how would you improve join efficiency and reduce shuffling without broadcast joins, while also identifying and addressing indexing issues in Azure SQL?
Asked once · last asked Aug 10 · Scenario · Senior
Other ways it was asked
- “When a smaller table cannot fit in memory or you are joining multiple large tables, what alternatives to broadcast joins can reduce data shuffling and improve join efficiency? How would you identify and address indexing issues in Azure SQL?”
How would you diagnose and improve the performance of a complex SQL query running slower than expected on a large dataset?
Asked once · last asked Aug 11 · Scenario · Mid-level
How would you design an indexing strategy for a massive table with billions of rows where frequent queries filter by date and retrieve recent records, and what would you consider for maintaining index performance over time?
Asked once · last asked Aug 11 · Scenario · Senior
If you’re having a problem with a query, how would you try to improve it?
Asked once · last asked Aug 12 · Scenario · Mid-level
How do you get the query plan? What command do you use?
Asked once · last asked Aug 12 · Tooling · Junior
How does cost estimation work in PostgreSQL query plans?
Asked once · last asked Aug 12 · Concept · Senior
If a PostgreSQL query plan shows lower execution time but higher estimated cost, how would you interpret and investigate it?
Asked once · last asked Aug 12 · Scenario · Senior
What types of indexes are available in PostgreSQL, and when would you use them?
Asked once · last asked Aug 12 · Concept · Mid-level
How would you set up full-text search in PostgreSQL?
Asked once · last asked Aug 12 · Tooling · Mid-level
How would you refactor a SQL query to improve its organization and performance?
Asked once · last asked Aug 12 · Scenario · Mid-level
What are the drawbacks of using indexes when handling large datasets?
Asked once · last asked Aug 12 · Concept · Mid-level
For a large table, when would you choose a clustered index over a nonclustered index?
Asked once · last asked Aug 12 · Scenario · Mid-level
A MERGE INTO operation becomes slow after a new table partition is added. What could cause the slowdown?
Asked once · last asked Aug 14 · Scenario · Senior
How do you identify and fix the N+1 query problem in Django ORM, SQLAlchemy, or Odoo?
Asked once · last asked Aug 14 · Scenario · Mid-level
How do you write performant code, and what do you know about performance at the database level?
Asked once · last asked Aug 20 · Concept · Senior
How do you decide between composite versus single-column indexes?
Asked once · last asked Aug 23 · Concept · Mid-level
What metrics and details can you inspect in the output of EXPLAIN or EXPLAIN ANALYZE?
Asked once · last asked Aug 25 · Concept · Mid-level
How does Snowflake's Search Optimization Service differ architecturally from clustering keys or traditional indexes?
Asked once · last asked Aug 26 · Concept · Senior
Other ways it was asked
- “How does search optimization service differ architecturally from standard clustering keys or traditional indexes?”
How do indexes improve SQL Server table performance, and what types of indexes can be used?
Asked once · last asked Aug 26 · Concept · Mid-level
How do you tune the performance of a stored procedure in SQL Server?
Asked once · last asked Aug 26 · Scenario · Mid-level
A stored procedure is running slowly in production on a table with 30 million rows. How would you diagnose the problem and refactor it?
Asked once · last asked Aug 31 · Scenario · Senior
How do you make reads fast on a table with tens of millions of rows?
Asked once · last asked Sep 1 · Scenario · Senior
If you find the bottleneck is at the database level, what options would you consider and how would you fix it?
Asked once · last asked Sep 1 · Scenario · Senior
How would you page through a very large dataset efficiently?
Asked once · last asked Sep 1 · Concept · Mid-level
If a data table becomes large over time and queries get slow, how would you resolve it?
Asked once · last asked Sep 1 · Scenario · Mid-level
Suppose a stored procedure starts running slowly in production due to a sudden increase in data volume. What steps would you take to diagnose and tune it?
Asked once · last asked Sep 4 · Scenario · Senior
Other ways it was asked
- “Suppose that procedure started running slowly in production due to a sudden increase in data volume. What exact steps would you take to diagnose and tune it?”
What's the first thing you check if a PL/SQL procedure slows down in production?
Asked once · last asked Sep 4 · Scenario · Senior
When tuning a high-volume PL/SQL object, how do you identify where execution time is being spent?
Asked once · last asked Sep 4 · Scenario · Senior
How do you diagnose a SQL performance issue using an execution plan, and decide what to change?
Asked once · last asked Sep 4 · Scenario · Mid-level
What does an expensive access path mean in a SQL execution plan, and how do you identify one?
Asked once · last asked Sep 4 · Concept · Mid-level
How do you verify that a SQL performance fix remains stable across repeated processing cycles?
Asked once · last asked Sep 4 · Scenario · Senior
What is DBMS_XPLAN used for?
Asked once · last asked Sep 4 · Concept · Mid-level
When should you gather optimizer statistics in Oracle Database?
Asked once · last asked Sep 4 · Scenario · Mid-level
If a slow query suddenly jumps from ten minutes to forty five, walk me through exactly how you troubleshoot.
Asked once · last asked Sep 4 · Scenario · Senior
Under what internal conditions does SQL Server switch from an index seek to an index scan, and how do you remediate it?
Asked once · last asked Sep 5 · Scenario · Senior
How would you validate a database query optimization and check that it did not shift load elsewhere?
Asked once · last asked Sep 6 · Scenario · Senior
Other ways it was asked
- “How did you validate a database query optimization and check that it did not shift load elsewhere?”
Explain indexing. What problem does this solve and what's the trade off?
Asked once · last asked Sep 6 · Concept · Mid-level
In a large ETL-style merge into a fact table, what are your top three tactics to improve performance and reduce redo and undo when processing millions of rows?
Asked once · last asked Sep 7 · Scenario · Senior
How do you decide between a single set-based merge and a PL/SQL bulk approach for the same transformation, and what metrics drive that choice?
Asked once · last asked Sep 7 · Scenario · Senior
A query joining a 500-million-row fact table to several dimensions is doing an unexpected full table scan. What's your step-by-step process to diagnose and fix it?
Asked once · last asked Sep 7 · Scenario · Senior
How do you detect and fix an implicit data type conversion in an Oracle join predicate that prevents index usage?
Asked once · last asked Sep 7 · Scenario · Senior
How would you handle a large dataset if the GROUP BY query were running very slowly?
Asked once · last asked Sep 8 · Scenario · Mid-level
What database-level optimizations would you use to keep reads fast when the mapping table grows very large?
Asked once · last asked Sep 8 · Design · Senior
How would you reduce database load during a large export?
Asked once · last asked Sep 9 · Scenario · Senior
How would you troubleshoot a database query that slowed down to 18 minutes after the table grew to 5 billion rows?
Asked once · last asked Sep 9 · Scenario · Senior
What approach do you recommend for handling record counts efficiently?
Asked once · last asked Sep 9 · Scenario · Mid-level
How would you improve SQL query efficiency in a data engineering project?
Asked once · last asked Sep 10 · Behavioral · Mid-level
Other ways it was asked
- “How have you improved SQL query efficiency in your data engineering projects?”
What is your view on query cost, and how would you manage it when choosing between a traditional SQL database and a knowledge graph?
Asked once · last asked Sep 10 · Design · Senior
Given orders(id PRIMARY KEY, customer_id, status, created_at) and SELECT ... FROM orders WHERE customer_id = ? AND status IN (...) ORDER BY created_at DESC LIMIT 50, what composite index would you create, and why that column order?
Asked once · last asked Sep 10 · Scenario · Senior
Other ways it was asked
- “Suppose you have an orders table with columns id (primary key), customer_id, status, and created_at, and a query filters by customer_id and status, sorts by created_at descending, and limits results to 50. What composite index would you create, and why that column order?”
Will a database query always use an available index?
Asked once · last asked Sep 10 · Concept · Mid-level
When might a database index be ineffective or ignored by the query optimizer?
Asked once · last asked Sep 10 · Concept · Mid-level
Why might a query execution plan change as the number of rows in a table grows?
Asked once · last asked Sep 10 · Concept · Senior
What kind of SQL query would a paginated API use to retrieve results?
Asked once · last asked Sep 10 · Concept · Mid-level
How would you measure improvements and assess trade-offs when adding indexes and separating reporting queries from the main transaction path?
Asked once · last asked Sep 15 · Behavioral · Mid-level
Other ways it was asked
- “How did you measure the improvement, and what trade-offs did you consider when adding indexes and separating reporting queries from the main transaction path?”
How would you investigate a master table that has become slow to query over time?
Asked once · last asked Sep 16 · Scenario · Senior
What would you do if a table had too many partitions?
Asked once · last asked Dec 15 · Scenario · Senior
How would you prevent the N+1 query problem in GraphQL, and what database-level optimizations would you make?
Asked once · last asked Sep 17 · Scenario · Senior
Other ways it was asked
- “How would you prevent the N+1 query problem in this GraphQL case, and what database-level optimizations would you do?”
When addressing a performance problem, how would you decide between using Redis, optimizing SQL queries, or changing the data model?
Asked once · last asked Sep 18 · Scenario · Senior
How would you identify the bottleneck in a slow data pipeline or analytical query, decide what to change, and verify the improvement?
Asked once · last asked Sep 20 · Behavioral · Senior
Other ways it was asked
- “How did you identify the bottleneck in a slow data pipeline or analytical query, what did you change, and how did you verify the improvement?”
If an ATP query takes sixteen minutes in production, how do you handle the issue?
Asked once · last asked Sep 21 · Scenario · Senior
How would you troubleshoot and optimize an ATP database query that takes six to ten minutes?
Asked once · last asked Sep 21 · Scenario · Senior
How would you design data access for a search feature, including tables, indexes, query strategy, and consistent pagination as data changes?
Asked once · last asked Sep 22 · Design · Senior
When using keyset pagination with relevance and creation-time sort keys, how would you keep ordering deterministic when relevance scores tie or change between requests?
Asked once · last asked Sep 22 · Design · Senior
If logs show that most API latency comes from database calls and database CPU is spiking, what would you investigate next?
Asked once · last asked Sep 23 · Scenario · Senior
How would you optimize database performance as data volume grows, and when would you revisit indexing or partitioning?
Asked once · last asked Sep 23 · Scenario · Senior
How do you optimize query performance and data retrieval when a single database table scales rapidly with historical data?
Asked once · last asked Sep 24 · Scenario · Senior
How would you search for a particular record in a table with 50 million rows and improve search performance?
Asked once · last asked Sep 25 · Scenario · Senior
A join involving a 50-million-row table and several small tables takes 30–40 minutes. How would you improve its performance?
Asked once · last asked Sep 25 · Scenario · Senior
Explain advanced techniques for optimizing complex SQL queries in high-frequency environments and how you identify and resolve performance bottlenecks.
Asked once · last asked Sep 29 · Concept · Senior
Tell me about a time you optimized a high-frequency query that was causing performance issues. What changes did you make, and what was the impact?
Asked once · last asked Sep 29 · Behavioral · Senior
How would you validate the accuracy and performance of a SQL query that finds the five most frequent error codes in high-frequency integration logs?
Asked once · last asked Sep 29 · Scenario · Senior
If you need to create 1,000 events in a database, how many SQL queries might the code execute, and how could you make it faster?
Asked once · last asked Sep 29 · Scenario · Mid-level
How would you optimize a web page that displays millions of database records in a front-end data grid?
Asked once · last asked Sep 30 · Scenario · Senior
Which PostgreSQL keywords can you use to paginate query results?
Asked once · last asked Sep 30 · Concept · Junior
A list page is slow with millions of records. How would you optimize it on the frontend and backend?
Asked once · last asked Oct 1 · Scenario · Senior
How would you investigate a query that suddenly becomes slow in production?
Asked once · last asked Oct 2 · Scenario · Senior
How would you improve query performance on a transactions table with millions of records that is frequently searched by card number, transaction ID, or date?
Asked once · last asked Oct 2 · Scenario · Senior
In a system processing thousands of transactions per minute, how would you diagnose and resolve a transaction-history query whose response time has increased from 2 seconds to 3 seconds?
Asked once · last asked Oct 2 · Scenario · Senior
How would you handle an API that becomes slow when the database grows from 5,000,000 to 100,000,000 records?
Asked once · last asked Oct 5 · Scenario · Senior
How would you benchmark API latency and measure the improvement after adding materialized views and indexes?
Asked once · last asked Oct 5 · Behavioral · Senior
Other ways it was asked
- “How did you benchmark the API latency, and what ballpark improvement did you see after adding the materialized views and indexes?”
How would you export user records from a database as quickly and efficiently as possible?
Asked once · last asked Oct 6 · Scenario · Senior
How would you paginate user records for export, and what conditions would you use to select each page?
Asked once · last asked Oct 6 · Scenario · Senior
Why is keyset pagination often better than OFFSET pagination?
Asked once · last asked Oct 6 · Concept · Senior
What is partitioning, and how is indexing different from partitioning?
Asked once · last asked Oct 7 · Concept · Mid-level
A SQL query has become very slow on a table with several million rows. What would you check first?
Asked once · last asked Oct 7 · Scenario · Mid-level
How does PostgreSQL execute a SQL query?
Asked once · last asked Oct 7 · Concept · Mid-level
What is a sequential scan, how does PostgreSQL use indexes, and why might it choose not to use an index?
Asked once · last asked Oct 7 · Concept · Senior
If a report is slow and timing out, how do you troubleshoot that at the query level, and what specific things do you check first?
Asked once · last asked Oct 8 · Scenario · Mid-level
If a slow SQL report is caused by a missing index or an inefficient join, what would you do next?
Asked once · last asked Oct 8 · Scenario · Mid-level
How would you verify that a SQL query optimization does not negatively affect other queries or systems?
Asked once · last asked Oct 8 · Scenario · Senior
When performance is the bottleneck on multi-terabyte business tables, what are the first three optimizations you typically apply in SQL/Spark to reduce runtime while keeping results correct?
Asked once · last asked Oct 9 · Tooling · Senior
Tell me about a challenging, resource-intensive query you encountered and how you implemented a solution.
Asked once · last asked Oct 12 · Behavioral · Senior
If an API that used to return data in 40–50 milliseconds starts taking 8–10 seconds after the data grows, what troubleshooting or optimization steps would you use?
Asked once · last asked Oct 12 · Scenario · Mid-level
A table contains over 5 million log records, and retrieving just five rows with a SELECT query is slow. How would you improve query performance?
Asked once · last asked Oct 13 · Scenario · Mid-level
What happens if I put an index on every field in my database? Will queries to this table be faster or slower, or does it depend?
Asked once · last asked Oct 13 · Scenario · Mid-level
How can I debug and understand why a complex query with joins and GROUP BY is slow?
Asked once · last asked Oct 13 · Scenario · Senior
If you have a very large dataset and your SQL query is taking too long to execute, what would you do?
Asked once · last asked Oct 17 · Scenario · Senior
How would you handle sporadic REST API responses and timeouts during peak hours when logs show occasional database query latency spikes?
Asked once · last asked Oct 19 · Scenario · Senior
Can you tell me an efficient alternative to using LIMIT and OFFSET pagination in MySQL or other SQL databases?
Asked once · last asked Oct 19 · Concept · Mid-level
What is the time complexity of keyset pagination?
Asked once · last asked Oct 19 · Concept · Mid-level
Other ways it was asked
- “What is the time complexity of this keyset pagination approach?”
A payment-list query takes 15 seconds on a table with several million records. What would you investigate to identify the cause and improve its response time?
Asked once · last asked Oct 20 · Scenario · Senior
What performance optimizations do you apply in PHP and databases?
Asked once · last asked Oct 20 · Scenario · Senior
Page 1 · Page 2
More SQL interview questions
- All SQL interview questions
- SQL Basics Interview Questions
- Database Design Interview Questions
- SQL Joins and Aggregation Interview Questions
- Advanced SQL Query Interview Questions
- SQL Views and Stored Procedures Interview Questions
- SQL Transactions and Concurrency Interview Questions
- Database Integration and Security Interview Questions
- Database Administration and Scaling Interview Questions
How this list is made
Every question here was asked by a real interviewer in a real job interview that a candidate ran MeetAssist in. After the call, the interviewer's questions are pulled from the transcript. Practice sessions, tests, exams and anything that was not a job interview are dropped.
Questions are rewritten so they make sense on their own: names of people, employers and clients are removed, and speech-to-text mistakes are fixed. Small talk, logistics and questions about one candidate's own résumé are left out. Rephrasings of the same question are merged, and the count is the number of different interviews it came up in.
The interviews come from candidates who use MeetAssist, so they lean towards software, data and AI roles: the shares describe these interviews, not every SQL interview. Answers to the most asked questions are written and checked by an editor; a "common mistake" is shown only when reviews of real answers in these interviews show it, with the count.
612 interviews, 357 candidates, Nov 2025 to Oct 2026. Updated every month with new interviews.
Or add the Chrome extension