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.

62 Moderate Memory Python

What problems do circular references cause?

Short take Full answer on next page

Simple meaning

Cycles delay reclamation until GC runs, which can retain large graphs longer than you expect.

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

Read full answer Example · Mistake · Say this
64 Moderate Dunder Methods Python

When should you implement __repr__ versus __str__?

Short take Full answer on next page

Simple meaning

__repr__ should be unambiguous and, if practical, look like a constructor call for debugging.

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

Read full answer Example · Mistake · Say this
66 Moderate Dunder Methods Python

What do __getitem__ and __iter__ enable on a custom class?

Short take Full answer on next page

Simple meaning

__getitem__ implements indexing and slicing, and if it raises IndexError, for-loops can treat the object as a sequence.

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

Read full answer Example · Mistake · Say this
68 Moderate itertools Python

When do you use itertools.chain and islice?

Short take Full answer on next page

Simple meaning

chain concatenates iterables without building an intermediate list, useful when merging query results you already have as iterators.

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

Read full answer Example · Mistake · Say this
70 Moderate asyncio Python

What is the asyncio event loop responsible for?

Short take Full answer on next page

Simple meaning

The loop schedules ready callbacks and coroutines, waits on sockets, and resumes them when I/O completes.

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

Read full answer Example · Mistake · Say this
71 Moderate Python Python

What are *args and **kwargs?

Short take Full answer on next page

Simple meaning

args collects extra positional arguments as a tuple.

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

Read full answer Example · Mistake · Say this
72 Moderate Python Python

What is a generator in Python?

Short take Full answer on next page

Simple meaning

A generator yields values lazily with yield instead of building a full list in memory.

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

Read full answer Example · Mistake · Say this
73 Moderate Django Python

What is Django MTV or MVT?

Short take Full answer on next page

Simple meaning

Model talks to the database, View holds request logic, Template renders HTML.

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

Read full answer Example · Mistake · Say this
74 Moderate Django Python

What does Django ORM do?

Short take Full answer on next page

Simple meaning

ORM maps Python model classes to tables and builds SQL for you.

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

Read full answer Example · Mistake · Say this
76 Moderate Python Python

What is the GIL in CPython?

Short take Full answer on next page

Simple meaning

The Global Interpreter Lock allows only one thread to execute Python bytecode at a time in a process.

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

Read full answer Example · Mistake · Say this
77 Moderate Python Python

What is functools.lru_cache for?

Short take Full answer on next page

Simple meaning

It memoizes pure functions with a size limit.

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

Read full answer Example · Mistake · Say this
78 Moderate Django Python

What is select_for_update?

Short take Full answer on next page

Simple meaning

It locks rows inside a transaction to avoid race updates.

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

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