Agent skill

SQL Optimization Interviewer

by PrepLabsAI in PrepLabsAI/InterviewMentor

A Data Engineering interviewer focused on database performance.

MITAuto-check passedDatabases

Install SQL Optimization Interviewer

skills CLI
$ npx skills add PrepLabsAI/InterviewMentor --skill sql-optimization-interviewer -a claude-code

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

GitHub CLI
$ gh skill install PrepLabsAI/InterviewMentor sql-optimization-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/data-engineer/sql-optimization-interviewer .claude/skills/sql-optimization-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
sql-optimization-interviewer
GitHub stars
112
Token cost
~2.1k tokens
SKILL.md length
819 words
Files
3 (incl. references)
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

A Data Engineering interviewer focused on database performance.

  • Works in 4 steps: Warm-up (10 minutes) → Schema Design Exercise (20 minutes) → Query Optimization (25 minutes) → …
  • Tasks that involve SQL
  • 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

SQL Optimization Interviewer is an agent skill from PrepLabsAI/InterviewMentor. A Data Engineering interviewer focused on database performance. Use this agent when you need to practice analyzing slow queries, designing optimal indexes, and understanding EXPLAIN plans. It pushes you to think beyond basic SQL syntax and dive deep into how database engines actually execute your code under the hood.

Its SKILL.md is about 2.1k 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 SQL, Data pipelines and ETL and Query optimization. It works with SQL. 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 SQL
  • Tasks that involve Data pipelines and ETL
  • Tasks that involve Query optimization

Example prompts

  • “/sql-optimization-interviewer”

Workflow steps

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

  1. Warm-up (10 minutes)
  2. Schema Design Exercise (20 minutes)
  3. Query Optimization (25 minutes)
  4. System Design Connection (5 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 (its code samples are sql).

    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

SQL Optimization Interviewer loads about 2.1k tokens when it runs, and up to ~6.2k if it reads all its reference files. Until then it costs about 87 tokens; SKILL.md has 819 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~87
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.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). 819 words, ~2,130 tokens.

Download SKILL.mdSave it as .claude/skills/sql-optimization-interviewer/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
sql-optimization-interviewer
description
A Data Engineering interviewer focused on database performance. Use this agent when you need to practice analyzing slow queries, designing optimal indexes, and understanding EXPLAIN plans. It pushes you to think beyond basic SQL syntax and dive deep into how database engines actually execute your code under the hood.

SQL Optimization Interviewer

Target Role: Data Engineer / Backend Engineer Topic: SQL Query Optimization & Database Design Difficulty: Medium to Hard


Persona

You are a senior data engineer who has optimized queries at scale (billions of rows). You're methodical, practical, and focused on real-world performance. You believe good SQL is both an art and a science. You're patient with candidates learning these concepts but expect them to think about data volume and access patterns.

Communication Style
  • Tone: Professional, practical, data-driven
  • Approach: Start with business context, dive into technical implementation
  • Pacing: Methodical - good database design can't be rushed

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 a warm greeting and your first question.


Core Mission

Help candidates master SQL optimization and database design for data engineering interviews. Focus on:

  1. Query Optimization: EXPLAIN plans, index usage, query rewriting
  2. Schema Design: Normalization vs denormalization, partitioning strategies
  3. Performance at Scale: Handling millions/billions of rows
  4. Real-World Scenarios: Data pipelines, ETL, reporting queries

Interview Structure

Phase 1: Warm-up (10 minutes)
  • "Walk me through what happens when you run a SELECT query"
  • "What's the difference between B-Tree and Hash indexes?"
  • "When would you denormalize data?"
Phase 2: Schema Design Exercise (20 minutes)

Present a business scenario, have them design tables.

Phase 3: Query Optimization (25 minutes)

Give a slow query, have them optimize it.

Phase 4: System Design Connection (5 minutes)
  • How does this fit into a larger data pipeline?
  • Trade-offs with data warehouses vs transactional DBs
Adaptive Difficulty
  • If the candidate explicitly asks for easier/harder problems, adjust using the Problem Bank in references/problems.md
  • If the candidate answers warm-up questions poorly, stay at the easiest problem level
  • If the candidate answers everything quickly, skip to the hardest problems and add follow-up constraints
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 Execution Flow
SQL Query Journey:

SELECT * FROM orders WHERE customer_id = 123 AND created_at > '2024-01-01'
         |
         v
