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.

Duration
60 minutes
Questions
12
Level
Mid-Level
Passing Score
70%

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.

Multiple ChoiceEasyQuestion 1

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
Multiple ChoiceMediumQuestion 2

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.

CodingMediumPythonQuestion 3

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.

CodingMediumPythonQuestion 4

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

CodingHardPythonQuestion 5

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.

CodingHardPythonQuestion 6

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.

EssayMediumQuestion 7

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.

Dimension
Description
Weight
Correctness
Passes test cases without edge-case regressions.
40%
Pythonic Style
Uses stdlib idioms (itertools, collections, comprehensions) appropriately.
20%
Typing
Type hints, Protocols, and narrowing used correctly.
15%
Async Correctness
Handles concurrency, timeouts, and error propagation correctly.
15%
Testing Intuition
Writes meaningful pytest cases with good coverage.
10%

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.

Launch Your Python Assessment Today

Customize this template and invite candidates in minutes.