Interview Q&A · questions with model answers

SQL & Databases Interview Questions

Part of the study plan for: Backend Engineer · Full Stack Engineer · Data Engineer

Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.

  1. SQL interview: explain UNION vs UNION ALL.

    UNION dedupes; UNION ALL keeps duplicates and is cheaper.

  2. SQL interview: explain EXISTS vs IN.

    EXISTS often efficient for existence checks; NULL pitfalls with IN.

  3. Data modeling: surrogate vs natural keys?

    Surrogates stable; naturals meaningful but can change.

  4. Data modeling: OLTP vs OLAP?

    Transactional point queries vs analytical scans/aggregations.

  5. Indexing/performance: sequential vs index scan?

    Planner chooses based on selectivity/stats.

Was this page helpful?

Report a mistake