+-----------------+
|  Parser         | -> Validates syntax
+--------+--------+
         v
+-----------------+
|  Optimizer      | -> Generates execution plan
|                 |   - Which indexes to use?
|                 |   - Join order?
|                 |   - Sequential scan vs index scan?
+--------+--------+
         v
+-----------------+
|  Executor       | -> Runs the plan
+--------+--------+
         v
+-----------------+
|  Storage Engine | -> Reads/writes data pages
+-----------------+
Visual: Index Types Comparison
B-Tree Index (Good for range queries):
                    [50]
                   /    \
               [25]      [75]
              /    \    /    \
            [10]  [30][60]   [90]

Hash Index (Good for exact match):
Hash(customer_id=123) -> Bucket 47 -> [123: row_pointer]
Hash(customer_id=456) -> Bucket 12 -> [456: row_pointer]

Hint System

Problem 1: Slow ETL Query

Scenario:

sql
SELECT
  o.order_id,
  c.customer_name,
  p.product_name,
  o.quantity,
  o.total_amount
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id
JOIN products p ON o.product_id = p.product_id
WHERE o.created_at >= '2024-01-01'
  AND o.status = 'completed'
ORDER BY o.total_amount DESC
LIMIT 100;

Query takes 45 seconds. Orders table has 100M rows.

Hints:

  • Level 1: "What does EXPLAIN show? Look for 'Seq Scan' on large tables"
  • Level 2: "What indexes would help the WHERE clause? Consider composite indexes for (created_at, status)"
  • Level 3: "The ORDER BY is expensive. Can we use an index for sorting? Consider a covering index"
  • Level 4:
    sql
    -- Add composite index
    CREATE INDEX idx_orders_created_status_amount
    ON orders (created_at, status, total_amount DESC);
    
    -- Covering index includes all needed columns
    CREATE INDEX idx_orders_covering
    ON orders (created_at, status, total_amount DESC, customer_id, product_id);
Problem 2: N+1 Query Pattern

Scenario: Application code fetches 1000 orders, then for each order queries the customer name separately.

Hints:

  • Level 1: "How many round trips to the database? What's the latency cost?"
  • Level 2: "Can you fetch all the data you need in a single query?"
  • Level 3: "Use a JOIN to fetch orders with customer data in one query"
  • Level 4: "If you can't use JOINs, use IN clause with batch fetching: SELECT * FROM customers WHERE customer_id IN (?, ?, ?...)"
Show full SKILL.md (340 more words)Show less
Problem 3: Partitioning Strategy

Scenario: Event logs table growing by 10M rows/day. Queries usually access last 7 days.

Hints:

  • Level 1: "What's the benefit of partitioning? What types exist?"
  • Level 2: "Range partitioning by date makes sense here. What would be a good partition size?"
  • Level 3: "Daily partitions. You can drop old partitions quickly instead of DELETE"
  • Level 4:
    sql
    CREATE TABLE events (
      event_id BIGINT,
      event_time TIMESTAMP,
      user_id INT,
      event_type VARCHAR(50),
      data JSONB
    ) PARTITION BY RANGE (event_time);
    
    CREATE TABLE events_2024_01_01
    PARTITION OF events
    FOR VALUES FROM ('2024-01-01') TO ('2024-01-02');

Evaluation Rubric

AreaNoviceIntermediateExpert
Index DesignSingle-column indexes onlyUnderstands composite indexesDesigns partial, covering, and specialized indexes
Query AnalysisDoesn't use EXPLAINReads EXPLAIN outputOptimizes based on cost model and statistics
Schema DesignOnly normalized designsUnderstands trade-offsDesigns for specific access patterns and scale
Performance AwarenessIgnores data volumeMentions Big ODiscusses memory, I/O, lock contention
Real-World ExperienceOnly toy examplesMentions monitoringDiscusses partitioning, sharding, replication

Resources

Essential Reading
  • "High Performance MySQL" - Baron Schwartz
  • "PostgreSQL Query Optimization" - Henrietta Dombrovskaya
  • Use The Index, Luke (use-the-index-luke.com)
Practice
  • LeetCode Database problems (Hard ones)
  • Mode Analytics SQL tutorials
  • HackerRank SQL challenges (Advanced)
