The Karat Screen
- Know how the Karat hour is cut, and why minutes saved on the design scenarios never reach the coding half
- Bank the domain-visit counter in about ten minutes so the harder second question gets the rest of the clock
- Return the object each prompt asks for, the route, the pages or the names, from your first draft
- Settle the edge rules from the sample logs before you plan, starting with the badge log
Some Wayfair candidates get a Karat call instead of the HackerRank link. Karat is an outside service that supplies the interviewer, an engineer who runs the session for Wayfair. The hour starts with a short introduction, then about 20 minutes of scenario questions on system design, then 30 minutes of coding. Both blocks are time-boxed, so if you finish the design questions in twelve minutes, the coding half still starts on schedule and still stops after 30.
The coding half usually comes in one of two shapes. Sometimes a single prompt fills it. Other times a quick counting problem comes first and a harder question on the same kind of log follows, and the clock tends to run out on that second one. Have time and space complexity ready for every answer, because the interviewer asks for both.
How the half hour runs
The design block comes first and stays shallow. Reported scenarios ask whether a bank ledger or a click-analytics feed needs strong or eventual consistency, what happens to a document editor that routes traffic by id % num_instances when the instance count changes, and how to show a friend count beside every post. System design at Wayfair works through those. Not every sitting holds the split tightly. One senior candidate on a four-scenario version explained each answer at length, spent 30 minutes there, and had 25 left for the coding prompt.
Each coding prompt arrives with sample inputs and their expected outputs, and the samples settle rules the prose leaves open. The badge log's samples show one employee landing in both output lists. Other Wayfair rounds have scored output position by position, so decide the order your answer comes back in before you write the loop that emits it.
| Prompt | How it is reported | Where it goes wrong |
|---|---|---|
| Subdomain Visit Count | The opener when two questions share the half | Totals emitted out of first-seen order |
| Longest Common Run | Second question after the counter, over two browsing histories | A subsequence answer, or the clock |
| Word Search, right and down only | The only coding prompt after the design scenarios, in two 2022 sittings | A path list still holding cells from failed branches |
| Badge Access Records | The 20-minute coding block of a senior phone screen with the same introduction, coding and design split | Forgetting whoever is still inside when the log ends |
| Parent-child pairs | a Premium question, the a Premium question, a shared ancestor | Worked in Parent-Child Graphs |
| A Meeting Rooms variant | One reported sitting | The overlap sweep in The HackerRank Screen covers it |
Every prompt here returns the object itself. The word grid wants the route as a list of cells, the shared run wants the pages, the badge log wants names. A boolean or a length fails the samples. Put the bookkeeping that builds the object into the first draft, a path you push and pop or an end index kept beside the best length, because adding it at minute 25 means reworking the recursion or the table.
Asked at Wayfair
Four problems, the most reported first. The counter and the shared run arrive as a pair inside one half hour, so time them together, about ten minutes for the first and twenty for the second. The word grid and the badge log each came as the only coding prompt of their session.
Subdomain Visit Count: One Pass Up the Domain
Problem
" " . The entry "900 www.wayfair.com" means that domain served 900 visits.A visit to
www.wayfair.com is also a visit to wayfair.com and to com. So every entry adds its count to its full domain and to every suffix you get by dropping labels from the left, down to the last label on its own.Return one
" " string for each distinct domain or suffix, where is the summed visits as a plain integer. Order the output by first appearance. Walk the entries in input order, and inside each entry go from the full domain down to its last label. A domain takes its slot the first time that walk reaches it, and later counts add to it without moving it.Expect at most 100 entries, each count between
1 and 10^4. Domains are lowercase letters separated by single dots, with no leading or trailing dot.com collects 900 + 50 + 1 = 951 but keeps the third slot, the one the first entry gave it. The UK storefront counts toward co.uk and uk like any other suffix, with no special case for a two-part country ending.
m.wayfair.com is the newest name, so it lands last. Its parent already holds slot one and com holds slot two, and both just absorb the extra visits.
A single label has no suffix to climb to. The loop must count it once and stop.
Keep an insertion-ordered map from domain to running total. For each entry, split off the count, then add it to the domain, cut everything up to the first dot, and repeat until no dot is left.
Subdomain Visit Count: One Pass Up the Domain
Click "Run" to execute your code
k busiest domains, highest total first, with a tie keeping the first-seen slot, so the first sample with k = 2 gives ["951 com","900 www.wayfair.com"]. The counting pass stays exactly as it is, and a stable sort on descending totals settles the ties without a second key, while heapq.nlargest returns the same order in O(m log k) when k is small. Go's sort.Slice and C++'s std::sort are not stable, so reach for sort.SliceStable or std::stable_sort there, and the longest common run that tends to follow on the screen is the next problem below.Longest Common Run: Two Users' Event Lists
Problem
user1 and user2, each in the order that shopper visited them. Find the longest run of pages that appears in both lists back to back and in the same order, with no other page between them in either list. Pages match on exact string equality.Return that run as a list of page paths. When several runs tie for the longest, return the one that starts earliest in
user1. When the lists share no page at all, return an empty list []. Either list may be empty.Both shoppers went rugs, cart, checkout without a detour. The home page and the sofas page are shared too, but each one is a run of a single page.
No pair of neighbouring pages in user1 shows up back to back in user2, so every shared run is one page long and the tie goes to the earliest start in user1. A subsequence answer would report three pages, sofas, rugs, cart, by skipping over lamps.
Nothing is shared, so the answer is the empty list and no page gets returned by default.
Fill a grid where each cell holds the length of the shared run ending at one position in each list. A match extends the diagonal neighbour by one, a mismatch resets the cell to zero, and the largest cell tells you where the answer ends.
Longest Common Run: Two Users' Event Lists
Click "Run" to execute your code
j from right to left lets one array act as the previous row and the current row at once. A mismatch now has to write the zero explicitly, because the array still holds a number from the row above in that slot.Word Search: Right and Down Only, Returning the Path
Problem
board arrives as a 2D array of single uppercase characters, along with a word. Spell word by starting on any cell that holds its first letter and moving to the next letter each time, where every step goes one cell right (r, c + 1) or one cell down (r + 1, c). Moving up or left is never allowed.Return the path as a list of
[row, col] pairs, one per letter of word, in spelling order. Return [] when the word cannot be spelled this way.When several paths spell the word, return the first one a fixed search order finds: try start cells in row-major order, and from every cell try right before down. Assume
1 <= rows, cols <= 10 and 1 <= len(word) <= 20.S, then right to O, down to F, right to A. The second A at (2,2) sits below the first one and never gets a look, because the path is complete as soon as the last letter lands.
Right-first reaches the M at (0,2), but neither neighbour of that M is a P. That cell has to come back off the path before the search drops to the M at (1,1) and finds the P below it.
The only A sits to the left of the only B. A four-direction solution would happily return [[0,1],[0,0]], which breaks the movement rule.
Depth-first search from each start cell with one shared path list. Append a cell when its letter matches, recurse right and then down, and pop the cell when both branches fail.
Word Search: Right and Down Only, Returning the Path
Click "Run" to execute your code
Badge Access Records: Enters Without Exits
Problem
[name, action] pairs where action is "enter" or "exit".Two rules frame the log. The room is empty when the log begins, and every employee must leave before the log ends. Return two collections:
- Employees who entered without a matching exit. An
"enter" from someone already inside means their earlier entry never got its exit, and anyone still inside when the log ends owes one too.- Employees who exited without a matching enter, meaning an
"exit" from someone who is not inside at that moment.A record that breaks a rule leaves the employee where they were. A second
"enter" keeps them inside, and an unmatched "exit" keeps them outside.Each collection holds a name at most once, however many times that employee breaks the rule, and one employee can sit in both. Return
[enteredWithoutExit, exitedWithoutEnter] with each list sorted alphabetically by character code. Names are ASCII letters and case-sensitive. Aim for a single pass over the n records.Paul's second exit comes while he is outside, so he owes an enter. He walks back in and the log stops with him inside, so he owes an exit as well. Raj swipes in twice without leaving.
The second enter flags the first one as unclosed and Paul stays inside. The first exit matches, and the second finds him already out. Four records put one employee in both lists.
Steve and Curtis are still inside when the log stops, so neither double-swiped and both still owe an exit. Martha exits from outside twice and Joe double-enters twice, yet each name appears once.
Keep a set of who is inside right now, starting empty. Each record either moves an employee across the door or breaks a rule, and a broken rule adds the name to one of two output sets without moving anyone.
Badge Access Records: Enters Without Exits
Click "Run" to execute your code
Key Takeaways
- ✓The Karat screen splits into roughly 20 minutes of design scenarios and 30 of coding, and minutes saved on design never move into the coding half. Expect to state time and space complexity for every answer.
- ✓When two prompts share the half, the domain counter opens and the longest common run follows. Bank the first in about ten minutes and name the dynamic-programming grid before you write the second.
- ✓Each prompt returns the object itself, the route through the grid, the pages of the run, the names from the badge log. Build the bookkeeping for it into the first draft.
- ✓Emit totals in first-seen order with an insertion-ordered map, and read every sample before planning, since the samples settle the edge rules the prose leaves open.
Citing this page?How we research these guides
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.