Parent-Child Graphs
The prompt usually starts with a small diagram. Ten sits above 2, both 1 and 2 are parents of 3, 4 has children 5 and 8, and the family runs down to 6, 7 and 9. Behind the picture is a flat list of (parent, child) pairs, one per link, and every person is an integer id. Wayfair's first-round interview often uses this input, next to a block of design scenarios, and the coding part can be as short as 20 to 25 minutes.
The question changes from one interview to the next, but the input stays the same. One asks which individuals have no parents and which have exactly one. Another wants a Premium question, the one farthest up. A third asks for the closest ancestor with no parents of its own, and a fourth asks whether two nodes share any ancestor at all. They all read the same structure, so build it once and get it right.
0 is a real person whose parent is 4, and a truthiness check like if parent drops them without any error.WayfairPremium lesson · Coding round
The 3 Wayfair problems are below.
- A Premium questionCoding · Medium · Frequently asked
- A Premium questionCoding · Medium
- A Premium questionCoding · Easy
Each with hints, the follow-up and a tested solution.
Get the Wayfair questions$49 a year · all 100 companies · cancel anytime
From 309 Wayfair reports, forum threads behind logins and write-ups in Chinese.
Wayfair interview guideKnow what Wayfair asks before you walk in.
31 coding · 3 system design · 24 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.