Python Developer Assessment Template
A ready-to-run Python hiring test covering idioms, async/await, typing, pytest, and framework fluency — with live Python 3.12 execution.
What this template measures
Every skill needed for a python developer hire, covered across MCQ, coding, and essay questions.
Idiomatic Python
Pythonic patterns, comprehensions, context managers, generators.
Typing + Static Analysis
Type hints, Protocols, generics, Pydantic, mypy fluency.
Async / Concurrency
async/await, asyncio patterns, threading vs multiprocessing.
Testing
pytest fixtures, parametrize, mocking, coverage.
Framework Knowledge
Django, FastAPI, or Flask depending on stack focus.
Data Work
pandas basics, handling messy real-world data.
Sample questions from this template
A preview of the questions you'll see when you use this template.
Which Python feature produces lazy, iterable output that doesn't materialize the whole sequence in memory?
- A.List comprehension
- B.Generator expression
- C.Dict comprehension
- D.Tuple unpacking
You have CPU-bound work. Which is the best choice to parallelize it across CPU cores?
- A.asyncio.gather
- B.threading.Thread
- C.concurrent.futures.ProcessPoolExecutor
- D.multiprocessing.Queue
Hint: GIL matters here.
Implement `batched(iterable, size)` that yields lists of length `size` from any iterable, with the last batch potentially shorter. Must be lazy — do NOT materialize the whole input.
Given a list of dicts `[{'user_id': ..., 'amount': ...}]`, write a function that returns total amount per user. Use idiomatic Python (no loops that could be replaced with stdlib).
Write an async function `fetch_urls(urls: list[str]) -> list[str]` that fetches all URLs concurrently with a max concurrency of 10. Use aiohttp. Return the text bodies in original URL order. Handle per-request timeout.
Design a Pydantic v2 schema for a Task that has: - id: UUID - title: str (1-100 chars) - tags: list[str] (max 10, each lowercase-only, non-empty) - due_at: datetime (must be future-dated on creation) - estimated_hours: float (> 0 and <= 200) Write one test case that demonstrates validation failure for each rule.
When should you reach for `dataclasses`, `TypedDict`, and `Pydantic BaseModel`? Give one concrete use case for each and explain the tradeoff.
Scoring rubric
How candidates are evaluated on this template.
Frequently asked questions
Does this template include Django/FastAPI/Flask questions?+
By default the template is framework-neutral. Two framework-specific variants are available (Django-focused and FastAPI-focused) — pick the one matching your stack.
What Python version is used in the runtime?+
Python 3.12 with common deps (requests, pandas, pydantic, pytest, aiohttp, httpx) preinstalled.
Can I customize this template?+
Yes. Every question, time limit, weighting, and rubric dimension is fully editable. Use the template as a starting point and tailor it to your role and seniority level.
Does this template include AI cheat detection?+
Yes. All ClarityHire assessment templates ship with code coherence AI, keystroke biometrics, and paste detection enabled by default. You can dial integrity level per role.
Related assessment templates
Other role-specific templates you might want to customize.
Launch Your Python Assessment Today
Customize this template and invite candidates in minutes.