\n\n\n\nProving it in three engines\nReading the test: steps 1 and 2 check focus order and the visible outline; step 3 presses Enter then Space on the focused div, expecting two clicks and no scrolling; step 4 checks that aria-pressed flips; step 5 asks Playwright for the accessibility tree and lists the role of every node named Save; step 6 and 6b check the two disabled divs; step 7 clicks the two submit controls inside the form; steps 8 to 10 are the mutation checks; step 11 prints the native button's event order.\n\nThis test drives real keyboards (keydown is the event fired when a key goes down, keyup when it is released) in Chromium, Firefox and WebKit (Playwright's WebKit is the engine Safari is built on, not Safari). It checks: the first Tab stop is the repaired div and not the legacy one; the outline is 3px solid from the :focus-visible rule; Enter and Space give exactly two clicks and the page does not scroll; aria-pressed flips true then false; the accessibility tree contains two nodes named \"Save\" with role button (the repaired div and the native button) and none for the legacy div; a programmatic click (el.click(), a click fired from script rather than by a pointer) still reaches the plain aria-disabled div's handler, while the guarded div ignores both a programmatic click and an Enter press; a form submits through the native submit button but not through the div. Mutation checks (deliberately removing the code a check covers, to prove the check can fail) delete the Space preventDefault (the page now scrolls, which is what a browser does with Space by default when focus is not in a text field), the :focus-visible rule (the outline is none) and the guard line (the guarded div's action now runs twice). The test waits for scrollY to become greater than 0, up to a time limit, instead of asserting at once, because the page does not necessarily move in the same instant as the key press. A last step records the event order of a native button for Enter and for Space.\n\n// div-button-test.mjs\nimport { chromium, firefox, webkit } from 'playwright';\nimport { readFileSync } from 'node:fs';\n\nconst html = readFileSync('div-button.html', 'utf8');\nlet failures = 0;\nconst check = (ok, msg) => { if (!ok) { failures++; console.log(' FAIL', msg); } };\nconst clicks = (page, id) => page.evaluate((i) => window.clicks[i] || 0, id);\nconst active = (page) => page.evaluate(() => document.activeElement.id || document.activeElement.tagName);\n// Resolves to the scroll offset once it is above 0, or to 0 if the page stays put for ms milliseconds.\nconst scrollWithin = (page, ms) => page.waitForFunction(() => scrollY > 0, null, { timeout: ms }).then(() => page.evaluate(() => scrollY), () => 0);\nconst roleOf = async (page, name) => {\n const tree = await page.accessibility.snapshot({ interestingOnly: false });\n const found = [];\n (function walk(n) { if (n.name === name && !n.role.startsWith('text')) found.push(n.role); (n.children || []).forEach(walk); })(tree);\n return found;\n};\n\nfor (const [name, type] of [['chromium', chromium], ['firefox', firefox], ['webkit', webkit]]) {\n const b = await type.launch();\n const page = await b.newPage();\n await page.setContent(html);\n\n // 1. Focus order: Tab skips the legacy div and lands on the fixed one first.\n await page.keyboard.press('Tab');\n const firstStop = await active(page);\n check(firstStop === 'fixed', ${name} first Tab stop is ${firstStop});\n\n // 2. Visible focus style comes from our :focus-visible rule (the .btn:focus rule removed the default).\n const outline = await page.$eval('#fixed', (el) => getComputedStyle(el).outlineWidth + ' ' + getComputedStyle(el).outlineStyle);\n check(outline === '3px solid', ${name} focus outline ${outline});\n\n // 3. Enter and Space each activate once; Space does not scroll the page.\n await page.keyboard.press('Enter');\n await page.keyboard.press(' ');\n const scrollY = await scrollWithin(page, 600);\n const fixedClicks = await clicks(page, 'fixed');\n check(fixedClicks === 2 && scrollY === 0, ${name} Enter/Space ${fixedClicks} clicks, scrollY ${scrollY});\n\n // 4. Toggle keeps aria-pressed in sync.\n await page.focus('#mute');\n await page.keyboard.press('Enter');\n const p1 = await page.getAttribute('#mute', 'aria-pressed');\n await page.keyboard.press(' ');\n const p2 = await page.getAttribute('#mute', 'aria-pressed');\n check(p1 === 'true' && p2 === 'false', ${name} aria-pressed ${p1},${p2});\n\n // 5. Accessibility tree: role exposed for the fixed div, not for the legacy one.\n const legacyRoles = await roleOf(page, 'Save');\n const fixedHasButton = legacyRoles.filter((r) => r === 'button').length;\n // two nodes named Save expose role button (the fixed div and the native button); the legacy div exposes no role, only its text\n check(fixedHasButton === 2 && legacyRoles.length === 2, ${name} roles named Save: ${legacyRoles.join(',')});\n\n // 6. Disabled: the div still receives programmatic clicks, the native disabled button does not.\n await page.evaluate(() => { document.getElementById('off').click(); document.getElementById('native-off').click(); });\n const offDiv = await clicks(page, 'off'), offNative = await clicks(page, 'native-off');\n check(offDiv === 1 && offNative === 0, ${name} disabled div ${offDiv} native ${offNative});\n\n // 6b. The guarded div ignores a programmatic click() and an Enter key press while aria-disabled is \"true\".\n await page.evaluate(() => document.getElementById('off-guard').click());\n await page.focus('#off-guard');\n await page.keyboard.press('Enter');\n const guarded = await clicks(page, 'off-guard');\n check(guarded === 0, ${name} guarded div clicks ${guarded});\n\n // 7. Forms: the native submit button submits, the div does not.\n await page.click('#div-submit');\n const afterDiv = await page.evaluate(() => window.formSubmits);\n await page.click('#native-submit');\n const afterNative = await page.evaluate(() => window.formSubmits);\n check(afterDiv === 0 && afterNative === 1, ${name} submits div ${afterDiv} native ${afterNative});\n\n // 8. Mutation: without preventDefault on Space keydown, the page scrolls.\n await page.setContent(html.replace(\"if (e.key === ' ') e.preventDefault(); // stop the page from scrolling on Space\", ''));\n await page.focus('#fixed');\n await page.keyboard.press(' ');\n const scrolled = await scrollWithin(page, 3000);\n check(scrolled > 0, ${name} mutation should scroll, scrollY ${scrolled});\n\n // 9. Mutation: without the :focus-visible rule, the .btn:focus reset leaves no outline on keyboard focus.\n await page.setContent(html.replace(/ \\.btn:focus-visible \\{[^\\n]*\\n/, ''));\n await page.keyboard.press('Tab');\n const bare = await page.$eval('#fixed', (el) => getComputedStyle(el).outlineStyle);\n check(bare === 'none', ${name} mutation outline ${bare});\n\n // 10. Mutation: without the guard line, the same two activations both reach the action.\n await page.setContent(html.replace(\" if (e.currentTarget.getAttribute('aria-disabled') === 'true') return;\\n\", ''));\n await page.evaluate(() => document.getElementById('off-guard').click());\n await page.focus('#off-guard');\n await page.keyboard.press('Enter');\n const unguarded = await clicks(page, 'off-guard');\n check(unguarded === 2, ${name} mutation should give 2 clicks, got ${unguarded});\n\n // 11. Event order of a native button, recorded for comparison with the div's handlers.\n await page.setContent(html);\n const seq = async (key) => {\n await page.evaluate(() => { window.seen = []; });\n await page.focus('#native');\n await page.keyboard.press(key);\n return page.evaluate(() => window.seen.join('>'));\n };\n await page.evaluate(() => {\n const el = document.getElementById('native'); window.seen = [];\n for (const t of ['keydown', 'keyup', 'click']) el.addEventListener(t, () => window.seen.push(t));\n });\n const nativeEnter = await seq('Enter'), nativeSpace = await seq(' ');\n check(nativeEnter === 'keydown>click>keyup' && nativeSpace === 'keydown>keyup>click', ${name} native order ${nativeEnter} | ${nativeSpace});\n\n console.log(${name}: first Tab stop=${firstStop}, outline=${outline}, fixed clicks=${fixedClicks}, scrollY=${scrollY}, aria-pressed ${p1}->${p2}, +\n roles named Save=[${legacyRoles.join(',')}], disabled div clicks=${offDiv}, native=${offNative}, guarded div=${guarded} (without guard=${unguarded}), submits div=${afterDiv} native=${afterNative}, +\n scrollY without preventDefault>0=${scrolled > 0}, outline without rule=${bare});\n console.log(${name}: native button events, Enter: ${nativeEnter} | Space: ${nativeSpace});\n await b.close();\n}\nconsole.log(failures === 0 ? 'ALL CHECKS PASSED' : ${failures} FAILURES);\nprocess.exit(failures ? 1 : 0);\n\nOutput (the script above run in the Playwright 1.48.2 image; the lines were identical across repeated runs):\n\nchromium: first Tab stop=fixed, outline=3px solid, fixed clicks=2, scrollY=0, aria-pressed true->false, roles named Save=[button,button], disabled div clicks=1, native=0, guarded div=0 (without guard=2), submits div=0 native=1, scrollY without preventDefault>0=true, outline without rule=none\nchromium: native button events, Enter: keydown>click>keyup | Space: keydown>keyup>click\nfirefox: first Tab stop=fixed, outline=3px solid, fixed clicks=2, scrollY=0, aria-pressed true->false, roles named Save=[button,button], disabled div clicks=1, native=0, guarded div=0 (without guard=2), submits div=0 native=1, scrollY without preventDefault>0=true, outline without rule=none\nfirefox: native button events, Enter: keydown>click>keyup | Space: keydown>keyup>click\nwebkit: first Tab stop=fixed, outline=3px solid, fixed clicks=2, scrollY=0, aria-pressed true->false, roles named Save=[button,button], disabled div clicks=1, native=0, guarded div=0 (without guard=2), submits div=0 native=1, scrollY without preventDefault>0=true, outline without rule=none\nwebkit: native button events, Enter: keydown>click>keyup | Space: keydown>keyup>click\nALL CHECKS PASSED\n\nReading one engine's line: roles named Save=[button,button] is the repaired div plus the native button, with no role for the legacy div. disabled div clicks=1 against native=0 shows the plain aria-disabled div still being activated while the native disabled button is not. guarded div=0 (without guard=2) shows the guard working and the mutation proving the check can fail. submits div=0 native=1 is the form result, and scrollY without preventDefault>0=true and outline without rule=none are the other two mutation results. The second line per engine is the native button's event order, as measured: Enter fires click between keydown and keyup, while Space fires it after keyup.\n\nWhy each choice\nEnter and Space, with Space kept from scrolling. MDN lists Enter and Space as the keys that activate a button. The handler fires on Enter at keydown and on Space at keyup because that is the order in which a native button fires click (the printed keydown>click>keyup and keydown>keyup>click lines). preventDefault() (a call that cancels the browser's default action for the event) on the Space keydown stops the page scrolling. Without that call, the mutation run shows the page scrolls in all three engines when Space is pressed on the focused div.\n:focus-visible, not :focus. The legacy stylesheet resets :focus to outline: none, which is the typical way a focus ring disappears. :focus-visible brings back an indicator when the browser decides one is needed (keyboard focus), without a ring on every mouse click.\nToggles need state in the markup. aria-pressed is the state a toggle button exposes; the handler flips it on each activation, so what is drawn and what is exposed cannot disagree.\naria-disabled is only a label. In the run, a programmatic click() on the plain aria-disabled div still reached its handler (1 click) while the native disabled button received none (0 clicks). The div also stays in the Tab order. So the handler must check aria-disabled itself and return early, as the Export (guarded) div's handler does: its click and Enter activations both count 0, and counting 2 once the guard line is deleted shows the check can fail.\n\nWhere to push back and insist on the native element\nMDN's recommendation: \"it is recommended to use native HTML buttons ... rather than the button role, as native HTML buttons are supported by all user agents and assistive technology and provide keyboard and focus requirements by default, without need for additional customization.\"\n\nCosts of keeping the div that the run shows: a click on the div inside a form submitted nothing, while the native submit button submitted it once; the native disabled attribute blocked clicks on its own, while the div's aria-disabled blocked them only after the guard was written by hand. Each of these is code the div has to carry and maintain, and a native button needs none of it. Push back when: the control is inside a
, when it needs a real disabled state, when it will be reused across pages, and whenever the team proposes skipping the key handlers. The compromise for this sprint is the repaired div above with a ticket to swap in

