roadmap
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
Prepare for Django REST framework interviews, from how serializers validate and shape data to how viewsets and routers serve it. Covers auth and permissions, pagination, query cost and API tests.
258 of 258 questions in your plan: 0 known, 0 in progress, 0 due, 0 skipped, 258 new. 0 cut, outside your plan.
Django REST framework seldom gets a round to itself. It turns up inside a Python backend loop: in an exercise where you extend a small API, and in the technical conversation afterwards, where the interviewer picks through what you wrote. The prompts are small and concrete: a `ModelViewSet` that returns every customer's orders to whoever asks, a list endpoint whose query count grows with the page size, a hand-written `patch` handler that rejects a one-field update because its serializer was built without `partial=True`. Two kinds of follow-up do most of the sorting. The first asks where a rule belongs: field checks in `validate_<field>`, the owner stamped in `perform_create`, row scoping in `get_queryset` rather than in a permission class. Answering those is the entry bar. The second starts from a symptom and asks which default produced it. A view nobody configured admits anonymous callers, because the default permission is `AllowAny`. `has_object_permission` is never consulted on a list. A session-authenticated `POST` without a CSRF token comes back 403. A throttle counted in a per-process cache lets every worker keep its own tally. Senior candidates are also expected to price what they propose: the query a `SerializerMethodField` runs per row, the stable, unique ordering cursor pagination depends on, and one exception handler that keeps every error body the same shape.
The plan opens on REST rather than on the framework, because the framework's defaults encode REST choices. [Resource and URI design](/topics/proto-rest-resources-uris) is what a router turns into list and detail routes, and the [PUT, PATCH and POST](/topics/proto-rest-http-verbs-status-codes-put-patch-post) distinction is what separates `update` from `partial_update` on a viewset. Data shape comes next: why a [transfer model stays apart from the domain object](/topics/be-web-frameworks-concepts-serialization-transfer-models), what over-posting lets in and a careless output lets out, then [serializers](/topics/be-drf-serializers), DRF's answer to both. Serializers precede [views and routers](/topics/be-drf-views) because every generic view is configured with one. Query cost sits straight after, since the problem appears only when a nested serializer meets a view's queryset: it starts from [where per-row queries come from](/topics/be-orm-concepts-n-plus-one-symptoms) and ends on Django's [`select_related` and `prefetch_related`](/topics/be-django-orm-performance-related-loading). The plan then turns from the data to the caller. Credentials come first: [where a token or session travels](/topics/be-authz-tokens-storage-transport), why Django's [CSRF check](/topics/be-django-security-csrf) follows session authentication into the API, the [JWT](/topics/proto-jwt) format, which DRF leaves to third-party packages, and how a refresh token is rotated and revoked. Access follows, because permission and throttle classes read the `request.user` that authentication set. The model codenames `DjangoModelPermissions` checks, [filtered listings](/topics/be-authz-access-control-filtered-listing) that scope rows in the query rather than after the page is fetched, and what a throttle rate actually counts all come before DRF's own [authentication, permission and throttle classes](/topics/be-drf-access), so each class arrives with its reason. The next stretch is what a client sees on the wire. Paging and filtering grammar, versioning schemes and [error design](/topics/proto-rest-errors) come as design questions first, with body parsing and Accept-driven rendering, before [DRF's pagination, filter, renderer and exception classes](/topics/be-drf-contract) that implement them. The plan closes on proof and description: [OpenAPI](/topics/proto-openapi) as a format, then [DRF's test client and schema generation](/topics/be-drf-quality), which exercise and document everything above.
If you already build Django sites and DRF is the new part, read the plan top to bottom with study order switched to by topics; the serializer and view modules carry most of the vocabulary later answers lean on. With only a few evenings before the interview, put them into serializers, views and access control, drilled with importance raised to must know and the default by-frequency order. Candidates aiming at senior roles get the most from the query-cost, access and wire-contract stretches, where follow-ups arrive as production symptoms rather than definitions. The plan reaches into Django only where DRF depends on it: related-object loading, permission codenames and CSRF. Models and migrations, the admin, templates, Django's own test case classes and the Ninja alternative are on the [Django roadmap](/roadmaps/django), which is also the place to start if Django itself is new to you. REST beyond what DRF implements, such as hypermedia, conditional requests and deprecation policy, belongs to the [API Design roadmap](/roadmaps/api-design).
Django REST framework seldom gets a round to itself. It turns up inside a Python backend loop: in an exercise where you extend a small API, and in the technical conversation afterwards, where the interviewer picks through what you wrote. The prompts are small and concrete: a ModelViewSet that returns every customer's orders to whoever asks, a list endpoint whose query count grows with the page size, a hand-written patch handler that rejects a one-field update because its serializer was built without partial=True.
Two kinds of follow-up do most of the sorting. The first asks where a rule belongs: field checks in validate_<field>, the owner stamped in perform_create, row scoping in get_queryset rather than in a permission class. Answering those is the entry bar. The second starts from a symptom and asks which default produced it. A view nobody configured admits anonymous callers, because the default permission is AllowAny. has_object_permission is never consulted on a list. A session-authenticated POST without a CSRF token comes back 403. A throttle counted in a per-process cache lets every worker keep its own tally. Senior candidates are also expected to price what they propose: the query a SerializerMethodField runs per row, the stable, unique ordering cursor pagination depends on, and one exception handler that keeps every error body the same shape.
The plan opens on REST rather than on the framework, because the framework's defaults encode REST choices. Resource and URI design is what a router turns into list and detail routes, and the PUT, PATCH and POST distinction is what separates update from partial_update on a viewset. Data shape comes next: why a transfer model stays apart from the domain object, what over-posting lets in and a careless output lets out, then serializers, DRF's answer to both. Serializers precede views and routers because every generic view is configured with one.
Query cost sits straight after, since the problem appears only when a nested serializer meets a view's queryset: it starts from where per-row queries come from and ends on Django's select_related and prefetch_related.
The plan then turns from the data to the caller. Credentials come first: where a token or session travels, why Django's CSRF check follows session authentication into the API, the JWT format, which DRF leaves to third-party packages, and how a refresh token is rotated and revoked. Access follows, because permission and throttle classes read the request.user that authentication set. The model codenames DjangoModelPermissions checks, filtered listings that scope rows in the query rather than after the page is fetched, and what a throttle rate actually counts all come before DRF's own authentication, permission and throttle classes, so each class arrives with its reason.
The next stretch is what a client sees on the wire. Paging and filtering grammar, versioning schemes and error design come as design questions first, with body parsing and Accept-driven rendering, before DRF's pagination, filter, renderer and exception classes that implement them. The plan closes on proof and description: OpenAPI as a format, then DRF's test client and schema generation, which exercise and document everything above.
If you already build Django sites and DRF is the new part, read the plan top to bottom with study order switched to by topics; the serializer and view modules carry most of the vocabulary later answers lean on. With only a few evenings before the interview, put them into serializers, views and access control, drilled with importance raised to must know and the default by-frequency order. Candidates aiming at senior roles get the most from the query-cost, access and wire-contract stretches, where follow-ups arrive as production symptoms rather than definitions.
The plan reaches into Django only where DRF depends on it: related-object loading, permission codenames and CSRF. Models and migrations, the admin, templates, Django's own test case classes and the Ninja alternative are on the Django roadmap, which is also the place to start if Django itself is new to you. REST beyond what DRF implements, such as hypermedia, conditional requests and deprecation policy, belongs to the API Design roadmap.