Welcome to the Python screen.
The question is on your right: Validate Nested JSON Configurations. Read through the requirements first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
Given a JSON string representing a hierarchical model configuration, parse it and validate every nested object. Each node must contain a string field name, a string field type, an object field params, and an optional array field children. Return a list of validation errors using dot-paths such as children[1].params.lr. If the JSON is invalid, return [{"path": "$", "message": "invalid json"}].
def validate_model_config(payload):