Python across backend, data and automation
Python is three fairly separate job markets — backend web, data and machine learning, and automation — that share a syntax and almost nothing else. Interviews differ sharply between them, so saying you know Python conveys much less than it sounds like.
Assumes you know: Programming fundamentals: variables, loops, functions, Basic command-line use, For the data track, some statistics; for the backend track, SQL and HTTP
Overview
What this area actually covers
Python is a dynamically typed, garbage-collected, interpreted language with an unusually large standard library and an even larger third-party ecosystem. The language itself is small enough to learn in a fortnight. What takes years is the ecosystem, and the ecosystem is not one thing — it splits into three markets that happen to share a syntax.
Backend web means Django, FastAPI or Flask serving HTTP, backed by Postgres, with Celery or a similar worker for background jobs. Data and machine learning means NumPy, pandas or Polars, scikit-learn, PyTorch, and increasingly the orchestration and serving layer around models. Automation, scripting and platform work means glueing systems together: CI pipelines, cloud SDKs, infrastructure tooling, log processing, internal command-line utilities.
These three overlap far less than outsiders assume. A Django engineer of ten years' standing may have never opened a Jupyter notebook. A machine-learning engineer may have no view on how to structure a REST API, and no reason to. The skill that generalises across all three is understanding how the runtime behaves; the libraries do not transfer.
There is one more distinction worth drawing at the outset, because it silently governs a great deal. Python is a language specification with several implementations, and in practice almost everyone means CPython, the reference implementation written in C. Statements about the global interpreter lock, reference counting and C extension modules are statements about CPython rather than about the language. PyPy, a just-in-time compiling implementation, and the various embedded and alternative runtimes behave differently, and the reason they have never taken over is precisely the C extension ecosystem that the reference implementation defines. Knowing that the implementation and the language are separable is the difference between reciting a constraint and understanding one.
What Python is not, for hiring purposes, is the notebook-and-plot activity most people first encounter. That is a genuine use, but it is the shallowest end of a market where the paid work is production systems: data pipelines that must run every night, services that must not fall over, models that must be retrained and redeployed.
Where to go next
Now practise it
22 interview questions in Python, each with the rubric the interviewer is scoring against.
- A context manager written with @contextmanager leaves a lock held whenever the with body raises. What is missing from the generator?
- You put @functools.lru_cache on a method to speed it up, and the service's memory keeps growing. Why, and which fix do you choose?
- An asyncio call times out and you handle the TimeoutError, but the background task keeps running and mutates shared state a few seconds later. What happened, and how do you make the timeout actually stop the work?
- A list of a million small objects uses far more memory than the data inside them. Where is it going?