\n\n\n\nWhich event methods and why\n\nStart with the first three rows: submit, preventDefault() and checkValidity() are the working core, and the later rows cover the alternatives an interviewer may ask about.\n\nMethod / event | Used for | Why this and not the alternative\n\nsubmit event on the
| The single place every submission passes through | Clicking the button, pressing Enter in a field, and form.requestSubmit() all fire it. A click listener on the button misses requestSubmit() and treats the click as the whole story.\nevent.preventDefault() | Cancel the default action (the request and the navigation) | MDN: it tells the browser the event is being handled, so the default action should not occur. The submit event is cancelable.\nform.checkValidity() | Ask \"is every control valid?\" without showing any browser UI | It returns a boolean and fires an invalid event on each failing control. reportValidity() would also pop the browser's own bubble on the first one, which fights a custom summary.\nelement.focus() | Move the keyboard cursor to the summary (tabindex=\"-1\" makes a non-interactive element focusable by script) | Without it a keyboard or screen reader user stays on the Join button with no sign anything happened.\nform.requestSubmit() | Submit from script the way a button would | It fires submit (and, unless the form has novalidate, runs the browser's own validation first, per MDN); form.submit() does neither (it just sends), so a handler would never see it.\n\nVocabulary for the next lines. An event \"bubbles\" when, after firing on its target element, it also fires on each ancestor in turn up to the document; \"propagation\" is that travel. Before bubbling there is a capture phase in which the event travels from the document down to the target; a listener added normally runs in the bubble phase, and passing true as the third argument to addEventListener makes it run in the capture phase instead. \"Cancelable\" means the event has a default action that preventDefault() is allowed to cancel, and event.defaultPrevented becomes true once it has. :invalid is a CSS pseudo-class (a selector for an element state) matching form controls that currently fail their constraints, which is how the handler's querySelectorAll(':invalid') finds the failing fields.\n\nNot needed: stopPropagation(). It stops the event reaching other listeners (analytics, a framework) on the elements it has yet to visit, and is independent of preventDefault(), which does not stop propagation either. return false also does not work here: in a listener added with addEventListener the return value is ignored (the run below confirms the form is still sent); it cancels only from an onsubmit attribute or property handler, which the check also exercises. The invalid event does not bubble, so if you listen for it on the form you need the capture phase (addEventListener('invalid', fn, true)).\n\nAccessible landing place\n\nThe summary has tabindex=\"-1\", a heading and one link per problem. After a failed submit summary.focus() puts the keyboard cursor there; each link calls input.focus() for its field. The summary is rebuilt on every attempt, listing only fields that are still invalid, so fixing one and submitting again shortens the list. novalidate on the form switches off the browser's own bubbles so there is one source of messages. The server must still validate; none of this stops a hand-made request.\n\nProof\n\nThe check loads the page in Chromium, Firefox and WebKit through Playwright 1.48.2 (WebKit here is not Safari on iOS), with the server faked by request routing so form posts are visible:\n\nimport { chromium, firefox, webkit } from 'playwright';\nimport { readFileSync } from 'node:fs';\nimport assert from 'node:assert/strict';\n\nconst html = readFileSync(new URL('./form.html', import.meta.url), 'utf8');\nconst results = [];\nfor (const [name, type] of [['chromium', chromium], ['firefox', firefox], ['webkit', webkit]]) {\n const browser = await type.launch();\n const page = await browser.newPage();\n const posts = [];\n await page.route('http://app.test/**', (route) => {\n const req = route.request();\n if (req.url().endsWith('/ok')) { posts.push(req.method() + ' ' + req.postData()); return route.fulfill({ contentType: 'text/html', body: '

sent

