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.

61 Easy Caching Python

Name a Django cache backend.

Short take Full answer on next page

Simple meaning

LocMemCache is an in-process dict, useful for development only.

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

Read full answer Example · Mistake · Say this
62 Easy Celery Python

What is Celery?

Short take Full answer on next page

Simple meaning

Celery is a distributed task queue.

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

Read full answer Example · Mistake · Say this
64 Easy itertools Python

What is the itertools module?

Short take Full answer on next page

Simple meaning

itertools is a standard-library toolkit of fast, memory-efficient iterators.

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

Read full answer Example · Mistake · Say this
65 Easy itertools Python

What does itertools.count do?

Short take Full answer on next page

Simple meaning

count(start=0, step=1) yields an infinite arithmetic sequence.

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

Read full answer Example · Mistake · Say this
66 Easy asyncio Python

What is asyncio?

Short take Full answer on next page

Simple meaning

asyncio is Python's built-in library for cooperative concurrent I/O using the event loop.

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

Read full answer Example · Mistake · Say this
67 Easy asyncio Python

What does async def mean?

Short take Full answer on next page

Simple meaning

async def defines a coroutine function.

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

Read full answer Example · Mistake · Say this
70 Easy GIL Python

What is the Global Interpreter Lock (GIL)?

Short take Full answer on next page

Simple meaning

The GIL is a mutex in CPython that allows only one thread to execute Python bytecode at a time.

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

Read full answer Example · Mistake · Say this
74 Moderate Data Types Python

What goes wrong with a mutable default argument?

Short take Full answer on next page

Simple meaning

The default object is created once, at function definition, and shared across calls.

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

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

When do threads still help in CPython despite the GIL?

Short take Full answer on next page

Simple meaning

Threads help when they spend time in I/O or in C code that releases the GIL, such as reading sockets, waiting on a database driver, or compressing in zlib.

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

Read full answer Example · Mistake · Say this
79 Moderate Decorators Python

How do you write a decorator that accepts arguments?

Short take Full answer on next page

Simple meaning

Use a nested factory: the outer function takes decorator arguments and returns the real decorator, which returns the wrapper.

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

Read full answer Example · Mistake · Say this
80 Moderate Decorators Python

How can a class act as a decorator?

Short take Full answer on next page

Simple meaning

If a class implements __init__ to receive the function and __call__ to run the wrapper, instances are callable decorators.

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

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