Python track

Python 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.

228 Qs
101 Moderate ORM Python

What is the N+1 query problem in Django?

Short take

Simple meaning

N+1 happens when you fetch a list, then access a related field per row, issuing one query plus N more.

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

Read full answer Example · Mistake · Say this
102 Moderate ORM Python

What are F() expressions used for?

Short take

Simple meaning

F() references a field value in the database so updates happen in SQL, not in Python.

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

Read full answer Example · Mistake · Say this
103 Moderate ORM Python

What are Q() objects?

Short take

Simple meaning

Q objects let you build complex WHERE clauses with | (OR), & (AND), and ~ (NOT).

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

Read full answer Example · Mistake · Say this
108 Moderate Middleware Python

How do you write custom middleware in current Django?

Short take

Simple meaning

Define a class that takes get_response in __init__ and in __call__ runs pre-logic, calls get_response(request), then post-logic.

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

Read full answer Example · Mistake · Say this
109 Moderate Middleware Python

Why is SecurityMiddleware usually listed first?

Short take

Simple meaning

It should see the raw request early to apply SSL redirects and refuse bad hosts before other layers do work.

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

Read full answer Example · Mistake · Say this
112 Moderate Signals Python

When should you avoid Django signals?

Short take

Simple meaning

Avoid them for core business rules that callers must understand

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

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

What do DRF routers do?

Short take

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
117 Moderate DRF Python

How does pagination work in DRF?

Short take

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
Prev Page 6 of 12 Next
Chat with us