Senior Frontend Developer Interview Preparation Guide - Microsoft

Frontend Developer
Microsoft
Senior
6 rounds
Updated 6/14/2026

Microsoft's senior-level frontend developer interview process spans 4-6 weeks and includes 6 core rounds: recruiter screening, two phone technical screens (React implementation and algorithm problem-solving), and three comprehensive onsite rounds (React application implementation, system design, and behavioral leadership assessment). The process emphasizes deep JavaScript and React mastery combined with architectural thinking, system design capabilities, and demonstrated technical leadership. Microsoft evaluates candidates not only on coding ability but also on mentorship potential, cross-functional collaboration, and alignment with company values of customer obsession and growth mindset.

Interview Rounds

1

Recruiter Screening

2

Phone Technical Screen - React Implementation

3

Phone Technical Screen - Algorithm Problem-Solving

4

Onsite Round 1 - React Application Implementation

5

Onsite Round 2 - Frontend System Design

6

Onsite Round 3 - Behavioral and Technical Leadership

Frequently Asked Frontend Developer Interview Questions

Real-Time and Streaming System DesignEasyTechnical
45 practiced

Compare WebSockets, Server-Sent Events (SSE), long polling, and regular polling for real-time client-server communication. For each transport explain: connection model (half/full-duplex), typical latency characteristics, browser/proxy support, server resource implications, and common use-cases (e.g., collaborative editing, live notifications, stock tickers). Conclude with recommended transport(s) for (a) a live chat app and (b) a server-to-many broadcasting system.

