Python track

Django interview questions and answers

Panel-ready Python & Django questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.

41 Moderate DRF Python

How does a ViewSet differ from GenericAPIView?

Short take Full answer on next page

Simple meaning

GenericAPIView plus mixins gives you get/post handlers and queryset/serializer_class.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
42 Moderate DRF Python

What do DRF routers do?

Short take Full answer on next page

Simple meaning

DefaultRouter and SimpleRouter bind viewset actions to URL patterns including optional trailing slashes.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
44 Moderate DRF Python

How does pagination work in DRF?

Short take Full answer on next page

Simple meaning

Pagination classes split list querysets into pages and add next/previous metadata.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
45 Moderate DRF Python

How do you serialize nested relations in DRF?

Short take Full answer on next page

Simple meaning

Nest a serializer as a field, or use depth on ModelSerializer for read-only trees.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
50 High ORM Python

How does select_for_update help with race conditions?

Short take Full answer on next page

Simple meaning

Inside atomic(), select_for_update() takes a row lock so concurrent transactions wait before modifying the same rows.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
58 High Signals Python

How can signals hurt performance at scale?

Short take Full answer on next page

Simple meaning

Every save() may fan out to many receivers, including ones in third-party apps you forgot about.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
59 High Signals Python

What is surprising about m2m_changed?

Short take Full answer on next page

Simple meaning

It fires with actions such as pre_add, post_add, pre_remove, and post_clear, and pk_set may be None on clear.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
60 High DRF Python

How does DRF throttling work internally?

Short take Full answer on next page

Simple meaning

Throttle classes implement allow_request and wait, typically using a cache key of user id or IP plus a rate such as 100/hour.

Open the full page for Why, Steps, Example and Key takeaway.

Read full answer Example · Mistake · Say this
Prev Page 3 of 4 Next
Chat with us