Figma C++ Interview: Cursors After Edits, Vector Fill Regions, Loading Big Files

Figma Software Engineer - C++: where cursors end up after inserts and deletes, counting fillable regions in a vector network, loading huge files by page.

FigmaSoftware Engineer - C++Updated Nov 24, 20263 min read

Interview Experience | Editor Engine | πŸ”₯πŸ”₯πŸ”₯ | Figma

2026 (Oct-Nov) Software Engineer - C++ @ Figma β€” San Francisco, CA β€” Phone screen + Onsite β€” 3 rounds | Hard

Round 1 β€” Phone Screen

CoderPad, C++, the interviewer works on text.

The problem: a text box starts with a batch of cursor positions. Then a sequence of edits arrives in order: ins(p, k) inserts k characters at position p, del(p, k) deletes [p, p+k). If an insert lands exactly on a cursor, the cursor goes after the new text; cursors inside a deleted range all land on p. Return where every cursor is after all edits.

initial length 10, cursors = [2, 5, 8]
ins(3, 4)  -> [2, 9, 12]
del(1, 9)  -> [1, 1, 3]
ins(1, 2)  -> [3, 3, 5]

First wrote the loop over every cursor for every edit. He said edits and cursors are both 1e5.

I noticed on my own that the order of the cursors never changes, and ones that get squashed together stay together. After that it's range add and range assign. The segment tree took a while, and I got a boundary wrong once in the binary search for del.

He asked for the complexity, O((n + m) log m), said fine, ended a few minutes early for my questions.

Round 2 β€” Coding

The problem: what the pen tool draws is a graph: points and straight segments, segments only meet at endpoints. How many closed regions can the paint bucket fill.

square, 4 points 4 edges, plus one diagonal
-> 2

add a dangling line off one corner
-> still 2

two separate triangles
-> 2

I asked first whether lines can cross, he said not in this part. Started by thinking DFS for cycles, but that over-counts, the square with a diagonal has 3 cycles. He asked whether points, edges and connected pieces relate somehow, then I got it written.

Follow-up: segments can cross, crossings count as points. I said find intersections first and split the segments, O(nΒ²) is acceptable, then reuse the first part. He asked about two segments overlapping on the same line, I said treat it as one, didn't detail the merge.

Follow-up: given a click, return which region it's in, with that region's boundary in order. I sorted the edges at each point by angle using atan2. He asked what happens with coordinates up to 1e9, switched to cross-product comparison.

Round 3 β€” System Design

Design opening a huge file in Figma in the browser.

Requirements:

  • hundreds of thousands of nodes, over a hundred pages; within a few seconds of opening you can see and edit the current page
  • the engine runs in WASM with a memory cap
  • other people's edits on other pages still have to sync in

I started with the server splitting by page and sending only the current one. He asked: an instance on the current page whose main component lives on another page, what does it render as. I got stuck there for a bit; later added bringing along what the page depends on when opening it.

What he asked after that: the user searches the whole file for a layer name while most pages aren't loaded; someone edits a main component on an unloaded page and the instance on the current page has to change; memory is almost full after a long session, what gets dropped first.

Last ten minutes were my questions.