PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/System Design/Airtable

Design JSON serialization for circular references

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of deterministic, cross-language JSON serialization and deserialization for object graphs with cycles, including concepts such as cycle detection, stable object identifiers, preservation of shared subobjects, traversal-order determinism, input validation/security, and time/space complexity.

  • hard
  • Airtable
  • System Design
  • Software Engineer

Design JSON serialization for circular references

Company: Airtable

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Onsite

Design a JSON serialization and deserialization strategy that correctly handles circular references between objects (e.g., two dictionaries referencing each other as a 'partner'). Describe how you would: detect cycles; assign and manage stable object identifiers; prevent infinite recursion; preserve shared subobjects versus copying; choose and justify a traversal order (BFS vs. DFS); ensure determinism across runs; support primitives (str, int) and dictionaries; validate and secure the format against malicious inputs; and maintain cross-language compatibility if memory addresses are not stable. Analyze time and space complexity and discuss trade-offs among alternative designs (e.g., reference tables, anchor/alias schemes, or custom schemas).

Quick Answer: This question evaluates understanding of deterministic, cross-language JSON serialization and deserialization for object graphs with cycles, including concepts such as cycle detection, stable object identifiers, preservation of shared subobjects, traversal-order determinism, input validation/security, and time/space complexity.

Related Interview Questions

  • Design a scalable search service with sharding - Airtable (medium)
  • Design an async API with idempotency - Airtable (medium)
  • Design a lazy-initialized connection pool - Airtable (medium)
  • Design a lazy ConnectionPool - Airtable (medium)
Airtable logo
Airtable
Sep 6, 2025, 12:00 AM
Software Engineer
Onsite
System Design
18
0

Design a JSON Serialization/Deserialization Strategy With Cycles and Determinism

You are designing a JSON-based serializer/deserializer for a graph of objects composed of dictionaries and primitives (str, int, float, bool, null). Objects may share subobjects and may contain cycles (e.g., two dictionaries referencing each other via a "partner" key).

Assume memory addresses are not stable across runs/languages, and the format must be readable/writable by multiple languages.

Requirements

Design and justify a strategy that:

  1. Detects cycles and prevents infinite recursion during serialization.
  2. Assigns and manages stable object identifiers (IDs) to preserve object identity.
  3. Preserves shared subobjects (no accidental copying).
  4. Chooses and justifies a traversal order (BFS vs. DFS) and ensures determinism across runs.
  5. Supports primitives and dictionaries (you may mention how lists could be added, but focus on dictionaries and primitives).
  6. Validates and secures the format against malicious inputs.
  7. Maintains cross-language compatibility (IDs cannot be memory addresses).
  8. Analyzes time and space complexity.
  9. Discusses trade-offs among alternative designs (e.g., reference tables, anchor/alias schemes, custom schemas).

Example Context

Two dictionaries reference each other via a partner field:

  • A = {"name": "A", "partner": B}
  • B = {"name": "B", "partner": A}

Describe your on-the-wire JSON format and the algorithms to serialize and deserialize such structures deterministically and safely.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Airtable•More Software Engineer•Airtable Software Engineer•Airtable System Design•Software Engineer System Design
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.