Design an NL-to-formula assistant
Company: Airtable
Role: Software Engineer
Category: ML System Design
Difficulty: easy
Interview Round: Onsite
## ML system design: Natural-language to spreadsheet formula assistant
Design an assistant that converts **natural language requests** into **spreadsheet-style formulas** for a no-code table product (similar to Airtable/Sheets).
### Users and examples
Users type requests like:
- “If `Status` is "Won" and `Amount` > 1000, return `Amount` * 0.1 else 0.”
- “Extract the domain from the `Email` field.”
- “Create a formula to label rows as "Late" if `Due Date` is before today and `Completed` is false.”
The system should output:
1) A **proposed formula** (in the product’s formula language),
2) A short **explanation**, and
3) Optionally a few **test cases / example evaluations**.
### Requirements
- Support ambiguous requests by asking **clarifying questions**.
- Respect **table schema/context** (field names, types, missing values).
- Be safe: avoid leaking data, and avoid destructive actions.
- Latency target: e.g., P95 < 2–3s for interactive usage.
- Provide a plan for **quality evaluation** and **iteration**.
### What to cover
- End-to-end architecture (client, orchestration, model calls, tools).
- Schema grounding and type checking.
- Handling ambiguity and multi-turn refinement.
- How you validate formulas (static + dynamic checks).
- Offline/online evaluation metrics and datasets.
- Failure modes and mitigations (hallucinated fields/functions, incorrect edge-case logic).
Quick Answer: This question evaluates a candidate's competency in ML system design for interactive natural-language-to-formula assistants, covering end-to-end architecture, schema grounding and type checking, ambiguity resolution, safety constraints, validation strategies, latency trade-offs, and quality evaluation.