' }); }\n return route.fulfill({ contentType: 'text/html', body: html });\n });\n await page.goto('http://app.test/form');\n await page.evaluate(() => {\n window.log = { submit: 0, prevented: [], invalid: 0 };\n const f = document.getElementById('waitlist');\n f.addEventListener('submit', (e) => setTimeout(() => window.log.prevented.push(e.defaultPrevented), 0)); // after the page handler ran\n f.addEventListener('invalid', () => window.log.invalid++, true); // 'invalid' does not bubble: capture it\n });\n\n // 1. Empty submit by clicking\n await page.click('button');\n await page.waitForFunction(() => window.log.prevented.length === 1); // the listener records inside a setTimeout: wait for it instead of racing it\n const a = await page.evaluate(() => ({ url: location.href, active: document.activeElement.id, hidden: document.getElementById('summary').hidden, items: [...document.querySelectorAll('#summary-list a')].map((x) => x.textContent), log: window.log }));\n assert.equal(a.url, 'http://app.test/form'); assert.equal(a.active, 'summary'); assert.equal(a.hidden, false);\n assert.deepEqual(a.items, ['Enter your email address', 'Enter your age']);\n assert.equal(posts.length, 0);\n assert.deepEqual(a.log.prevented, [true]); // the submit event's default (sending the form) was cancelled\n\n // 2. Enter inside a field goes through the same submit event\n await page.click('#email'); await page.keyboard.type('ada@example.com'); await page.keyboard.press('Enter');\n const b = await page.evaluate(() => ({ items: [...document.querySelectorAll('#summary-list a')].map((x) => x.textContent), active: document.activeElement.id }));\n assert.deepEqual(b.items, ['Enter your age']); assert.equal(b.active, 'summary'); assert.equal(posts.length, 0);\n\n // 3. A summary link moves focus to the field\n await page.click('#summary-list a');\n assert.equal(await page.evaluate(() => document.activeElement.id), 'age');\n\n // 4. requestSubmit() fires the submit event like a button click would (this form has novalidate, so the page's own handler does the checking)\n await page.evaluate(() => document.getElementById('waitlist').requestSubmit());\n await page.waitForFunction(() => window.log.prevented.length === 3);\n assert.deepEqual(await page.evaluate(() => window.log.prevented), [true, true, true]);\n assert.equal(posts.length, 0);\n\n // 5. Valid submit is not cancelled and the browser sends the request\n await page.fill('#age', '34');\n await Promise.all([page.waitForNavigation(), page.click('button')]);\n assert.equal(posts.length, 1);\n assert.match(posts[0], /^POST email=ada%40example.com&age=34$/);\n\n // 6. The wrong tool: returning false from an addEventListener handler does NOT cancel the submission\n await page.goto('http://app.test/form');\n await page.evaluate(() => document.getElementById('waitlist').addEventListener('submit', () => false));\n await page.fill('#email', 'x@y.com'); await page.fill('#age', '40');\n await Promise.all([page.waitForNavigation(), page.click('button')]);\n assert.equal(posts.length, 2);\n\n // 6b. ...but returning false from an onsubmit property handler does cancel it\n await page.goto('http://app.test/form');\n await page.evaluate(() => { document.getElementById('waitlist').onsubmit = () => false; });\n await page.fill('#email', 'x@y.com'); await page.fill('#age', '40');\n await page.click('button'); await page.waitForTimeout(100);\n assert.equal(posts.length, 2);\n assert.equal(page.url(), 'http://app.test/form');\n\n // 7. invalid events: one per failing control, none bubbling to the form\n await page.goto('http://app.test/form');\n await page.evaluate(() => { window.n = 0; document.getElementById('waitlist').addEventListener('invalid', () => window.n++); window.nCapture = 0; document.getElementById('waitlist').addEventListener('invalid', () => window.nCapture++, true); });\n await page.click('button');\n const inv = await page.evaluate(() => ({ bubbling: window.n, capture: window.nCapture }));\n assert.deepEqual(inv, { bubbling: 0, capture: 2 });\n\n results.push(${name}: ok summaryItems=${a.items.length} invalidEventsCaptured=${inv.capture} invalidEventsBubbling=${inv.bubbling});\n await browser.close();\n}\nconsole.log(results.join('\\n'));\nconsole.log('ALL CHECKS PASSED in chromium, firefox, webkit');\n\nRun as described under Running the code, it prints the three browser lines and ALL CHECKS PASSED in chromium, firefox, webkit:\n\nchromium: ok summaryItems=2 invalidEventsCaptured=2 invalidEventsBubbling=0\nfirefox: ok summaryItems=2 invalidEventsCaptured=2 invalidEventsBubbling=0\nwebkit: ok summaryItems=2 invalidEventsCaptured=2 invalidEventsBubbling=0\nALL CHECKS PASSED in chromium, firefox, webkit\n\nIt asserts that an empty submit leaves the URL unchanged, sends no request, records defaultPrevented as true on the submit event, lists two problems and focuses the summary; that Enter inside a field does the same with the one remaining problem; that requestSubmit() fires the same event; that a valid form is sent as a POST with email=ada%40example.com&age=34; that a listener returning false does not stop the request while an onsubmit property returning false does. Deleting the preventDefault() line makes it fail because the page navigates away.\n\nReading the harness: page.route intercepts every request to the fake host app.test, serving the form HTML for the page and answering /ok itself while recording the method and body in posts, so \"was the form sent?\" becomes \"is posts empty?\". The submit listener added from the test runs after the page's own handler, because it was registered later; wrapping its read of e.defaultPrevented in setTimeout(..., 0) also delays it until all handlers have finished, so the recorded value is the final one. That timeout is also why the test waits with page.waitForFunction for the record to appear before reading it: reading straight after the click can run before the timer fires, which makes the check fail on an occasional run. waitForNavigation waits for the page to load a new document, which only happens when the submit was not cancelled.\n\nEdge cases and pitfalls\n\nA

