← Applied intuition Interview Insights

Applied intuition·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Applied Intuition coding round for a software engineer role. The main problem was building a protobuf-style schema parser, which sounds manageable until you get into the recursive size resolution for nested message types.

Questions Asked (1)

Q1

Build a parser that reads a string defining one or more typed messages (each with named fields), then implement a function to return the total byte size of a given message and another to return the type of a specific field. Primitive types have fixed sizes, and fields can reference other defined messages, so size calculation must be recursive.

Algorithms & Data StructuresSystem DesignTechnical Trade-offs
Author's notes

The basic parsing wasn't bad.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the grammar and constraints (e.g., syntax for defining messages, field types, and references). Then outline a two-phase design: parse the definitions into a symbol table, and implement recursive size calculation with memoization and cycle detection. Finally, discuss how to handle field type lookup and potential trade-offs.

Pro tip: Mention that you would validate the schema for cycles and undefined types during parsing, and use memoization to avoid exponential blowup in recursive size calculations.

1. Clarify requirements and grammar

Ask about the exact syntax for message definitions, primitive types and their sizes, and whether nested messages can be recursive. Confirm expected behavior for undefined types or cycles.

2. Design the parser and symbol table

Parse the input string into a map of message names to their field definitions. Store field names and types, resolving references to other messages.

3. Implement recursive size calculation

For a given message, sum the sizes of its fields. For primitive fields, use fixed sizes; for message fields, recursively compute the size. Use memoization to cache results and detect cycles.

4. Implement field type lookup

Given a message name and field name, return the type of that field. This can be a simple lookup in the symbol table.

5. Discuss edge cases and trade-offs

Address cycles, undefined types, repeated fields, and performance. Discuss iterative vs recursive approaches and how to handle large schemas.

Key Points to Mention

  • Parsing strategy: tokenization and recursive descent or regex-based parsing.
  • Symbol table: mapping message names to field definitions for quick lookup.
  • Recursive size calculation with memoization to avoid redundant work.
  • Cycle detection to prevent infinite recursion in self-referential messages.
  • Error handling for undefined types or malformed input.
  • Trade-offs: recursive vs iterative, memory vs speed, and handling of optional/repeated fields.

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