Skip to content

Dataclasses practice problems in Python

Difficulty:
Category & tags Filters active
Category:
Tag:

Showing 35 of 35

Title Difficulty
Build a Generic Result Type with Ok and Err Hard
Build a JSON Codec for Dataclasses Hard
Build an Event Router with Guards Medium
Build a Registry That Does Not Keep Objects Alive Medium
Build a Task Queue That Keeps Arrival Order for Ties Medium
Build a Typed Factory Fixture Hard
Capstone: Build an Immutable Order Model from Untrusted Data Hard
Check a Class Before You Add slots=True Hard
Check a Version Against a Specifier Medium
Compute Cents from an Amount with __post_init__ Medium
Convert and Validate a Port Number on Assignment Medium
Convert Dataclasses to JSON-Ready Values Hard
Count Visited Cells with a Frozen Dataclass Easy
Diff Two Dataclass Records Field by Field Hard
Find Mutable Defaults That Instances Share Easy
Fix a Dataclass Hierarchy with Keyword-Only Fields Medium
Fix a Slow Join and a Wasteful Top-k Medium
Fix a Version Class That Compares Strings with is Easy
Freeze Nested Data into a Hashable Cache Key Medium
Give Each Task an ID from a ClassVar Counter Easy
Hide Secret Fields When You Print a Record Medium
Merge Settings from a File, the Environment and the Command Line Medium
Parse a Nested Config with Placeholders and Secrets Medium
Parse Untrusted JSON into a Dataclass Hard
Predict Which Dataclasses Are Hashable Hard
Read Settings from Environment Variables Medium
Resolve Dataclass Field Types in Python 3.14 Hard
Simplify Arithmetic Expressions with Class Patterns Medium
Simulate a Pool Shutdown with a Grace Period Hard
Sort Semantic Versions with Prerelease Labels Hard
Sort Version Numbers with a Dataclass Easy
Tell Fields Apart from Class Variables Easy
Turn Outside Data into a Typed Record Easy
Type-Check a Custom Dataclass Decorator with dataclass_transform Hard
Update a Frozen Record with replace() Hard