Django interviews test MVT fluency, ORM performance, security defaults, and production judgment—not memorizing every setting name.
High-frequency topics
- MVT flow, project vs app, URL routing, middleware order
- ORM: QuerySet laziness, select_related/prefetch_related, N+1 problem
- Migrations: makemigrations/migrate, deployment strategy
- Auth, CSRF, XSS, SQL injection prevention via ORM
- FBV vs CBV, ModelForm vs Serializer
- Caching, signals (use sparingly), testing with Client
How to answer well
Structure responses: definition → how you used it → trade-off. Example: "I'd use select_related on ForeignKey list views to avoid N+1; for M2M I'd prefetch_related."
Important interview questions and answers
- Q: Explain a Django request lifecycle.
A: Middleware → URLconf → view → (ORM/template) → response → middleware on way out. - Q: Optimize a slow list page?
A: Profile queries (django-debug-toolbar), add select_related/prefetch_related, indexes, caching, pagination. - Q: Custom user model?
A: Subclass AbstractUser or AbstractBaseUser; set AUTH_USER_MODEL before first migration.
Self-check
- Can you draw MVT flow from memory?
- How would you explain N+1 to a junior dev?
Interview: Practice whiteboarding one list view: URL → view → queryset with select_related → template context → mention N+1 if you skip optimization.
Interview prep
- Must-know Django interview topics?
MVT lifecycle, ORM optimization, migrations, CSRF/auth, middleware, testing, DEBUG/production settings, and FBV vs CBV trade-offs.