Django’s “batteries included” approach is powerful and easy to misuse. These questions check whether a candidate understands the ORM and request cycle.
Hiring a Django developer is easy. Telling a real one from a convincing résumé is the hard part — and it’s most of what we do. These are grouped by level, because the same question that stretches a junior is a warm-up for a senior.
Junior Django interview questions
0–2 years
MTV and the ORM.
What is Django’s MTV architecture?
Model, Template, View — Django’s take on MVC where the “view” is the controller and templates render output.
Confuses Django’s view with a traditional MVC view.
What is the Django ORM?
An abstraction mapping models to tables with a queryset API for querying without raw SQL.
Writes raw SQL for routine queries.
What are migrations?
Auto-generated, version-controlled schema changes applied incrementally and reproducibly.
Edits the database manually.
What is the difference between a project and an app?
A project is the whole site’s config; apps are reusable, focused components within it.
Puts everything in one giant app.
What are querysets and are they lazy?
Lazy, chainable representations of database queries that only hit the DB when evaluated.
Evaluates a queryset repeatedly, firing extra queries.
What is the Django admin?
An auto-generated CRUD interface for models, useful for internal tooling.
Exposes the admin publicly with weak controls.
What are model fields and validators?
Field types define columns and basic constraints; validators enforce rules before saving.
Trusts input and skips validation.
What is settings.py and how do you manage secrets?
Central configuration; secrets should come from environment variables, not be committed.
Commits SECRET_KEY and DB passwords.
Mid-level Django interview questions
2–5 years
Queries, middleware and DRF.
How do you avoid N+1 queries in Django?
select_related for foreign keys and prefetch_related for many-to-many/reverse relations.
Loops over objects accessing related fields lazily.
What is middleware?
Hooks that process every request/response for cross-cutting concerns like auth, sessions and security headers.
Duplicates cross-cutting logic in every view.
What is the difference between function and class-based views?
Function views are explicit and simple; class-based views offer reuse via mixins for common patterns.
Copies the same view logic repeatedly.
How does Django REST Framework structure an API?
Serializers validate and transform data, viewsets/generic views handle CRUD, and routers wire URLs.
Hand-rolls JSON and validation in views.
How do transactions work in Django?
atomic() blocks ensure all-or-nothing operations; understanding autocommit avoids partial writes.
Performs multi-step writes with no transaction.
What are signals and their tradeoffs?
Decoupled hooks fired on events (e.g. post_save); convenient but can hide control flow and hurt debuggability.
Overuses signals until data flow is untraceable.
How does authentication and permissions work?
Built-in auth, sessions/tokens, and permission classes to control access at the view level.
Checks permissions inconsistently or not at all.
How do you handle static and media files?
Static files are collected and served by a CDN/web server; user uploads (media) are stored separately, often in object storage.
Serves user uploads from the app in production.
Senior Django interview questions
5+ years
Performance, scaling and design.
How do you profile and optimise Django performance?
Query counts and timing (Django Debug Toolbar/APM), fixing N+1s, adding indexes, caching, and using only/defer.
Optimises with no query visibility.
How do you scale Django horizontally?
Stateless app servers behind a load balancer, cache and sessions in Redis, a task queue (Celery), and read replicas.
Keeps state in-process and can’t scale out.
When and how do you use caching?
Per-view, template-fragment and low-level caching with a shared backend and deliberate invalidation.
Caches without invalidation and serves stale pages.
How do you handle background tasks?
Celery or similar with a broker for async and scheduled work, with retries and monitoring.
Runs slow work in the request or via fragile cron scripts.
How do you keep large Django projects maintainable?
App boundaries by domain, service/selector layers, fat models kept in check, and thorough tests.
Business logic scattered across views and signals.
How do you secure a Django app?
Use the ORM (parameterised), keep CSRF/security middleware on, escape templates, and manage secrets and permissions carefully.
Disables security middleware to fix a bug.
How do you run zero-downtime migrations?
Backward-compatible changes, add-then-backfill, concurrent index creation, and decoupling schema from data changes.
Runs a blocking schema change during peak traffic.
How does async support in Django work and when to use it?
ASGI and async views help with high-concurrency I/O like websockets; not a blanket speed-up for CPU-bound work.
Expects async to make everything faster.
Build and score a full interview with our free interview scorecard tool, browse the full question hub, or see how we interview engineers.