FastPrepRich Text Parser Part 1 (Validate Tokens)
Problems/Rich Text Parser Part 1 (Validate Tokens)

Rich Text Parser Part 1 (Validate Tokens)

Figma logoFigma● EasyFULLTIMEPHONE SCREENONSITE INTERVIEW

Updated Oct 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: 2026-07-07 — This set reconstructs a real Figma MLE full-time coding screen shared first-hand by a candidate. The seven graded pass/fail streams are the interviewer's original test cases word for word, so the judged cases are a 100% match. FastPrep supplied the surrounding framing and constraints; the complete page is estimated to be a 95% match. A community report submitted on Part 1 of this three-part series records a full-time Figma software engineering phone screen on CoderPad on October 13, 2026.

Special thanks: 🌷 A special thank you to our lovely, amazing frenz for sharing interview sightings for this series on October 13, 2026! ( ᴗ͈ˬᴗ͈)ഒ 💜

🐝 Hi there! The description you are currently reading is one part of a 3-part Figma interview set. It is highly recommended to read ALL THE PARTS before coding as parts build on top of each other 🐳

  • Rich Text Parser Part 1 (Validate Tokens) 🦔
  • Rich Text Parser Part 2 (Parse Nested Groups) 🐹
  • Rich Text Parser Part 3 (Depth Tokens) 🦚

At Figma, documents are stored as nested structures: a paragraph can contain text runs and nested groups, which can themselves contain more groups. You are working with a small text format that describes structures like this. This set reconstructs a real ~45-minute Figma coding screen, part by part.

Setup. The interview starts from a tokenizer that is already written for you. For example, tokenize("(a,b,c)") returns ["(", "a", "b", "c", ")"]. Notice that commas are separators: the tokenizer drops them, so every token you receive is "(", ")", or a word. On FastPrep the tokenizer's output is handed to you directly as the tokens array.

Part 1. Before parsing anything, the interviewer asks for a validator. Implement isWellFormed(tokens) that returns true when the bracket structure of the token stream is well-formed: scanning left to right, no ")" ever appears without a matching earlier "(", and every "(" is eventually closed.

Words never affect validity and may appear anywhere, including outside all groups. A stream with no tokens is well-formed. Multiple separate groups at the top level are allowed.

Function

isWellFormed(tokens: String[]) → boolean

Examples

Example 1

tokens = ["(", "a", "(", "b", ")", "c", ")"]return = true

This is tokenize("(a,(b),c)"). The inner group closes before the outer one; every open has a matching close.

Example 2

tokens = ["(", "a", "b", "c"]return = false

This is tokenize("(a,b,c"). The group is never closed.

Example 3

tokens = ["(", "a", "(", ")", ")", "(", "b", "c", ")", ")"]return = false

This is tokenize("(a,())(b,c))"). Everything up to (b,c) is balanced, but the final ")" has no matching open.

Constraints

  • 0 <= tokens.length <= 5000
  • each token is "(", ")", or a lowercase alphanumeric word with at most 10 characters

More Figma Onsite Interview questions

  • Recursive Display SortPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2026
  • Rich Text Parser Part 3 (Depth Tokens)PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Rich Text Parser Part 2 (Parse Nested Groups)PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
  • Table Selection and Color UpdatesPHONE SCREEN · ONSITE INTERVIEW · Seen Aug 2026
  • Sort Documents Left to RightONSITE INTERVIEW · Seen Aug 2026
  • Symmetric Binary TreeONSITE INTERVIEW · Seen Feb 2026
  • Topmost Accessible NodesPHONE SCREEN · ONSITE INTERVIEW · Seen Jan 2025
  • Nested Template Variable ExpansionONSITE INTERVIEW · Seen Jun 2024
  • Parse, Validate, and Repair Markdown FormattingONSITE INTERVIEW · Seen Jun 2024
  • Breadth-First Values of a Binary TreeONSITE INTERVIEW · Seen Oct 2022

Similar questions at other companies

  • Stack Formula InterpreterTypeSafe AI · PHONE SCREEN
  • Parse Boolean Rule ExpressionsStripe · PHONE SCREEN · ONSITE INTERVIEWStripe interview questions
  • Most Frequent Call Path From Function Trace LogsRoblox · PHONE SCREEN · ONSITE INTERVIEWRoblox interview questions
  • Single-Pass S-Expression ParserBaseten · ONSITE INTERVIEWBaseten interview questions
  • Remove Parentheses from a Plus-Minus ExpressionOracle · PHONE SCREENOracle interview questions
  • Decode StringCompass International Holdings · PHONE SCREENCompass International Holdings interview questions
  • Flatten a Mixed JSON ListNike, Inc. · ONSITE INTERVIEWNike, Inc. interview questions
  • Molecular Weight of a Grouped FormulaAgoda · ONSITE INTERVIEWAgoda interview questions
  • Calculate a Token-List ExpressionCollege Vine · ONSITE INTERVIEW
  • Evaluate a Parenthesized Integer ExpressionAdobe · PHONE SCREENAdobe interview questions

Figma interview experiences

  • Figma interviews · November 2026
  • Figma SWE Intern OA and Final Round: 21 Experiences
  • Figma SWE Intern OA Questions: 25 Experiences
All Figma interview questionsSee Figma hiring insights
Saved
class Solution {
    public boolean isWellFormed(String[] tokens) {
      // write your code here
    }

}
Checking account…