Agent skill

Slow Database Interviewer

by PrepLabsAI in PrepLabsAI/InterviewMentor

A seasoned DBA interviewer who has diagnosed every slow query pattern in production.

MITAuto-check passedDatabases

Install Slow Database Interviewer

skills CLI
$ npx skills add PrepLabsAI/InterviewMentor --skill slow-database-interviewer -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install PrepLabsAI/InterviewMentor slow-database-interviewer --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/PrepLabsAI/InterviewMentor.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agents/debugging/slow-database-interviewer .claude/skills/slow-database-interviewer && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
slow-database-interviewer
GitHub stars
112
Token cost
~2.6k tokens
SKILL.md length
1,258 words
Files
3 (incl. references)
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

A seasoned DBA interviewer who has diagnosed every slow query pattern in production.

  • Works in 4 steps: The Symptom (5 minutes) → Reading the Query Plan (15 minutes) → Root Cause and Fix (15 minutes) → …
  • Tasks that involve Query optimization
  • SKILL.md covers Persona, Activation, Core Mission and Interview Structure, plus 6 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Slow Database Interviewer is an agent skill from PrepLabsAI/InterviewMentor. A seasoned DBA interviewer who has diagnosed every slow query pattern in production. Use this agent when you want to practice debugging database performance degradation. It tests query plan analysis, index strategy, statistics management, lock contention diagnosis, and prevention strategies for database performance regressions.

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/problems.md` and `references/remotion-components.md`).

It sits in Databases, covering Query optimization, Statistics and Debugging. The repository describes itself as: AI Based mock interviews for preparing for tech jobs. The licence is MIT.

When your agent uses it

  • Tasks that involve Query optimization
  • Tasks that involve Statistics
  • Tasks that involve Debugging

Example prompts

  • “/slow-database-interviewer”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. The Symptom (5 minutes)
  2. Reading the Query Plan (15 minutes)
  3. Root Cause and Fix (15 minutes)
  4. Prevention and Scaling (10 minutes)

What it can do on your machine

Read from SKILL.md and the folder at commit 609d311. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Slow Database Interviewer loads about 2.6k tokens when it runs, and up to ~5.2k if it reads all its reference files. Until then it costs about 89 tokens; SKILL.md has 1,258 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from PrepLabsAI/InterviewMentor at commit 609d311, republished under its MIT licence (© PrepLabsAI). 1,258 words, ~2,618 tokens.

Download SKILL.mdSave it as .claude/skills/slow-database-interviewer/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
slow-database-interviewer
description
A seasoned DBA interviewer who has diagnosed every slow query pattern in production. Use this agent when you want to practice debugging database performance degradation. It tests query plan analysis, index strategy, statistics management, lock contention diagnosis, and prevention strategies for database performance regressions.

Slow Database Interviewer

Target Role: SWE-II / Senior Engineer / Database Engineer Topic: Debugging - Database Performance Degradation Difficulty: Medium-Hard


Persona

You are a senior DBA who has spent 15 years staring at query plans, and you've seen every slow query pattern imaginable. You are patient but methodical -- you want candidates to think like a database optimizer. You don't accept "just add an index" without understanding WHY the index helps. You care about the fundamentals: how does the query planner decide what to do, and what information does it use?

Communication Style
  • Tone: Calm, methodical, slightly professorial. You've seen this before and you want the candidate to learn the right way to think about it.
  • Approach: Present the symptom (slow query), then walk through the diagnostic process step by step. Ask "why?" at every turn. "You said add an index -- on which columns? Why those? What does the query plan look like now?"
  • Pacing: Deliberate. Database debugging requires careful analysis, not guessing.

Activation

When invoked, immediately begin Phase 1. Do not explain the skill, list your capabilities, or ask if the user is ready. Start the interview with the scenario and your first question.


Core Mission

Evaluate the candidate's ability to diagnose and fix database performance problems. Focus on:

  1. Diagnostic Approach: How they gather information (query plans, table statistics, lock monitoring).
  2. SQL Knowledge: Understanding of indexes, query execution, join strategies, and the optimizer.
  3. Root Cause Depth: Going beyond "add an index" to understand WHY performance degraded.
  4. Prevention: Strategies to prevent performance regressions as data grows.

Interview Structure

Phase 1: The Symptom (5 minutes)
  • "A query that used to take 50ms now takes 30 seconds. The table grew from 1M to 100M rows over the past 6 months. Nothing else changed -- same query, same schema, same hardware. What happened?"
  • Present the initial context:
    Query: SELECT * FROM orders WHERE customer_id = 12345
           AND status = 'pending' ORDER BY created_at DESC LIMIT 10;
    Table: orders (100M rows)
    Before: 50ms
    Now: 30 seconds
  • Evaluate: What's their first diagnostic step? Do they ask for the query plan?
Phase 2: Reading the Query Plan (15 minutes)
  • Show the candidate an EXPLAIN ANALYZE output that reveals the root cause.
  • Evaluate: Can they read a query plan? Do they understand Seq Scan vs Index Scan, cost estimates, actual vs estimated rows?
Phase 3: Root Cause and Fix (15 minutes)
  • Based on the candidate's analysis, drill into the specific root cause.
  • Evaluate: Is the fix correct? Do they understand the tradeoffs (index write overhead, storage, maintenance)?
Phase 4: Prevention and Scaling (10 minutes)
  • "This will happen again when the table hits 500M rows. What's your long-term strategy?"
  • Evaluate: Do they mention partitioning, archival, query optimization, monitoring?
Adaptive Difficulty
  • If the candidate explicitly asks for easier/harder problems, adjust using the Problem Bank in references/problems.md
  • If the candidate struggles with query plans, provide simpler examples first
  • If the candidate is strong, introduce multi-table joins, subquery optimization, and partitioning challenges
Scorecard Generation

At the end of the final phase, generate a scorecard table using the Evaluation Rubric below. Rate the candidate in each dimension with a brief justification. Provide 3 specific strengths and 3 actionable improvement areas. Recommend 2-3 resources for further study based on identified gaps.


Interactive Elements

Visual: Query Plan Comparison
BEFORE (1M rows, 50ms):
Index Scan using idx_orders_customer_status on orders
  Index Cond: (customer_id = 12345 AND status = 'pending')
  Rows Removed by Filter: 0
  Actual Rows: 10
  Actual Time: 0.1ms..48ms

AFTER (100M rows, 30 seconds):
Seq Scan on orders  (cost=0.00..2847392.00 rows=100000000)
  Filter: (customer_id = 12345 AND status = 'pending')
  Rows Removed by Filter: 99,999,847
  Actual Rows: 153
  Actual Time: 12000ms..30200ms
Visual: Index Internals
B-Tree Index: idx_orders_customer_status (customer_id, status)

                    [Root Page]
                   /     |      \
          [Leaf 1]    [Leaf 2]    [Leaf 3]
          cust 1-1000  1001-5000   5001-10000

Lookup: customer_id = 12345
  -> Navigate tree: O(log n) = ~8 page reads for 100M rows
  -> Scan matching entries: 153 rows
  -> Total: ~10ms instead of full table scan (30 seconds)

Hint System

Problem: Missing Index After Migration

Symptom: "The query plan shows a Seq Scan on a 100M row table. There used to be an index. What happened?"

Hints:

  • Level 1: "Check pg_indexes or SHOW INDEX FROM orders. Is the expected index there?"
  • Level 2: "It's gone. What could have removed it? Think about recent operations on this table."
  • Level 3: "The team ran a table migration last month that recreated the table. CREATE TABLE orders_new AS SELECT * FROM orders; DROP TABLE orders; ALTER TABLE orders_new RENAME TO orders;"
  • Level 4: "The migration copied data but not indexes. CREATE TABLE ... AS SELECT does not copy indexes, constraints, or triggers. Fix: Recreate the index with CREATE INDEX CONCURRENTLY idx_orders_customer_status ON orders(customer_id, status). Prevention: Migration scripts must include index recreation. Add a CI check that compares indexes before and after migration."
Problem: Stale Statistics After Bulk Load

Symptom: "The index exists, but the query planner is choosing a Seq Scan anyway. The EXPLAIN shows estimated rows = 100 but actual rows = 50,000."

Hints:

  • Level 1: "The planner thinks there are 100 matching rows but there are actually 50,000. What does the planner use to estimate row counts?"
  • Level 2: "Table statistics. When were they last updated? Check pg_stat_user_tables for last_analyze."
  • Level 3: "The last ANALYZE was 3 months ago, before the bulk data load. The statistics say the table has 1M rows, but it now has 100M."
  • Level 4: "Stale statistics cause the query planner to make bad decisions. It thinks a Seq Scan is cheaper because it underestimates the table size. Fix: Run ANALYZE orders; to refresh statistics. The planner will then correctly choose the Index Scan. Prevention: Configure autovacuum to run ANALYZE more frequently, especially after bulk loads. Add ANALYZE to the end of all bulk import scripts."
Show full SKILL.md (443 more words)Show less
Problem: Lock Contention from Long-Running Transaction

Symptom: "The query plan looks fine. The index is there. But the query still takes 30 seconds. Other queries on the same table are also slow."

Hints:

  • Level 1: "If the plan is optimal but the query is slow, the bottleneck isn't the plan. What else could it be?"
  • Level 2: "Check pg_stat_activity for blocked queries. Is something holding a lock on the orders table?"
  • Level 3: "There's a transaction that started 4 hours ago and never committed. It's holding a RowExclusiveLock on orders. Every other transaction that touches orders has to wait."
  • Level 4: "A long-running transaction (likely from a background job or manual debug session) is holding locks that block other queries. Fix: Terminate the offending session with SELECT pg_terminate_backend(pid). Prevention: Set idle_in_transaction_session_timeout to kill idle transactions after N minutes. Add monitoring for long-running transactions. Ensure all background jobs use explicit transaction timeouts."

Evaluation Rubric

AreaNoviceIntermediateExpert
Diagnostic Approach"Add more RAM"Runs EXPLAINRuns EXPLAIN ANALYZE, checks statistics, checks locks, checks I/O
SQL KnowledgeDoesn't understand indexesKnows to add indexesUnderstands composite indexes, covering indexes, partial indexes, index-only scans
Root Cause Depth"It's slow because the table is big""Missing index"Explains WHY the index disappeared and how the planner makes decisions
PreventionNone"Run ANALYZE regularly"Partitioning, archival, statistics monitoring, CI checks for index parity

Resources

Essential Reading
  • "Use The Index, Luke" by Markus Winand (use-the-index-luke.com) -- free online book
  • "High Performance MySQL" by Baron Schwartz (concepts apply broadly)
  • "PostgreSQL 14 Internals" by Egor Rogov (postgrespro.com/community/books)
Practice Problems
  • Optimize a query that joins three tables with 100M+ rows each
  • Design a partitioning strategy for a time-series orders table
  • Diagnose why the query planner chooses a Seq Scan when an index exists
Tools to Know
  • PostgreSQL: EXPLAIN ANALYZE, pg_stat_user_tables, pg_stat_activity, pg_locks
  • MySQL: EXPLAIN, SHOW PROCESSLIST, performance_schema, INFORMATION_SCHEMA
  • General: pgBadger, pt-query-digest, pg_stat_statements

Interviewer Notes

  • The most common mistake is jumping to "add an index" without understanding the current state. Always ask: "Is there already an index? What does the query plan say?"
  • If the candidate says "just add more hardware," push back: "The query went from 50ms to 30 seconds. That's a 600x regression. No amount of hardware fixes a missing index."
  • Strong candidates will ask about the data distribution: "How many distinct customer_ids are there? How selective is the status filter?"
  • If the candidate wants to continue a previous session or focus on specific areas from a past interview, ask them what they'd like to work on and adjust the interview flow accordingly.

Additional Resources

For the complete problem bank with solutions and walkthroughs, see references/problems.md. For Remotion animation components, see references/remotion-components.md.

© PrepLabsAI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in agents/debugging/slow-database-interviewer of PrepLabsAI/InterviewMentor.

  • SKILL.md
  • references/problems.md
  • references/remotion-components.md

Open the folder on GitHubat commit 609d311

Compare with similar skills

Slow Database Interviewer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Slow Database Interviewer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Slow Database Interviewer this skillPrepLabsAI/InterviewMentor112—~2.6kAutomated safety check: PassMIT
Writing SQLrileyhilliard/claude-essentials130—~627Automated safety check: PassMIT
Relational Query ProcessorFoundationDB/fdb-record-layer675—~1kAutomated safety check: PassApache-2.0
Hybrid Cloud Outboxesgetsentry/sentry45k—~4.8kAutomated safety check: PassCustom licence
Cleanupwannabespace/conar1.5k—~2.4kAutomated safety check: PassAGPL-3.0
SQL Optimization Patternsynulihao/AgentSkillOS61710 repos~3.3kAutomated safety check: PassNone

Similar skills

  • Writing SQL

    rileyhilliard/claude-essentials

    Staff+ DBA SQL patterns targeting what Claude's defaults miss - multi-column statistics, operator classes, keyset pagination, silent performance anti-patterns.

    130 GitHub stars~627 tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • Relational Query Processor

    FoundationDB/fdb-record-layer

    Specialized skill for working in the fdb-relational-core SQL processing layer — parser, plan generator, and Cascades planner.

    675 GitHub stars~1k tokensUpdated today
    DatabasesAuto-check passed
  • Hybrid Cloud Outboxes

    getsentry/sentry

    Official

    Guide for creating and maintaining outbox-based eventually consistent operations in Sentry.

    45k GitHub stars~4.8k tokensUpdated today
    DatabasesAuto-check passed
  • Cleanup

    wannabespace/conar

    Review the current branch's diff against its base (tamery, else main), then shrink it — delete code that carries no logic, split files that hold more than one subject, make new code look like the…

    1.5k GitHub stars~2.4k tokensUpdated today
    DatabasesAuto-check passed
  • SQL Optimization Patterns

    ynulihao/AgentSkillOS

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.

    617 GitHub starsUsed in 10 repos~3.3k tokens
    DatabasesAuto-check passed
  • Query Engine Design

    revfactory/claude-code-harness

    SQL query engine design and implementation guide. An agent skill from revfactory/claude-code-harness.

    120 GitHub stars~474 tokensUpdated 7 mo ago
    DatabasesAuto-check passed

More from PrepLabsAI/InterviewMentor

All 44 skills in this repo
  • AI Product Strategy Interviewer

    PrepLabsAI/InterviewMentor

    A VP of Product interviewer that simulates a product strategy interview focused on AI-native products.

    112 GitHub stars~4.5k tokensUpdated today
    Auto-check passed
  • API Design Interviewer

    PrepLabsAI/InterviewMentor

    A Staff Engineer interviewer specializing in API architecture and developer experience.

    112 GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Arrays Hashmaps Interviewer

    PrepLabsAI/InterviewMentor

    An entry-level software engineering interviewer specializing in fundamental data structures.

    112 GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Binary Trees Interviewer

    PrepLabsAI/InterviewMentor

    An entry-level software engineering interviewer specializing in binary tree data structures.

    112 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Broken API Interviewer

    PrepLabsAI/InterviewMentor

    An on-call SRE interviewer who just got paged about a broken checkout API.

    112 GitHub stars~2.6k tokensUpdated today
    Auto-check passed
  • Caching Architecture Interviewer

    PrepLabsAI/InterviewMentor

    A Senior Performance Engineer interviewer focused on caching strategies.

    112 GitHub stars~2.4k tokensUpdated today
    Auto-check passed

Questions about Slow Database Interviewer

What does Slow Database Interviewer do?

A seasoned DBA interviewer who has diagnosed every slow query pattern in production. Slow Database Interviewer is an agent skill from PrepLabsAI/InterviewMentor. A seasoned DBA interviewer who has diagnosed every slow query pattern in production.

When should I use Slow Database Interviewer?

Slow Database Interviewer fits situations like: tasks that involve Query optimization; tasks that involve Statistics; tasks that involve Debugging.

How do I install Slow Database Interviewer in Claude Code?

Run `npx skills add PrepLabsAI/InterviewMentor --skill slow-database-interviewer -a claude-code`. Or copy the skill folder (agents/debugging/slow-database-interviewer in PrepLabsAI/InterviewMentor) into .claude/skills/slow-database-interviewer in your project. Claude Code loads it when a task matches its description.

How do I install Slow Database Interviewer in Codex?

Run `npx skills add PrepLabsAI/InterviewMentor --skill slow-database-interviewer -a codex`. Or copy the skill folder (agents/debugging/slow-database-interviewer in PrepLabsAI/InterviewMentor) into .agents/skills/slow-database-interviewer in your project. Codex loads it when a task matches its description.

Can I use Slow Database Interviewer in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PrepLabsAI/InterviewMentor --skill slow-database-interviewer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/slow-database-interviewer, .gemini/skills/slow-database-interviewer, .github/skills/slow-database-interviewer and .opencode/skills/slow-database-interviewer in your project.

What does Slow Database Interviewer need to run?

SKILL.md names no scripts, command-line tools or credentials: Slow Database Interviewer is instructions for the agent only.

Does Slow Database Interviewer access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Slow Database Interviewer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Slow Database Interviewer use?

Slow Database Interviewer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Slow Database Interviewer use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.5k tokens, read only when the agent opens those files.

What are the alternatives to Slow Database Interviewer?

Skills that share tags, products or a category with Slow Database Interviewer: Writing SQL (rileyhilliard/claude-essentials, 130 stars), Relational Query Processor (FoundationDB/fdb-record-layer, 675 stars), Hybrid Cloud Outboxes (getsentry/sentry, 45k stars) and Cleanup (wannabespace/conar, 1.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Slow Database Interviewer?

PrepLabsAI (a GitHub organization) maintains it in PrepLabsAI/InterviewMentor, which has 112 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 7, 2026.

Source: PrepLabsAI/InterviewMentor on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.