docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
{
"context": "This criteria evaluates how well the engineer uses the jsons library to serialize and deserialize Python dataclasses. The focus is on proper usage of jsons.dump() and jsons.load() functions with dataclass instances.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Uses jsons.dump()",
"description": "The serialize_profile function uses jsons.dump() to serialize the UserProfile dataclass instance to a dictionary",
"max_score": 30
},
{
"name": "Uses jsons.load()",
"description": "The deserialize_profile function uses jsons.load() with the UserProfile class as the second argument to deserialize dictionary data into a UserProfile instance",
"max_score": 30
},
{
"name": "Proper dataclass definition",
"description": "The UserProfile class is properly defined as a dataclass with the @dataclass decorator and includes the correct fields (name: str, age: int, email: str, is_active: bool = True)",
"max_score": 20
},
{
"name": "Correct type hints",
"description": "Type hints are correctly specified for the dataclass fields and function signatures, enabling jsons to properly infer types during serialization/deserialization",
"max_score": 10
},
{
"name": "Default value handling",
"description": "The is_active field has a default value of True in the dataclass definition, allowing jsons to handle cases where this field is missing from input data",
"max_score": 10
}
]
}