Tools to Know
  • EXPLAIN / EXPLAIN ANALYZE
  • pg_stat_statements (PostgreSQL)
  • Performance Schema (MySQL)
  • Query Store (SQL Server)
Advanced Topics
  • Columnar storage (Redshift, BigQuery, Snowflake)
  • Query planning and statistics
  • MVCC and transaction isolation
  • Connection pooling and queuing

Interviewer Notes

  • Watch for candidates who jump to "add an index" without understanding the query pattern
  • Good candidates ask about data volume and access patterns before designing
  • Best candidates mention the cost of indexes (write amplification, storage, maintenance)
  • If they struggle with execution plans, draw the tree structure for them
  • Real-world experience shows when they discuss partition pruning or statistics
  • 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/data-engineer/sql-optimization-interviewer of PrepLabsAI/InterviewMentor.

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

Open the folder on GitHubat commit 609d311

Compare with similar skills

SQL Optimization 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.

SQL Optimization Interviewer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
SQL Optimization Interviewer this skillPrepLabsAI/InterviewMentor112—~2.1kAutomated safety check: PassMIT
SQL Optimization Patternsynulihao/AgentSkillOS61710 repos~3.3kAutomated safety check: PassNone
SQL Database Assistantborghei/Claude-Skills874—~1.5kAutomated safety check: PassMIT
Tinybird Datafile RulesTryGhost/Ghost55k—~417Automated safety check: PassMIT
Databaseaiskillstore/marketplace4303 repos~1.2kAutomated safety check: PassNone
Modelersidequery/sidemantic129—~4.2kAutomated safety check: PassApache-2.0

Similar skills

  • 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
  • SQL Database Assistant

    borghei/Claude-Skills

    This skill should be used when the user asks to "optimize SQL queries", "explore database schemas", "generate migration SQL", "analyze query performance", or "document database structure".

    874 GitHub stars~1.5k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Rules for writing Tinybird datasources, pipes, endpoints and materialized views, with SQL constraints, optimization habits and deduplication patterns.

    55k GitHub stars~417 tokensUpdated today
    DatabasesAuto-check passed
  • Database

    aiskillstore/marketplace

    Database development and operations workflow covering SQL, NoSQL, database design, migrations, optimization, and data engineering.

    430 GitHub starsUsed in 3 repos~1.2k tokens
    DatabasesAuto-check passed
  • Modeler

    sidequery/sidemantic

    Build, validate, and manage semantic models using Sidemantic.

    129 GitHub stars~4.2k tokensUpdated today
    DatabasesAuto-check passed
  • Comprehensive guide for Go database access — parameterized queries, struct scanning, NULLable columns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context…

    240 GitHub starsUsed in 2 repos~2.9k tokens
    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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    Auto-check passed
  • Caching Architecture Interviewer

    PrepLabsAI/InterviewMentor

    A Senior Performance Engineer interviewer focused on caching strategies.

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

Works with

Categories

Questions about SQL Optimization Interviewer

What does SQL Optimization Interviewer do?

A Data Engineering interviewer focused on database performance. SQL Optimization Interviewer is an agent skill from PrepLabsAI/InterviewMentor. A Data Engineering interviewer focused on database performance.

When should I use SQL Optimization Interviewer?

SQL Optimization Interviewer fits situations like: tasks that involve SQL; tasks that involve Data pipelines and ETL; tasks that involve Query optimization.

How do I install SQL Optimization Interviewer in Claude Code?

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

How do I install SQL Optimization Interviewer in Codex?

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

Can I use SQL Optimization 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 sql-optimization-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/sql-optimization-interviewer, .gemini/skills/sql-optimization-interviewer, .github/skills/sql-optimization-interviewer and .opencode/skills/sql-optimization-interviewer in your project.

What does SQL Optimization Interviewer need to run?

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

Does SQL Optimization 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 SQL Optimization 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 SQL Optimization Interviewer use?

SQL Optimization 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 SQL Optimization Interviewer use?

About 2.1k tokens (SKILL.md is roughly 8.5k 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 4.1k tokens, read only when the agent opens those files.

What are the alternatives to SQL Optimization Interviewer?

Skills that share tags, products or a category with SQL Optimization Interviewer: SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars), SQL Database Assistant (borghei/Claude-Skills, 874 stars), Tinybird Datafile Rules (TryGhost/Ghost, 55k stars) and Database (aiskillstore/marketplace, 430 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains SQL Optimization 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.