Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Validate a nested order schema

Python data engineering interview problem. Difficulty: intermediate. Pattern: Dictionaries. About 15 minutes. Part of the Pro drill bank.

Orders arrive as nested dicts. A validator should catch a missing required field before the order is written to the warehouse.

Validate a nested order object and report the missing field the tests expect.

Requirements

  • Walk required paths (customer, items, amounts, …).
  • Return the missing field name, or a success sentinel.

Constraints

  • order: a nested dict.

Examples

Input: missing_order_field({'id': '1', 'customer': {'email': 'a@b.c'}, 'items': [{'sku': 'X', 'qty': 1}]}) Output: None This input follows the stated rules and produces this output.

Topics: lakebench, python, nested-structures.

More Python interview questions · All interview problems · Learn data engineering

intermediate

Validate a nested order schema

Interview-style drill: Check that a nested order dict has all required fields at every level, reporting the first missing one.

Validate a nested order object and report the missing field the tests expect.