The Figma technical phone screen centered on a three-part Display Sort problem involving rectangular documents placed on a two-dimensional canvas. The question started with a simple left-to-right ordering, then introduced transitive row grouping based on vertical overlap, and finally added nested child documents that had to be recursively ordered.
Interview Details
Coding — Display Sort Each document was represented approximately as:
struct Document {
int id;
int x;
int y;
int width;
int height;
vector<Document> children;
};
struct Document {
int id;
int x;
int y;
int width;
int height;
vector<Document> children;
};
Smaller x coordinates represent positions farther to the left, while smaller y coordinates represent positions closer to the top of the canvas.
Part 1 — Sort Documents Left to Right Given a collection of documents, return their IDs ordered by increasing x. The interviewer expected me to implement the comparison logic rather than relying
Unlock Full Details
Create a free account to unlock this interview experience report.