Clean Code, Refactoring, and MaintainabilityEasyTechnical
36 practiced

Suppose a profile-card component receives data from an unreliable API. List the concrete defensive checks you would add to avoid runtime errors and a poor user experience: null and undefined guards, default values, type narrowing in TypeScript, timeout handling, and retry limits. Show short code examples where helpful.

Mentoring and CoachingMediumBehavioral
125 practiced

Tell me about a time you sponsored someone, not just mentored them. Where you actively advocated for their promotion or a specific opportunity in a room they weren't in.

UI Component Implementation: Forms and StatesHardTechnical
58 practiced

You are asked to build a reusable form hook for a React and TypeScript codebase that tracks field values, which fields the user has touched, and validation errors, and supports both instant and server-backed rules and rules that span several fields. What API do you expose, how do you keep re-renders under control on a large form, and how do you keep it type-safe?

Cross-Functional CollaborationMediumTechnical
38 practiced

Legal sign-off is going to take three weeks, but the team wants to ship in one. How do you manage that timeline without steamrolling legal's concerns?

Frontend Fundamentals: HTML, CSS, and Responsive StylingEasyTechnical
91 practiced

A legacy page uses a div with a click handler as a Save button, and you cannot change it to a native button this sprint. What does a keyboard or screen-reader user get wrong with it today, and what would you add so it behaves like a real button? Where would you still push back and insist on the native element?

