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.

5 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
13 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
14 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
15 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
17 High DRF Python

In what order does DRF run serializer validation?

Short take Full answer on next page

Simple meaning

to_internal_value runs field-level to_internal_value, then field validators, then validate_<field>, then serializer.validate.

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

Read full answer Example · Mistake · Say this
Chat with us