← Boeing Interview Insights

Boeing·Software Engineer·Technical Phone Screen·Senior

Senior
May 2026

Summary

Boeing full-stack interview that leaned harder into TypeScript internals than I expected. The question felt academic at first but they really wanted to see if you'd actually used this stuff in production, not just read about it.

Questions Asked (1)

Q1

What is the difference between nominal and structural typing, and which approach does TypeScript take by default? Walk through a concrete example where two types are structurally identical but represent different concepts, and show how you would enforce nominal-style type safety in TypeScript.

Technical Trade-offsSystem Design
Author's notes

I knew TypeScript was structural, so I started there.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clearly defining nominal and structural typing, then state that TypeScript uses structural typing by default. Use a concrete example like UserId and OrderId (both strings) to illustrate the risk, and demonstrate how to enforce nominal typing using branding or private fields. Emphasize the trade-offs and practical implications in a safety-critical context like Boeing.

Pro tip: Mention that in safety-critical systems like avionics, nominal typing can prevent unit mix-ups (e.g., meters vs feet), and show how TypeScript's branding technique can be used without runtime overhead.

1. Define nominal and structural typing

Explain that nominal typing requires explicit declarations or inheritance to be compatible, while structural typing only cares about the shape of the data. Give a brief example of each.

2. State TypeScript's default

Clarify that TypeScript uses structural typing by default, meaning types are compatible if their members are compatible, regardless of their names or origins.

3. Provide a concrete example

Show two types that are structurally identical but represent different concepts, such as UserId and OrderId, both aliases for string. Explain how TypeScript would allow assigning one to the other, which could lead to bugs.

4. Enforce nominal-style safety

Demonstrate how to simulate nominal typing in TypeScript using branding (e.g., type UserId = string & { __brand: 'UserId' }) or private fields in classes. Show how this prevents accidental mixing.

5. Discuss trade-offs and context

Mention that while nominal typing adds safety, it can introduce complexity and boilerplate. In domains like aerospace, the extra safety is often worth it.

Key Points to Mention

  • Nominal typing is based on explicit declarations (e.g., Java, C#), while structural typing is based on shape (e.g., TypeScript, Go).
  • TypeScript uses structural typing by default, which can lead to unintended type compatibility.
  • Example: UserId and OrderId both as string aliases are interchangeable structurally.
  • Branding technique: intersection with a unique marker property to create nominal-like types.
  • Alternative: use classes with private fields to enforce nominal typing.
  • Trade-offs: nominal typing improves safety but may increase verbosity; structural typing offers flexibility but can hide logical errors.

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