Company Culture and Values FitHardSystem Design
68 practiced

Outline a plan to scale a team from roughly 5 to 50 people (or from 3 to 12, for a smaller function) while preserving candor, autonomy, and psychological safety. Cover hiring criteria, organizational structure, onboarding, communication rituals, decision rights, and how you would propagate the culture and catch drift as the team grows.

Conflict Resolution and Difficult ConversationsMediumTechnical
61 practiced

A senior stakeholder accuses your team, in a meeting, of cherry-picking numbers to fit a narrative. How do you respond right then, and what do you do over the following weeks to restore confidence in your team's work?

Algorithmic Problem-Solving and Data Structure SelectionMediumTechnical
44 practiced

When you are updating the same field (position, color, a numeric buffer) across millions of elements every frame or every batch, does storing them as an array of structs or as a struct of parallel arrays perform better, and why? Extend the same question to choosing a typed, fixed-width numeric array over a general-purpose array for that hot loop.

Test Case Design and Edge Case AnalysisHardTechnical
94 practiced

You need to ensure the checkout flow is robust across edge cases (payment provider failures, slow networks, multi-tab use, partial failures). Propose a balanced test suite across unit, integration, and E2E tests, listing specific test cases for edge behaviors, test data strategies, decisions for mocking versus using sandbox endpoints, and techniques to reduce E2E flakiness.

Want to create your own tailored preparation guide using our deep research?

Get Started for Free

Interview-Ready Courses

Visual-first, interactive, structured learning paths

Browse Frontend Developer jobs

AI-enriched listings across hundreds of company career pages

Explore Jobs