PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Data Manipulation (SQL/Python)/Applied Intuition

Implement a nested object validator

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency in nested data validation, schema interpretation, and type checking for hierarchical objects, including handling nulls, arrays, extra fields, and clear error reporting.

  • Medium
  • Applied Intuition
  • Data Manipulation (SQL/Python)
  • Software Engineer

Implement a nested object validator

Company: Applied Intuition

Role: Software Engineer

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

Implement a helper function validate(object, required_style) that checks whether a possibly nested object matches a provided schema. The object may contain nested sub-objects (e.g., under keys like "OBJ") and arbitrary key–value pairs; required_style is a dictionary mapping field names to required primitive types (e.g., string, integer) or to nested schemas. The function should return a boolean and, if invalid, an explanation including the offending path and reason (missing key, unexpected type). Define how to treat extra fields (ignore or flag), nulls, and arrays. Demonstrate your approach on an example object containing fields like name, age, school, and nested attributes (e.g., color, height) and show how required_style would be expressed.

Quick Answer: This question evaluates proficiency in nested data validation, schema interpretation, and type checking for hierarchical objects, including handling nulls, arrays, extra fields, and clear error reporting.

Applied Intuition logo
Applied Intuition
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
Data Manipulation (SQL/Python)
7
0

Implement a helper function validate(object, required_style) that checks whether a possibly nested object matches a provided schema. The object may contain nested sub-objects (e.g., under keys like "OBJ") and arbitrary key–value pairs; required_style is a dictionary mapping field names to required primitive types (e.g., string, integer) or to nested schemas. The function should return a boolean and, if invalid, an explanation including the offending path and reason (missing key, unexpected type). Define how to treat extra fields (ignore or flag), nulls, and arrays. Demonstrate your approach on an example object containing fields like name, age, school, and nested attributes (e.g., color, height) and show how required_style would be expressed.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More Applied Intuition•More Software Engineer•Applied Intuition Software Engineer•Applied Intuition Data Manipulation (SQL/Python)•Software Engineer Data Manipulation (SQL/Python)
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.