Product page
Loading reviews
Loading reviews
Reviews loaded
{p.blurb}
\n {p.price.toFixed(2)}\n \nc
d
\ne
f
g
`;\n\nconst q = (page, sel, prop) => page.evaluate(([s, p]) => getComputedStyle(document.querySelector(s))[p], [sel, prop]);\nconst BLUE = 'rgb(0, 102, 204)', LIGHT = 'rgb(102, 178, 255)', ORANGE = 'rgb(200, 100, 0)';\n\nfor (const [name, type] of [['chromium', chromium], ['firefox', firefox], ['webkit', webkit]]) {\n const browser = await type.launch();\n const page = await browser.newPage({ viewport: { width: 2000, height: 600 } });\n await page.setContent(html);\n const r = {};\n r.root = await q(page, '#a', 'color');\n r.scoped = [await q(page, '#b', 'color'), await q(page, '#binner', 'color')]; // override inherited by the child\n r.otherCard = await q(page, '#inner', 'color'); // a span in the first card: untouched by the other card's override\n r.fallback = await q(page, '#c', 'color');\n r.multi = await q(page, '#d', 'fontFamily');\n r.bad = await q(page, '#e', 'color'); // unset on an inherited property: inherits from body\n r.literal = await q(page, '#f', 'color'); // the p rule still applies\n r.mq = await q(page, '#g', 'color'); // the media rule never matched, even at 2000px\n r.caseSensitive = await page.evaluate(() => [getComputedStyle(document.documentElement).getPropertyValue('--accent').trim(),\n getComputedStyle(document.documentElement).getPropertyValue('--Accent').trim()]);\n // runtime update from JavaScript: no re-render, the cascade recomputes\n await page.evaluate(() => document.documentElement.style.setProperty('--accent', 'rgb(1, 2, 3)'));\n r.afterJs = [await q(page, '#a', 'color'), await q(page, '#b', 'color')]; // #b keeps its own declaration\n await page.evaluate(() => document.documentElement.style.removeProperty('--accent'));\n // theming: one attribute flip re-points every component\n await page.evaluate(() => document.documentElement.setAttribute('data-theme', 'dark'));\n r.dark = await q(page, '#a', 'color');\n console.log(name.padEnd(8), JSON.stringify(r));\n assert.equal(r.root, BLUE);\n assert.deepEqual(r.scoped, [ORANGE, ORANGE]);\n assert.equal(r.otherCard, BLUE);\n assert.equal(r.fallback, 'rgb(0, 128, 0)');\n assert.match(r.multi, /^Georgia, serif$/);\n assert.equal(r.bad, await q(page, 'body', 'color'));\n assert.equal(r.literal, 'rgb(255, 0, 0)');\n assert.equal(r.mq, 'rgb(9, 9, 9)');\n assert.deepEqual(r.caseSensitive, [BLUE, 'rgb(204, 0, 0)']);\n assert.deepEqual(r.afterJs, ['rgb(1, 2, 3)', ORANGE]);\n assert.equal(r.dark, LIGHT);\n await browser.close();\n}\nconsole.log('all assertions passed');\n\nRun in the Playwright 1.48.2 image, every engine (Chromium, Firefox, Playwright's WebKit build) printed the same values, shown here for Chromium:\n\nchromium {\"root\":\"rgb(0, 102, 204)\",\"scoped\":[\"rgb(200, 100, 0)\",\"rgb(200, 100, 0)\"],\"otherCard\":\"rgb(0, 102, 204)\",\"fallback\":\"rgb(0, 128, 0)\",\"multi\":\"Georgia, serif\",\"bad\":\"rgb(0, 0, 0)\",\"literal\":\"rgb(255, 0, 0)\",\"mq\":\"rgb(9, 9, 9)\",\"caseSensitive\":[\"rgb(0, 102, 204)\",\"rgb(204, 0, 0)\"],\"afterJs\":[\"rgb(1, 2, 3)\",\"rgb(200, 100, 0)\"],\"dark\":\"rgb(102, 178, 255)\"}\nall assertions passed\n\nRead it as: scoped shows the override reaching the child span; otherCard shows it not reaching the span in the other card; bad is the inherited black (the invalid var() became unset) while literal stays red; mq is the plain rule's colour because the media rule with var() never applied; afterJs shows the JS update reaching #a but not the self-declaring #b; dark shows the attribute flip. Changing the media condition to a literal 0px makes the mq assertion throw (the colour becomes rgb(1, 2, 3) where rgb(9, 9, 9) is expected), and deleting the [data-theme=\"dark\"] rule makes the dark assertion throw (the colour stays rgb(0, 102, 204) where rgb(102, 178, 255) is expected).\n\nPitfalls\n\nCustom properties are inherited by default, so a value set high in the tree reaches everything below; scope deliberately.\nA typo in the name gives a silent fallback or unset, not an error. Always give fallbacks for optional hooks.\n\nRunning the code\n\nnpm init -y && npm i playwright@1.48.2 # inside mcr.microsoft.com/playwright:v1.48.2-jammy\nadd \"type\": \"module\" to package.json, save the test as css-vars.mjs\nnode css-vars.mjs\nSass sample, in a node:22 container: npx -y sass@1.77.8 in.scss"}},{"@type":"Question","name":"A layout looks correct in Chrome DevTools responsive mode, but on a real iPhone the header overlaps content when the browser chrome changes height and a sticky footer jumps unexpectedly. How would you debug and fix this class of responsive bugs?","acceptedAnswer":{"@type":"Answer","text":"How I would debug it\nI would reproduce the bug on a physical iPhone first, because Chrome responsive mode does not fully match Safari's viewport behavior. One note on terminology before going further: \"browser chrome\" below means the address bar, tabs, and other on-screen browser UI that can expand or collapse, not the Chrome browser itself; the two meanings of \"chrome\" are unrelated. Then I would inspect computed heights, scroll containers, and any element using 100vh, position: sticky, or position: fixed.\n\nLikely causes\n100vh on iOS can behave differently when the browser chrome expands or collapses\nA sticky or fixed footer may ignore safe-area insets\nA parent container may have overflow rules that interfere with sticky positioning\n\nFix strategy\nReplace 100vh with 100dvh (dynamic viewport height: unlike the static 100vh, it updates automatically as the browser chrome shows or hides) when I need the visible viewport height\nUse env(safe-area-inset-bottom) (a safe area is the part of the screen not covered by a device's notch, home indicator, or rounded corners) for footer spacing on notch devices\nAvoid tying layout math to the old static viewport height if the browser UI changes size\nTest with the address bar visible and hidden to catch jumpy behavior\n\nExample fallback\nIf a browser does not handle dynamic viewport units consistently, I may use a small JavaScript fallback to set an app height variable from window.innerHeight. The key is to keep the layout stable across scroll and chrome transitions, then verify on Safari, not just in DevTools."}},{"@type":"Question","name":"How do you stay informed about what a function you regularly work with actually cares about and is measured on, even when you're not in the room for their planning?","acceptedAnswer":{"@type":"Answer","text":"Direct answer\n\nBuild a standing information diet from what the partner function already produces for itself, its goals or planning document, the metrics it is measured on, and its retro or release notes, and pair that with a recurring informal check-in with one counterpart in that function. You are not trying to get invited into their planning meeting; you are trying to read what they optimize for, and occasionally confirm your read against a real person.\n\nStructured elaboration\n\nChannel | Typical cadence | What it surfaces\n\nTheir goals or planning document (OKRs, roadmap) | Once per planning cycle | What they are formally accountable for this period\nDashboards or metrics they report on | Check periodically | What \"good\" looks like for them, in their own numbers\nRetro notes, release notes, postmortems | As published | What is currently painful or top of mind for them\nRecurring 1:1 with one counterpart | Biweekly or monthly | Informal context, upcoming priorities, translation of jargon\nOccasional silent sit-in on their planning | A couple of times a year | Calibrates your read of the artifacts against how they actually talk about trade-offs\n\nThe habit that ties these together: translate their metric into one sentence you could say back to them and have them agree it is accurate, then test that sentence the next time you talk. If you cannot state their current priority in a sentence they would sign off on, your information diet has a gap.\n\nWorked example\n\nSuppose you regularly partner with a support or customer-success function but are not in their planning. Their quarterly goals page (a document they publish for their own team) states the goal is \"reduce median response time.\" Reading that before proposing a change that would meaningfully increase inbound volume lets you flag the likely trade-off to your counterpart ahead of launch, rather than finding out after the fact that you worked against their stated goal. The artifact told you what they were measured on; the counterpart conversation confirmed it was still current.\n\nTrade-offs & pitfalls\n\nRelying only on artifacts risks reading a goal that is stale or aspirational and no longer reflects what the team is actually prioritizing day to day.\nRelying only on a single counterpart's opinion risks mistaking one person's take for the function's actual priority, especially if that person is not close to how the team's metrics are reviewed.\nA common miss: reading the dashboard but never validating the interpretation with anyone in that function, which produces confidently wrong assumptions that only surface when a decision already went the wrong way.\nThe senior differentiator on an easy-sounding question like this is treating it as a standing habit built before you need it, rather than something you scramble to learn only after a conflict has already surfaced."}},{"@type":"Question","name":"You need a draggable list that works with a mouse and on touchscreens. Compare using the native HTML5 drag-and-drop API with building it on pointer events, and say which you would choose and why.","acceptedAnswer":{"@type":"Answer","text":"Direct answer\n\nBuild it on pointer events. The native HTML5 drag-and-drop API (the draggable attribute plus the dragstart, dragover and drop events) is shorter to write for a mouse, but it ties you to the browser's drag session (the browser-owned state machine that runs from dragstart to drop, during which your page does not receive normal mouse or pointer move events), gives you little control over how the drag looks and behaves, and in a Chromium run with a simulated finger it never started a drag at all (output below). A list that must work with a mouse and on touchscreens needs one code path for all input, which is what pointer events (pointerdown, pointermove, pointerup, one event shape for mouse, pen and finger) provide. Keep the native API for the cases only it can do: dragging files or text in from outside the page, or between windows.\n\nWhat each approach gives you\n\nConcern | Native drag-and-drop | Pointer events\n\nMouse | Works: dragstart then drop | Works: you track the move yourself\nFinger | Did not fire dragstart in the Chromium run below | Same code as the mouse (pointerType, the property naming the device, is \"touch\")\nDrag preview | The browser draws a translucent snapshot; customising it is limited (setDragImage swaps in another image or element for the snapshot) | You move the real element or your own clone with transform, so any visual is possible\nDrop target detection | Browser fires dragenter / dragover / drop on targets | You work it out: document.elementFromPoint(x, y) (returns the topmost element at those viewport coordinates) or geometry\nData model | dataTransfer (the object on drag events that carries the payload as strings or files; effectAllowed on it states which operations such as move or copy are permitted), can cross windows and come from the OS | Plain JavaScript variables, same page only\nAuto-scroll near an edge | Left to the browser | You write it, so you control speed and edges\nKeyboard | None built in | None built in: both need a separate keyboard path\nCancel with Escape | Browser handles it | You handle pointercancel and keydown\n\nTwo details of the native API cause most bugs: drop never fires unless a dragover handler calls preventDefault(), and the drag is a browser-owned session, so what the user sees while dragging is mostly out of your hands.\n\nThe two lists, run side by side\n\nThe harness runs the pointer list on a plain mental model: the dragged row is moved in the DOM whenever the pointer is over a different row. Both lists are three rows (A, B, C). The gesture picks up A and releases over C, so a correct result is the order bca. The harness runs the mouse gesture in Chromium, Firefox and WebKit (Playwright's WebKit build, which is not Safari on iOS), then the same gesture with a simulated finger in Chromium:\n\nimport { chromium, firefox, webkit } from 'playwright';\n\nconst items =n={n}
;\n}\n\nReact compares each dependency with the previous render's value using Object.is (a strict \"same value\" check: two different objects or arrays are never equal, even if their contents match). n goes from 0 to 1, so the effect runs again, sets 2, and so on. The same loop appears in two less obvious shapes, which the runnable demo below reproduces:\n\nAn object or array created during render in the list. const options = { q } is a new object on every render, so [options] always \"changed\", and an effect that sets state therefore re-renders and re-creates options.\nAn effect that writes a freshly built copy of the state it watches. setItems(items.filter(...)) returns a new array even when nothing was removed, so [items] changes on every run.\n\nBreaking the loop: which fix fits which intent\n\nWhat the effect was meant to do | Fix | Why it is correct\n\nRun once to initialise something | Empty list [], and use an updater setN(v => v + 1) | Nothing in the list can change. An updater is the function form of the setter: React calls it with the latest queued state, so the code does not need to read n from the closure (the snapshot of variables that one render's function captured)\nReact to a user action (a click, a submit) | Delete the effect, do the work in the event handler | The cause is the event, not the render. No dependency to get wrong\nCompute a value from props or state | Delete the effect and the state, compute during render (useMemo if costly) | The value cannot drift out of sync with its inputs, and there is no extra render\nRe-run when a value changes, where the list holds an object or function | Depend on the primitives inside it ([q]), or stabilise the object with useMemo | Equality is checked on values that only change when they really change\nNormalise or clean state that must stay in state | Functional update that returns the previous array/object when nothing changed | React bails out (stops early and skips re-rendering the component's children) when the new state is identical to the current one, so the cycle ends\nSynchronise with something outside React (a fetch, a subscription) | Keep the effect, but keep the state it writes out of its own list | The list should name what the effect reads from the outside world, not what it writes\n\nThe react.dev guide says: \"When something can be calculated from the existing props or state, don't put it in state. Instead, calculate it during rendering.\" On the equal-value rule, the useState reference says: \"If the new value you provide is identical to the current state, as determined by an Object.is comparison, React will skip re-rendering the component and its children.\"\n\nRemoving a dependency from the list just to stop the loop is the wrong move when the effect really reads that value: the effect then uses a stale value (a copy captured by an earlier render: an effect that read n as 0 keeps reading 0 after the state has moved on), and the hook lint rules in eslint-plugin-react-hooks will flag it. Use an updater, restructure, or move the work, and keep the list honest.\n\nWorked example: nine components, one counter\n\nThe demo renders each broken and fixed version under jsdom (a simulated browser in Node) and counts renders with a plain counter. The broken versions contain a safety valve that stops them at 25 renders so the script finishes instead of freezing. Each broken case asserts that the valve was hit. The four fixed components that still run an effect (InitOnce, ObjDepPrimitive, ObjDepMemo, PruneGuarded) carry the same valve and assert that it was not hit, so a fix that stops working fails an assertion instead of freezing the script. ClickCount and PruneDerived have no effect, so they have no valve; the demo asserts their render counts instead.\n\nThe first eleven lines of the listing (up to the Testing Library import) are environment setup, not part of the technique. JSDOM builds a fake browser page; the next three lines expose its window, document and navigator as globals that React and Testing Library look for; IS_REACT_ACT_ENVIRONMENT = true tells React that updates are wrapped in act(), the test helper that makes React finish pending state updates and effects before returning, which Testing Library's render does for you. The unused names pulled out of React and Testing Library are never used and can be ignored.\n\nThe nine components pair up as follows:\n\nSelfCount is the loop; InitOnce makes the same effect run once, and ClickCount moves the increment into the click handler.\nObjDep puts a fresh object in the list; ObjDepPrimitive lists the string q instead, and ObjDepMemo keeps the object but only rebuilds it when q changes.\nPrune writes a new array on every run; PruneGuarded returns the old array when nothing was removed, and PruneDerived has no effect and no extra state.\n\n// effect-loop.mjs\nimport { JSDOM } from 'jsdom';\nimport assert from 'node:assert/strict';\nconst dom = new JSDOM('', { url: 'http://localhost/' });\nglobalThis.window = dom.window;\nglobalThis.document = dom.window.document;\nObject.defineProperty(globalThis, 'navigator', { value: dom.window.navigator });\nglobalThis.IS_REACT_ACT_ENVIRONMENT = true;\nconst React = (await import('react')).default;\nconst { useState, useEffect, useMemo, useCallback, useRef, memo, useReducer } = React;\nconst { render, screen, fireEvent, cleanup, act, waitFor } = await import('@testing-library/react');\nconst h = React.createElement;\n\nconst CAP = 25; // safety valve so the demo ends instead of freezing the tab\n\nfunction makeCounter() {\n return { renders: 0, runaway: false };\n}\n\n// Case 1: the effect sets the state that is in its own dependency list.\nfunction SelfCount({ c }) {\n const [n, setN] = useState(0);\n c.renders++;\n useEffect(() => {\n if (c.renders >= CAP) { c.runaway = true; return; } // demo-only valve\n setN(n + 1);\n }, [n]);\n return h('p', null, 'n=' + n);\n}\n// Fix 1a: the intent was \"initialise once on mount\": empty list plus an updater.\nfunction InitOnce({ c }) {\n const [n, setN] = useState(0);\n c.renders++;\n useEffect(() => {\n if (c.renders >= CAP) { c.runaway = true; return; } // demo-only valve\n setN((v) => v + 1);\n }, []);\n return h('p', null, 'n=' + n);\n}\n// Fix 1b: the intent was \"count clicks\": the work belongs in the handler.\nfunction ClickCount({ c }) {\n const [n, setN] = useState(0);\n c.renders++;\n return h('button', { onClick: () => setN(n + 1) }, 'n=' + n);\n}\n\n// Case 2: an object literal built during render is in the dependency list.\nfunction runSearch(o) { return ['hit:' + o.q]; }\nfunction ObjDep({ c, q }) {\n const [results, setResults] = useState([]);\n c.renders++;\n const options = { q };\n useEffect(() => {\n if (c.renders >= CAP) { c.runaway = true; return; }\n setResults(runSearch(options));\n }, [options]);\n return h('p', null, results.join(','));\n}\nfunction ObjDepPrimitive({ c, q }) {\n const [results, setResults] = useState([]);\n c.renders++;\n useEffect(() => {\n if (c.renders >= CAP) { c.runaway = true; return; } // demo-only valve\n setResults(runSearch({ q }));\n }, [q]);\n return h('p', null, results.join(','));\n}\nfunction ObjDepMemo({ c, q }) {\n const [results, setResults] = useState([]);\n c.renders++;\n const options = useMemo(() => ({ q }), [q]);\n useEffect(() => {\n if (c.renders >= CAP) { c.runaway = true; return; } // demo-only valve\n setResults(runSearch(options));\n }, [options]);\n return h('p', null, results.join(','));\n}\n\n// Case 3: the effect writes a fresh array derived from the state it watches.\nfunction Prune({ c }) {\n const [items, setItems] = useState([3, 1, 2]);\n c.renders++;\n useEffect(() => {\n if (c.renders >= CAP) { c.runaway = true; return; }\n setItems(items.filter((x) => x > 0)); // new array even when nothing is removed\n }, [items]);\n return h('p', null, items.join(','));\n}\nfunction PruneGuarded({ c }) {\n const [items, setItems] = useState([3, 1, 2]);\n c.renders++;\n useEffect(() => {\n if (c.renders >= CAP) { c.runaway = true; return; } // demo-only valve\n setItems((prev) => {\n const next = prev.filter((x) => x > 0);\n return next.length === prev.length ? prev : next; // same reference: React bails out\n });\n }, [items]);\n return h('p', null, items.join(','));\n}\nfunction PruneDerived({ c }) {\n const [items] = useState([3, 1, 2]);\n c.renders++;\n const visible = useMemo(() => items.filter((x) => x > 0), [items]);\n return h('p', null, visible.join(','));\n}\n\nfunction run(label, Comp, props = {}) {\n const c = makeCounter();\n const view = render(h(Comp, { c, ...props }));\n const out = { label, renders: c.renders, runaway: c.runaway };\n console.log(JSON.stringify(out));\n return { c, view };\n}\n\nlet r;\nr = run('1 broken self-count', SelfCount);\nassert.equal(r.c.runaway, true); assert.ok(r.c.renders >= CAP); cleanup();\n\nr = run('1a init once', InitOnce);\nassert.equal(r.c.runaway, false); assert.equal(r.c.renders, 2); cleanup();\n\nr = run('1b handler', ClickCount);\nassert.equal(r.c.renders, 1);\nfireEvent.click(screen.getByRole('button'));\nconsole.log(JSON.stringify({ label: '1b after click', renders: r.c.renders }));\nassert.equal(r.c.renders, 2); cleanup();\n\nr = run('2 broken object dep', ObjDep, { q: 'a' });\nassert.equal(r.c.runaway, true); cleanup();\n\nr = run('2a primitive dep', ObjDepPrimitive, { q: 'a' });\nassert.equal(r.c.renders, 2); assert.equal(r.c.runaway, false); cleanup();\n\nr = run('2b useMemo dep', ObjDepMemo, { q: 'a' });\nassert.equal(r.c.renders, 2); assert.equal(r.c.runaway, false); cleanup();\n\nr = run('3 broken prune', Prune);\nassert.equal(r.c.runaway, true); cleanup();\n\nr = run('3a guarded updater', PruneGuarded);\nconst guardedRenders = r.c.renders;\nassert.ok(guardedRenders <= 2, 'bounded'); assert.equal(r.c.runaway, false); cleanup();\n\nr = run('3b derived in render', PruneDerived);\nassert.equal(r.c.renders, 1);\nassert.equal(screen.getByText('3,1,2') !== null, true);\nconsole.log('all assertions passed');\n\nRun in a node:22 container (Node 22.23.3), it prints:\n\n{\"label\":\"1 broken self-count\",\"renders\":25,\"runaway\":true}\n{\"label\":\"1a init once\",\"renders\":2,\"runaway\":false}\n{\"label\":\"1b handler\",\"renders\":1,\"runaway\":false}\n{\"label\":\"1b after click\",\"renders\":2}\n{\"label\":\"2 broken object dep\",\"renders\":25,\"runaway\":true}\n{\"label\":\"2a primitive dep\",\"renders\":2,\"runaway\":false}\n{\"label\":\"2b useMemo dep\",\"renders\":2,\"runaway\":false}\n{\"label\":\"3 broken prune\",\"renders\":25,\"runaway\":true}\n{\"label\":\"3a guarded updater\",\"renders\":1,\"runaway\":false}\n{\"label\":\"3b derived in render\",\"renders\":1,\"runaway\":false}\nall assertions passed\n\nReading the output: the three broken components reach the 25-render valve. The initialise-once version and the primitive-dependency version settle at 2 renders (the first render plus one update from the effect). The click handler version stays at 1 render until the click and then goes to 2. The derived value stays at 1 render, because no effect runs at all. The guarded updater also showed 1 render in this run; the useState docs warn that React may sometimes call the component once more before bailing out, so treat 1 to 2 as the expected range and the loop being gone as the guarantee.\n\nTrade-offs and pitfalls\n\nDeleting the effect is the best fix more often than not, because the effect only existed to copy one value into state after rendering. The \"derived state in an effect\" pattern costs an extra render even when it does not loop.\nuseMemo for an object dependency is a fix for the identity problem only. If the memo's own inputs are new objects every render, it is memoizing nothing.\nA guard such as if (n < 10) setN(n + 1) stops the freeze but leaves a render cascade, and it hides the design problem. Use it only when the cascade is the intended behaviour.\nFetch effects that set state with the response need a different protection (ignore stale responses, cancel on cleanup). The dependency list is still the place to look first when the page spins.\nIn the browser, find the culprit with the React DevTools Profiler (a recorded session shows the same component committing again and again; a commit is the step where React writes a finished render into the page, and the Profiler lists one per update).\n\nRunning the code\n\nmkdir loop && cd loop && printf '{\"type\":\"module\"}' > package.json\nnpm i react@18.3.1 react-dom@18.3.1 @testing-library/react@16.0.1 @testing-library/dom@10.4.0 jsdom@25.0.1\nnode effect-loop.mjs # the listing above"}},{"@type":"Question","name":"Describe a time you mentored someone from their first day through shipping their first piece of real work. How did you ramp them up?","acceptedAnswer":{"@type":"Answer","text":"Direct answer\nRamping someone from day one to their first shipped work is a deliberate sequence, not a single onboarding checklist: assess what they actually already know, give them small real tasks with tight review loops before a full feature, gradually widen the scope of ownership, and define upfront what \"shipped\" and \"done\" mean so the finish line is unambiguous. The plan should look different depending on who's arriving, not just be a fixed template applied to everyone.\n\nStructured elaboration\n\nThe default arc\nFirst few days: orient and assess. Don't assume a blank slate; find out what they already know so you're not re-teaching things or, worse, skipping things they actually need.\nEarly tasks: small, real, low-blast-radius work with fast, close review. The goal here is confidence and calibration to the team's standards, not speed.\nMiddle stretch: progressively larger scope with more independence, review shifting from \"check everything\" to \"check the risky parts.\"\nFirst real shipped piece: something end-to-end they own, with you available but not doing it alongside them, and a clear definition of \"done\" agreed before they start, so success isn't a moving target.\n\nAdapting the plan to who's actually arriving\nThis is where a generic checklist breaks down, and it's the part that separates a senior answer:\nA contractor under least-privilege or compliance constraints: access is scoped down from day one, so the plan has to work around what they legitimately can't see or touch, and documentation often needs to be more explicit since they can't casually ask around as easily as a full-time hire embedded in the org.\nA career-changer from an adjacent discipline (a backend engineer moving into data engineering, a research scientist moving into production ML): they're not a blank slate, they have real transferable skills. The plan should explicitly identify what carries over and target ramp-up specifically at the actual new-domain gaps, not restart from zero the way you would for someone with no relevant background.\nA cohort of remote interns rather than one hire: 1:1 pairing time doesn't scale to a group. The plan shifts toward a shared structured curriculum, peer learning between the interns, and scheduled office hours, with 1:1 time reserved for the things that genuinely need it.\nA remote hire versus a senior IC joining: a remote hire needs more of everything written down explicitly, since the informal hallway learning that fills gaps for an in-person hire doesn't happen by accident. A senior IC's gap is usually organizational context and relationships, not raw skill, so their plan should be lighter on procedural scaffolding and heavier on introductions, context on how decisions get made, and where the landmines are.\n\nWorked example\n\nSituation\nI mentored someone joining as an individual contributor with solid general skills but no exposure to our specific stack or codebase, with a goal of them shipping one real, complete piece of work within their first several weeks.\n\nAction\nWeek one was mostly orientation and a short assessment task to see where they actually stood, not a generic reading list. From there, I gave them a small real bug fix with a tight review loop so they got fast, specific feedback on our conventions early, before those habits calcified the wrong way. Over the following weeks the scope widened: a small self-contained feature with me reviewing closely, then a larger piece with me available but stepping back from line-by-line review, focusing instead on the riskiest parts of the design.\n\nResult\nThey shipped a real, complete piece of work end-to-end within the target window, with a review pass that looked much closer to how we review any other team member's work by that point, which was the actual signal of readiness, not just that the calendar had passed.\n\nTrade-offs & pitfalls\n\nTreating every new hire's plan as the same template. A junior mentor runs the same onboarding for a contractor, a career-changer, an intern cohort, and a senior IC. A senior mentor adapts the shape of the plan to who's actually arriving, because the actual gap being closed is different in each case.\nUnder-scoping early tasks out of excessive caution, or over-scoping out of impatience. Both undermine the confidence-building purpose of the early stretch: too small and it's condescending or boring; too large too soon and the first review becomes overwhelming and demoralizing.\nNot defining \"done\" up front. Ambiguity about what counts as finished either causes needless rework or lets something ship that isn't actually ready, and both erode trust in the mentoring relationship.\nIgnoring the constraints a nontraditional hire is actually operating under. Applying a full-access, in-person, junior-IC plan to a least-privilege contractor or a remote hire sets them up to fail on logistics that have nothing to do with their actual skill."}},{"@type":"Question","name":"Some problems are not phrased as 'search this array' but still have a monotonic answer space: for example, given job sizes and a fixed number of identical servers, find the minimum possible value of the maximum load per server; or, given positions along a line, place k markers to maximize the minimum distance between any two. Explain how you recognize that binary search applies here even though there is no sorted array to search.","acceptedAnswer":{"@type":"Answer","text":"Direct answer\nBinary search doesn't require a sorted array; it only requires a monotonic predicate over the answer space, meaning that as candidate answers are scanned in one direction, the predicate flips from false to true (or true to false) exactly once. Once a fast \"is this candidate value feasible\" check exists with that monotonic property, the search runs directly over the range of possible answers instead of over array indices.\n\nStructured elaboration\nApproach\nRecognizing the pattern: look for a question phrased as \"find the minimum or maximum value such that some condition holds,\" where checking the condition for one fixed candidate value is easier than finding the optimal value directly. If increasing the candidate value can only make the condition easier (or only harder) to satisfy, never both, the condition is monotonic and binary search applies.\nJob/server example: minimize the maximum load assigned to any of k identical servers, given a list of job sizes. For a candidate max-load D, checking feasibility means greedily assigning jobs to a server until adding the next job would exceed D, at which point a new server starts; if the assignment finishes using k or fewer servers, D is feasible. Feasibility is monotonic in D: any D' greater than a feasible D is also feasible, since a looser cap can only make greedy assignment use the same number of servers or fewer.\nMarker-placement example: place k markers along a line to maximize the minimum distance between any two chosen markers. For a candidate minimum distance D, checking feasibility means greedily placing markers left to right, always taking the next position at least D away from the last placed marker; if that produces k or more markers, D is feasible. Feasibility is monotonic in the opposite direction here: any D' smaller than a feasible D is also feasible, since a smaller required gap can only let you place the same number of markers or more.\nThe same recognize-the-monotonic-property instinct applies to the \"find peak element\" problem, where the array itself is not sorted at all, but comparing an element to one neighbor still tells you which half must contain a peak; \"is there a peak here or to one side\" is a property that binary search's halving can still exploit even though nothing about the array is globally ordered.\n\ndef max_min_load(job_sizes, num_servers):\n \"\"\"\n Minimum possible value of the maximum load on any server, splitting the\n jobs (in given order) into num_servers contiguous groups.\n \"\"\"\n def feasible(max_load):\n servers_used = 1\n current = 0\n for size in job_sizes:\n if current + size > max_load:\n servers_used += 1\n current = size\n if servers_used > num_servers:\n return False\n else:\n current += size\n return True\n\n lo, hi = max(job_sizes), sum(job_sizes)\n while lo < hi:\n mid = (lo + hi) // 2\n if feasible(mid):\n hi = mid\n else:\n lo = mid + 1\n return lo\n\ndef max_min_distance(positions, k):\n \"\"\"\n Place k markers among sorted positions to maximize the minimum distance\n between any two adjacent chosen markers.\n \"\"\"\n positions = sorted(positions)\n\n def can_place(min_dist):\n count, last = 1, positions[0]\n for p in positions[1:]:\n if p - last >= min_dist:\n count += 1\n last = p\n return count >= k\n\n lo, hi = 0, positions[-1] - positions[0]\n while lo < hi:\n mid = (lo + hi + 1) // 2 # bias up: looking for the largest feasible D\n if can_place(mid):\n lo = mid\n else:\n hi = mid - 1\n return lo\n\nKey points\nThe object binary search operates over is the candidate answer value, not an array index.\nProving the greedy feasibility check is monotonic, and separately proving that the greedy check itself is correct, are two distinct things to justify in an interview.\nThe search range's bounds come from the problem itself, for example [max single job size, sum of all job sizes] for the load-balancing version.\n\nWorked example\njob_sizes = [7, 2, 5, 10, 8], num_servers = 2. Binary search bounds: lo = max(job_sizes) = 10, hi = sum(job_sizes) = 32. Checking feasible(18): greedily accumulate 7, 2, 5 (running total 14); adding 10 would make 24 > 18, so a second server starts with 10, then 8 is added (running total 18, exactly at the cap). The assignment finishes using exactly 2 servers, so 18 is feasible. Checking feasible(17): the same greedy walk starts a third server once it reaches 8, exceeding the 2-server budget, so 17 is infeasible. Binary search converges on the smallest feasible value: max_min_load([7, 2, 5, 10, 8], 2) prints 18.\n\npositions = [1, 2, 4, 8, 9], k = 3: max_min_distance prints 3, matching a direct check that placing markers at 1, 4, 8 gives a minimum gap of 3, and no arrangement of 3 markers on these positions can do better than 3.\n\nTrade-offs & pitfalls\nComplexity\nTime: , where n is the number of jobs or positions (each feasibility check is ) and W is the width of the answer search range (sum of job sizes, or the max position minus the min position); is the number of binary-search iterations.\nSpace: extra beyond sorting, if sorting is needed (the marker-placement version needs the positions sorted first, a one-time cost).\n\nEdge cases\nk <= 1 for the marker-placement version: any single marker trivially satisfies any distance requirement, so the answer is unconstrained (commonly defined as 0 or unbounded, depending on the problem statement).\nnum_servers >= number of jobs: every job gets its own server, and the answer is just the largest single job.\nAll positions or job sizes equal: the feasibility checks degenerate but still behave correctly under the same greedy logic.\n\nThe hardest part of this pattern is proving the greedy feasibility check is actually correct, not just monotonic, which usually requires an exchange argument (showing any optimal solution can be rearranged into the greedy one without making it worse); stating \"binary search works because the answer space is monotonic\" without also justifying the O(n) check itself is an incomplete answer. A second common mistake is getting the search bounds wrong, either missing a valid answer at the boundary or introducing an off-by-one that causes the loop to terminate one step early or loop forever, depending on which bound is biased toward on a tie."}}]}Airbnb's Frontend Engineer interview process consists of a recruiter screening, an online technical assessment featuring algorithmic problems, and a comprehensive virtual onsite known as the 'Engineering Loop.' The Engineering Loop comprises four distinct rounds evaluating coding proficiency, system design thinking, code review competency, and cultural alignment. For mid-level candidates, expect 4-6 weeks from initial application to offer, with emphasis on practical frontend problem-solving, architectural thinking, and user-centric design considerations. The process focuses on evaluating your ability to build scalable, performant, and accessible user interfaces while demonstrating clear communication and Airbnb's core values.
Your server-rendered React app passes a large initial state to the client and hydration dominates time to interactive. What would you change, and what does each option cost in complexity?
Product wants the fastest possible improvement to page load time and gives you four weeks. You're weighing frontend work like lazy-loading and code-splitting against a backend API-aggregation effort. Which would you recommend starting with, and what would change your answer?
Explain CSS custom properties (variables): syntax, cascade and inheritance behavior, runtime updates via JavaScript, fallback values, and how they differ from preprocessor variables. Give examples where custom properties simplify theming and reduce duplication.
A layout looks correct in Chrome DevTools responsive mode, but on a real iPhone the header overlaps content when the browser chrome changes height and a sticky footer jumps unexpectedly. How would you debug and fix this class of responsive bugs?
How do you stay informed about what a function you regularly work with actually cares about and is measured on, even when you're not in the room for their planning?
You need a draggable list that works with a mouse and on touchscreens. Compare using the native HTML5 drag-and-drop API with building it on pointer events, and say which you would choose and why.
What is the difference between 'culture fit' and 'culture add', and which do you think better describes you as a candidate? Give one concrete example of a perspective, skill, or way of working you would bring to a team that is not already well represented there.
An effect sets state that is also in its own dependency list, and the page freezes. Reproduce the loop in a few lines and walk through how you would break it, saying when each fix is appropriate.
Describe a time you mentored someone from their first day through shipping their first piece of real work. How did you ramp them up?
Some problems are not phrased as 'search this array' but still have a monotonic answer space: for example, given job sizes and a fixed number of identical servers, find the minimum possible value of the maximum load per server; or, given positions along a line, place k markers to maximize the minimum distance between any two. Explain how you recognize that binary search applies here even though there is no sorted array to search.
Visual-first, interactive, structured learning paths
AI-enriched listings across hundreds of company career pages
Explore Jobs