Cracking ML Interviews

Open in the interactive study hub

Coding Challenges for ML, AI, Python, and SQL Interviews

This track is for interview rounds where you are asked to code, not just explain concepts.

It complements the rest of the repo by focusing on:


What to Practice First

Python coding rounds

Prioritize these topics in order:

  1. Arrays, strings, hash maps, sets
  2. Sorting, heaps, binary search
  3. Stacks, queues, recursion
  4. Trees and graphs with BFS and DFS
  5. Sliding window, two pointers, prefix sums
  6. Dynamic programming basics
  7. Matrix and tabular manipulation patterns
  8. Practical data-processing utilities in Python

SQL coding rounds

Prioritize these topics in order:

  1. SELECT, WHERE, GROUP BY, HAVING
  2. Joins and null handling
  3. Window functions
  4. CTEs and layered query design
  5. Deduplication and ranking
  6. Time-series aggregation and date bucketing
  7. Funnel, retention, and cohort patterns
  8. Performance reasoning and data-model awareness

How This Connects to the Rest of the Repo

Use this track with these concept-heavy guides:

Why these matter:


Interview Patterns by Role

Role Likely coding focus What to master
ML Engineer Python, arrays, metrics, data transforms hash maps, heaps, matrices, feature logic, complexity
AI / Applied AI Engineer Python, APIs, parsing, async workflows strings, recursion, queues, graph traversal, data shaping
Data Engineer SQL and Python scripting joins, windows, CTEs, dedup, batching, file transforms
Analytics Engineer SQL-heavy aggregations, windows, date logic, dbt-style layered queries
MLOps / Platform Python and systems-flavored coding queues, retries, parsing, state handling, complexity trade-offs

Practice Strategy

30-minute Python block

  1. Solve one easy-to-medium array or string problem
  2. Solve one medium graph, heap, or interval problem
  3. Review complexity and edge cases out loud

30-minute SQL block

  1. Write one aggregation query
  2. Write one window-function query
  3. Rewrite one query with a cleaner CTE structure

Weekly review


What Good Interview Performance Looks Like

You do not need the fanciest solution first. You need to show:

In practice:


  1. Coding Challenges Overview
  2. Python Coding Challenges
  3. SQL Coding Challenges

Quick Self-Assessment

You are in good shape if you can do the following without much hesitation:

If not, start with the two practice guides in this track and follow the linked concept guides.


Guides in This Track

Every guide in coding_challenges/. Start with the overview above, then work through these.

View or edit this guide on GitHub