API performance
N+1 queries, pooling, caching and p99.
Your progress
L1 · 0 of 10L2 · 0 of 20L3 · 0 of 10L4 · 0 of 1
Next
Level 1 · 10 questions. Begin with what gets asked in the first ten minutes. Levels 2 to 4 build on it.
Level 1First ten minutesTwo-sentence answers to what gets asked first.
API latency optimization: from 800 ms to 250 ms, step by step
- 1.1Compress with gzip or brotliReview againNext1 min
- 1.2No SELECT *Must‑knowReview againNext1 min
- 1.3Paginate and return only needed fieldsMust‑knowReview againNext1 min
- 1.4Rerun the same load test against the baselineReview againNext1 min
- 1.5Why percentiles and not the average?Must‑knowReview againNext1 min
Clustered vs nonclustered indexes: SQL interview answers
- 2.1What happens when you search for a row without an index?Must‑knowReview againNext1 min
- 2.2What is a clustered index?Must‑knowReview againNext1 min
- 2.3Why not add an index for every query?Must‑knowReview againNext1 min
SQL CROSS JOIN cardinality
SQL grouping and group filters
- 4.1How do GROUP BY and HAVING differ, and where does WHERE fit?Must‑knowReview againNext2 min
Level 2Daily jobWhat you use at work every week.
API latency optimization: from 800 ms to 250 ms, step by step
- 1.1Cache with ETag and Cache-ControlReview againNext1 min
- 1.2Composite indexes: equality columns first, then rangeMust‑knowReview againNext1 min
- 1.3Connection pooling (HikariCP, PgBouncer)Must‑knowReview againNext1 min
- 1.4Dashboards and alerts for regressionsReview againNext1 min
- 1.5Don't wrap indexed columns in functions in WHEREMust‑knowReview againNext1 min
- 1.6EXISTS instead of IN for large subqueriesReview againNext1 min
- 1.7Find slow queries: pg_stat_statements and EXPLAIN (ANALYZE, BUFFERS)Must‑knowReview againNext2 min
- 1.8Find the bottleneck with APM tracesMust‑knowReview againNext3 min
- 1.9How do you find and fix an N+1 problem?Must‑knowReview againNext3 min
- 1.10How do you make sure an application meets its performance requirements?Must‑knowReview againNext1 min
- 1.11Keyset pagination instead of OFFSETMust‑knowReview againNext1 min
- 1.12Make independent calls in parallelReview againNext1 min
- 1.13Move slow work to a background queueMust‑knowReview againNext1 min
- 1.14Multi-row INSERT or COPY instead of one row at a timeReview againNext4 min
- 1.15OFFSET pagination is slow on page 5,000. Why, and how do you fix it?Must‑knowReview againNext4 min
- 1.16Redis cache-aside for read-often, change-rarely dataMust‑knowReview againNext1 min
- 1.17Remove N+1 queries (fetch joins or batch fetching)Must‑knowReview againNext1 min
- 1.18Set a baseline (k6, JMeter or Locust; p50, p95, p99 and throughput)Must‑knowReview againNext1 min
Clustered vs nonclustered indexes: SQL interview answers
- 2.1What does INCLUDE do, and what makes an index covering?Review againNext1 min
- 2.2What is stored in a nonclustered index?Review againNext1 min
Level 3SeniorProduction trade-offs and failure modes.
API latency optimization: from 800 ms to 250 ms, step by step
- 1.1Check database health (seq_scan, dead tuples, lock waits, buffer hit ratio)Review againNext1 min
- 1.2Covering indexes with INCLUDE (index-only scans)Review againNext1 min
- 1.3Fresh statistics (ANALYZE) and autovacuum tuning against bloatReview againNext1 min
- 1.4Partial indexes for hot subsetsReview againNext1 min
- 1.5Read replicas or partitioning for heavy tablesReview againNext2 min
- 1.6When do you add a cache, and what are the risks?Review againNext7 min
- 1.7Your API p99 went from 200 ms to 2 s. What do you do?Review againNext6 min
Clustered vs nonclustered indexes: SQL interview answers
- 2.1How does this differ in PostgreSQL?Review againNext1 min
- 2.2What is a Key Lookup?Review againNext1 min
PostgreSQL materialized views
- 3.1When is a materialized view useful, and how do you manage staleness?Review againNext2 min
Level 4InternalsHow it works underneath, and at scale.
Clustered vs nonclustered indexes: SQL interview answers
- 1.1Why does a B+ tree lookup on a large table read only a few pages?Review againNext1 min
Each card is a topic. Columns go from Level 1 to Level 4; the outlined card is where you are.