Ctrl K
Backend · Senior · Theory

In production, a query against a 200-million-row orders table suddenly started taking seconds instead of milliseconds. How would you investigate, and what can you do with indexes?

~4 min by voice

How to approach it

This checks whether the candidate can systematically diagnose query degradation on a large table: from finding the query and its execution plan to the reasons the plan changed. Second, whether they understand how to design an index properly, roll it out safely in production, and what that index costs.

Have you seen this question in a real interview?
Answers0
Avg. score—
Strong—
Practiced0
Topics
Similar questionsУ нас есть таблица заказов на сотни миллионов строк и составной B-tree индекс по (user_id, created_at). Расскажите, как устроен такой индекс внутри и как база по нему выполняет запрос «последние 20 заказов пользователя». А если в запросе фильтр только по created_at — индекс поможет? Mid-levelA query that used to run in milliseconds now takes seconds after the table grew to tens of millions of rows. How would you investigate, and what can you do about it? Mid-levelThe orders list page has started taking several seconds to load, and in the logs you see hundreds of near-identical SQL queries per HTTP request. What's going on, and how would you fix it? Mid-levelYou're told that one database query has started running very slowly. How would you look for the cause? JuniorWhat is a database index, and how does it speed up queries? Junior

Answer by voice

The interviewer will ask this question and listen. Think out loud and ask for a hint if you need one. When you're done, pause or tap “That's my answer”. In about a minute, your score and the points you covered show up here.

Sign in to answer

Best with headphones · ~4 min