Python full stack engineer interview questions and how to answer them
Python full stack engineer interview questions test whether you can carry one feature from a Python backend to a browser frontend and keep the seam between them clean. Expect questions on API contracts and validation, authentication across a single-page app and an API, async Python, data fetching and forms on the frontend, and how the whole thing is built and deployed. The strongest candidates show they think about both sides at once, such as which errors the UI must handle and which the API should prevent.
By Evin JohnPublished 9 min read
What Python full stack teams are hiring for
Python full stack roles are common in SaaS products, data and machine learning products that need a web interface, and internal platforms. The backend is usually Django with Django REST Framework, FastAPI, or Flask; the frontend is usually React with TypeScript, sometimes Vue or server-rendered templates with a little JavaScript. Interviewers are not looking for two separate specialists in one person. They want someone who can ship a feature without a handoff and who notices problems that live between the layers.
If the posting is stack-neutral, the full stack developer guide covers the general loop. If it is mostly Django maintenance, see the Python Django developer guide. This page focuses on what changes when Python owns the server side of a modern frontend.
How the interview loop is usually built
- Recruiter and hiring manager screensThe stack you used, what you owned, and whether you lean frontend or backend. Be honest about the lean; most people have one.
- Coding roundUsually in Python: data transformation, a small algorithm or a parsing task. Some teams let you choose Python or TypeScript.
- Feature buildA take-home or a live session: build an endpoint and a screen that uses it, such as a filtered list with create and edit.
- Design discussionSketch a feature like file uploads, notifications or a dashboard. Expect questions on where validation, caching and background work live.
- BehavioralOwnership, working with designers and product, and handling production problems.
API contract questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| How do you keep frontend types in sync with the API? | Contract discipline | Generate an OpenAPI schema from the backend and generate TypeScript types or a client from it in CI |
| Where should validation live? | Defense in depth | On the server always; on the client for fast feedback. Use one source of rules where possible |
| What should an error response look like? | Consistency | A stable shape with a code, a human message and field-level errors the form can map to inputs |
| Offset or cursor pagination? | Data at scale | Cursor for feeds and large or changing tables; offset is simpler for small admin lists |
| How do you change an endpoint other clients use? | Versioning | Add fields rather than change them, deprecate with a timeline, or version the route when a break is unavoidable |
| What does FastAPI do with a Pydantic model on a route? | Framework fluency | Parses and validates the body, returns a 422 with details on failure, and feeds the OpenAPI schema |
| How do you avoid over-fetching for a complex screen? | API shape | A purpose-built endpoint or include parameters, with the query cost checked on the server |
A cursor question often turns into code. Here is a small, framework-free version you can explain: encode the sort key of the last row and continue after it, so new rows do not shift pages the way offsets do.
import base64
import json
def encode_cursor(created_at, row_id):
raw = json.dumps([created_at, row_id]).encode()
return base64.urlsafe_b64encode(raw).decode()
def decode_cursor(cursor):
created_at, row_id = json.loads(base64.urlsafe_b64decode(cursor))
return created_at, row_id
def page_after(rows, cursor=None, limit=2):
# rows are sorted newest first by (created_at, id)
if cursor:
key = tuple(decode_cursor(cursor))
rows = [r for r in rows if (r["created_at"], r["id"]) < key]
page = rows[:limit]
next_cursor = None
if len(rows) > limit:
last = page[-1]
next_cursor = encode_cursor(last["created_at"], last["id"])
return page, next_cursor
rows = [
{"id": 5, "created_at": "2026-12-01T10:00"},
{"id": 4, "created_at": "2026-12-01T10:00"},
{"id": 3, "created_at": "2026-11-30T09:00"},
]
first, cur = page_after(rows)
second, end = page_after(rows, cur)
print([r["id"] for r in first], [r["id"] for r in second], end)
# [5, 4] [3] NoneMention the follow-ups: the id breaks ties between rows with the same timestamp, a real database does this with a WHERE clause on an index over both columns, and the cursor is opaque to clients but not secret, so never put permissions in it.
Authentication and security across the stack
- Session cookies or tokens for a single-page app on the same domain? Session cookies marked HttpOnly, Secure and SameSite are often the simpler and safer choice. Tokens suit separate domains, mobile clients and third-party API access.
- If you use cookies, what about CSRF? Cookie auth needs CSRF protection: Django's CSRF token, or a double-submit pattern, plus SameSite. Pure bearer tokens in a header avoid CSRF but raise questions about where the token is stored.
- Why is the browser blocking your API call? CORS. Explain that the server must allow the origin, methods and headers, that credentials need an exact origin rather than a wildcard, and that CORS is not an access control system.
- Where would you store a token in the browser? Memory is safest against XSS but lost on reload; localStorage is readable by any injected script. Many teams pair a short-lived access token with a refresh token in an HttpOnly cookie.
- How do you enforce permissions? On the server for every request. Hiding a button in the UI is a convenience, not a control.
- How do you handle file uploads? For large files, have the API return a pre-signed URL so the browser uploads straight to object storage, then confirm the upload with the API and scan or validate it.
Async Python and background work
- What happens if you call a blocking library inside an async FastAPI route? It blocks the event loop and stalls every request on that worker. Use an async client, a plain def route that runs in a thread pool, or move the work to a queue.
- When is async worth it in Python web code? Many concurrent requests waiting on network I/O, websockets or streaming. It does not speed up CPU-heavy work.
- How would you send live updates to the frontend? Server-sent events for one-way updates, websockets for two-way. Mention reconnection, authentication on connect and how many connections each worker holds.
- Background task in the request or a queue? Short, non-critical work can run after the response; anything that must not be lost, retries or takes long belongs in a queue such as Celery or RQ.
- How do you show progress of a long job in the UI? Return a job id, let the UI poll or subscribe, and store status the API can report, including failure states.
Frontend questions for a Python-first engineer
- How do you manage server data in a React app? Separate server state from UI state, and use a data-fetching library or a small hook layer that handles loading, errors, caching and refetching.
- Walk me through a form that creates a record. Client checks for quick feedback, a submit that disables the button, server errors mapped back to fields, and a clear success state.
- What is an optimistic update and when is it risky? Showing the change before the server confirms. Risky when failure is common or the server may change the data; always handle rollback.
- How do you make a long list fast? Paginate or virtualize, give items stable keys, and avoid recomputing derived data on every render.
- What accessibility basics do you check? Labels on inputs, keyboard navigation, focus after a modal closes, color contrast and meaningful button text.
- How do you test the frontend? Component tests for behavior, a few end-to-end tests for key flows, and API mocking at the network layer rather than inside components.
Data, build and deploy questions
- How do you manage schema changes with SQLAlchemy? Alembic migrations reviewed like code, with autogenerate output checked by hand because it can miss renames or data changes.
- How would you containerize this app? A multi-stage build: one stage builds the frontend bundle, another installs Python dependencies, and the final image holds only what runs.
- How do the frontend and API get served in production? Static assets from a CDN or the proxy, the API behind a reverse proxy, and environment-based config for URLs and secrets.
- What runs in CI for a Python full stack repo? Linting and type checks on both sides, pytest, frontend tests, a schema check that generated types are current, and a build.
- How do you find whether a slow page is a frontend or backend problem? Browser network timings first, then server logs and traces for that request, then the queries behind it.
- How do you handle configuration that differs between the frontend build and the API? Build-time variables only for public values such as the API base URL; secrets stay on the server and are read from the environment at runtime.
- How would you roll out a change that needs a new API field and a new screen? Ship the backend first in a backward-compatible way, then the frontend, optionally behind a feature flag, and remove old paths later.
- Which Python type checking do you use, and does it help at the API boundary? mypy or pyright on the backend, Pydantic or serializers for runtime validation, and generated TypeScript types so both sides fail early when the contract changes.
Fictional example
- I built bulk CSV import for customer contacts. On the backend I used FastAPI with a pre-signed upload to storage, then a Celery job that validated rows with a Pydantic model and wrote them in batches. The API returned a job id and a status endpoint. On the frontend I added an upload screen that polled the status and showed row-level errors as a downloadable file instead of a giant list. The trade-off was choosing polling over websockets, because imports took under a minute and polling was simpler to run. After launch, support tickets about failed imports dropped because people could see exactly which rows were wrong and fix them.
A three-week preparation plan
- Week 1: build a small app with a Python API and a TypeScript frontend: auth, a list with cursor pagination, a create form with server errors mapped to fields.
- Week 2: add file upload with pre-signed URLs, a background job with a status endpoint, generated types from the OpenAPI schema, and tests on both sides.
- Week 3: practice Python coding problems aloud, rehearse two design discussions, and prepare stories about a production bug and a disagreement with design or product.
Full stack interviews jump between layers fast, and it is easy to lose the thread when an interviewer switches from CORS to React state. Natively, an AI interview assistant for Mac and Windows, can read a coding prompt from a screenshot in a practice session and suggest an approach, and it transcribes the mock interview on your computer. Read the transcript back to see whether you explained why, not just what.
Questions people ask
What questions are asked in a Python full stack interview?
Expect Python coding, a feature build that touches backend and frontend, and questions on API contracts, validation, authentication and CORS, async Python, frontend data fetching and forms, and deployment.
Which stack should I know for a Python full stack engineer role?
Usually Django or FastAPI (sometimes Flask) on the backend and React with TypeScript on the frontend, plus SQL, a task queue and containers. Check the job description and prepare its exact stack.
How do I answer "cookies or tokens" in a full stack interview?
For a single-page app on the same site, HttpOnly, Secure, SameSite session cookies with CSRF protection are often simplest. Tokens fit separate domains and mobile clients; explain where you would store them and why.
Is a Python full stack interview harder than a JavaScript one?
Not harder, but different: you switch languages at the API boundary, so interviewers check contracts, types and validation on both sides more closely.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
