← Applied intuition Interview Insights

Applied intuition·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Applied Intuition technical phone screen for a software engineer role. One meaty coding question about schema validation on nested objects, and they really wanted to see how you handle the edge cases, not just the happy path.

Questions Asked (1)

Q1

Write a helper function called validate(object, required_style) that checks whether a possibly nested object conforms to a given schema. The function should return a boolean plus an explanation when invalid, including the offending path and the reason (missing key, wrong type, etc.). You also need to decide how to handle extra fields, nulls, and arrays, and demonstrate it on a concrete example with fields like name, age, school, and nested attributes.

Algorithms & Data StructuresTechnical Trade-offsSystem Design
Author's notes

This looked like a straightforward type-checker until I started thinking about nested objects.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the schema format and the expected behavior for edge cases like extra fields, nulls, and arrays. Then outline a recursive validation function that traverses the object and schema in parallel, collecting errors with paths. Finally, demonstrate with a concrete example and discuss trade-offs.

Pro tip: Define a clear error object structure (e.g., { valid: false, errors: [{ path, reason }] }) and mention that you'd allow configuration for strictness (e.g., allowExtraFields flag) to make the helper reusable.

1. Clarify requirements and assumptions

Ask about the schema format (e.g., nested objects with type info), whether extra fields are allowed, how to treat null vs undefined, and array handling (e.g., validate each element against a schema).

2. Design the validation algorithm

Plan a recursive function that checks each key in the schema against the object, validating type and recursing into nested objects/arrays. Collect all errors with their paths.

3. Handle edge cases explicitly

Decide on policies for extra fields (ignore or error), nulls (treat as invalid unless schema allows), and arrays (validate each element against a specified schema).

4. Implement and test with an example

Write the function in pseudocode or a language of choice, then demonstrate with a sample object and schema containing name, age, school, and nested attributes, showing both valid and invalid cases.

5. Discuss trade-offs and extensions

Talk about performance (O(n) where n is number of fields), error aggregation vs early exit, and potential extensions like custom validators or async validation.

Key Points to Mention

  • Recursive traversal for nested objects and arrays
  • Error reporting with path (e.g., 'school.name') and reason (missing key, wrong type)
  • Configurable strictness for extra fields (allow or disallow)
  • Handling of null and undefined values (e.g., null is not a valid object)
  • Array validation: schema specifies element type, validate each element
  • Return format: boolean plus detailed errors, or a result object

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.