Frontend Developer Interview Preparation Guide - Junior Level (1-2 Years Experience)

Frontend Developer
Junior
6 rounds
Updated 6/22/2026

This guide is based on general FAANG interview practices and may not reflect specific company procedures.

The interview process for a Junior Frontend Developer typically consists of 6 rounds spanning 3-4 weeks. You will progress through recruiter screening, multiple technical evaluations focusing on JavaScript fundamentals, HTML/CSS proficiency, DOM manipulation, UI component building, framework expertise (React/Vue/Angular), and behavioral assessment aligned with company values. Each round builds on your demonstrated skills and cultural fit. For Junior level roles, the emphasis is on strong fundamentals, ability to work independently with guidance, and demonstrated capacity to write clean, maintainable code that prioritizes user experience.

Interview Rounds

1

Recruiter Screening Call

2

Technical Phone Screen

3

Frontend Coding Interview - JavaScript Utilities & DOM APIs

4

Frontend UI Component Building Interview

5

Framework Specialization Interview (React/Vue/Angular)

6

Behavioral & Cultural Fit Interview

Frequently Asked Frontend Developer Interview Questions

JavaScript and TypeScript FundamentalsEasyTechnical
46 practiced

In what order does JavaScript enumerate an object's keys? Show a surprising case where code that relies on that order produces wrong results, for example when keys look like integers.

Clean Code, Refactoring, and MaintainabilityHardTechnical
56 practiced

You inherit a large, legacy codebase with virtually no automated tests and frequent production bugs, and you're on a deadline. Describe your pragmatic, incremental plan to make it safer to change: where you start, how you add tests before refactoring, and how you keep shipping while doing it.

UI Component Implementation: Forms and StatesEasyTechnical
62 practiced

A form must not submit when client-side validation fails. In vanilla JavaScript, show how you handle the submit event so the browser does not send the request, tell the user what is wrong, and give them somewhere accessible to land. Which event methods do you rely on and why?

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.

Frontend Component and State ArchitectureMediumTechnical
97 practiced

State is stored as users and posts keyed by id with id lists, and each post has an authorId. Write a selector returning [{id, title, authorName}] that returns the same array reference when nothing relevant changed.

Systematic Debugging and Root Cause AnalysisEasyTechnical
27 practiced

A layout bug reproduces reliably in Safari but you can't get it to happen in Chrome or Firefox. How do you approach figuring out whether it's a real bug or a browser quirk?

Programming FundamentalsMediumTechnical
97 practiced

Discuss the trade-offs between recursion and iteration: readability, call-stack usage, the risk of a stack overflow on deep input, and tail-call optimization availability across languages. Sketch a recursive factorial implementation and a tail-recursive or iterative variant, and explain why tail-call optimization is not guaranteed even when you write tail-recursive code (for example in Python).

Arrays, Strings, and HashingEasyTechnical
43 practiced

Compare an array (contiguous memory) vs a singly linked list for these operations: random access, insert at head, insert at middle, delete, and iteration. Give big-O time complexities and concrete scenarios when you'd favor one over the other.

Asynchronous and Event-Driven ProgrammingMediumTechnical
55 practiced

You have an array of functions that each return a promise, for example 500 uploads. Write runWithConcurrency(tasks, limit) that keeps at most limit running at once, returns results in the original order, and lets the caller choose between stopping at the first failure and collecting every outcome. How does it behave when limit exceeds the task count or a task throws synchronously?

Clear Written and Verbal CommunicationEasyTechnical
71 practiced

How do you structure a short, time-boxed presentation so a live audience can follow it: what goes in the opening, how do you signal the shape of the talk as you move through it, and how do you close?

Additional Information

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