Web Accessibility & WCAG 2.2 AA Compliance Master Interview Bank
WCAG 2.2 principles (POUR), WAI-ARIA landmark roles, accessible name calculation, focus management, screen reader optimization, and color contrast compliance.
Curriculum Roadmap & Learning Path
3 StagesPart 1: Basic & Foundational Concepts (Junior / Entry-Level)
12 QuestionsWhat is Web Accessibility (a11y) and why is it essential?
Web Accessibility (a11y) is the practice of designing and developing websites and digital tools so that people with disabilities can understand, navigate, and interact with them effectively.: Disability Spectrum: Visual (blindness, low vision, color blindness), Motor (inability to use a mouse, tremors, paralysis), Auditory (deafness.
What are the four core POUR principles of WCAG 2.2?
The Web Content Accessibility Guidelines (WCAG) are built upon four fundamental principles: Perceivable: Information and user interface components must be presentable to users in ways they can perceive (e.g. text alternatives for.
What are the WCAG Conformance Levels (Level A, Level AA, Level AAA)?
Level A (Minimum Baseline): Addresses basic barriers without which assistive technology users cannot access content at all (e.g., keyboard traps • Level AA (The Global Enterprise Legal Standard): Addresses the most common and critical barriers for disabled users (e.g. color contrast ratios.
What is the First Rule of ARIA use?
The W3C First Rule of ARIA: > "If you can use a native HTML element or attribute with the semantics and behavior you require already built-in, instead of re-purposing an element and adding an ARIA role, state or property to make it accessible, then do so.".
What are the WCAG Color Contrast requirements?
Color contrast is the ratio between the luminance of text and its background.
What is the difference between `aria-label`, `aria-labelledby`, and `aria-describedby`?
aria-label="string": Provides an invisible text label directly in the attribute.
Heading Structure (`<h1>` to `<h6>`) Best Practices.
Screen reader users do not read entire pages linearly; they use keyboard shortcuts (H key) to skim through headings like a table of contents: One ` per page: Represents the primary topic of the page • Never skip heading levels: Do not jump from directly to ` just to achieve smaller visual styling (use CSS for font sizing!).
How does Keyboard Accessibility work?
Any user unable to use a mouse must be able to navigate and interact with 100% of features using only the keyboard: Tab: Moves focus forward to the next interactive element • Shift + Tab: Moves focus backward to the previous element • Enter: Activates links and buttons • Spacebar: Toggles checkboxes, activates buttons, scrolls pages.
What is `tabindex` and how do `0`, `-1`, and positive values differ?
tabindex="0": Inserts an element into the natural keyboard tab order based on its position in the DOM • tabindex="-1": Makes an element programmatically focusable via JavaScript (element.focus()), but removes it from natural Tab navigation.
What are Skip Links and how do they benefit users?
A Skip Link is an accessible anchor placed at the very top of the HTML document.
How do you make images accessible with the `alt` attribute?
Informative Images: Provide concise, descriptive text explaining the meaning and context.
What are Screen Readers and how do they navigate the Accessibility Tree?
Screen Readers: Assistive software (NVDA & JAWS for Windows, VoiceOver for macOS/iOS, TalkBack for Android) that converts on-screen text and UI • Accessibility Tree: An internal browser data structure generated alongside the DOM.
Part 2: Core Architecture & Implementation (Mid-Level)
12 QuestionsHow do you build an Accessible Modal Dialog?
An accessible modal must implement four critical requirements: Focus Trap: Pressing Tab on the last element inside the modal wraps focus back to the first element; pressing Shift+Tab on the first element • aria-modal="true" & role="dialog": Tells screen readers that content outside the dialog is inert.
What are ARIA Live Regions (`aria-live="polite"` vs. `aria-live="assertive"`)?
When content updates dynamically via JavaScript (e.g., "Item added to cart" toast or real-time chat message), sighted users see it, but screen readers are unaware.
The `.sr-only` (Screen Reader Only) CSS Pattern.
Hiding text visually from the screen while keeping it fully announced in the Accessibility Tree.
Focus Indicators: `:focus-visible` vs. `:focus`.
The Cardinal Sin of a11y: outline: none without providing an alternative focus indicator makes keyboard navigation impossible for users! • :focus-visible (Modern Web Standard) • Displays a visible focus ring only when the user navigates via keyboard (Tab) • Automatically suppresses the focus ring when a user clicks with a mouse!.
How do you implement Accessible Form Validation?
When an input fails validation: Set aria-invalid="true" on the input • Link the error message element to the input using aria-describedby.
What are WAI-ARIA Landmark Roles?
Landmarks allow screen reader users to jump directly to major page regions: role="banner" (Equivalent to `) • role="navigation" (Equivalent to ) • role="main" (Equivalent to ) • role="complementary" (Equivalent to `).
How do you implement Accessible Tabs according to WAI-ARIA APG?
According to the WAI-ARIA Authoring Practices Guide (APG): Container: role="tablist" with aria-label • Tabs: role="tab", aria-selected="truefalse", aria-controls="panel-id", tabindex="0" for selected tab, tabindex="-1" for unselected tabs • Panels: role="tabpanel", aria-labelledby="tab-id", tabindex="0".
Target Size (WCAG 2.2 Success Criterion 2.5.8).
Users with motor impairments or tremors cannot click tiny buttons: WCAG 2.2 Level AA: Interactive targets must have an area of at least 24 \times 24\text{ CSS pixels}, or sufficient spacing from neighboring targets.
Adapting Animations with `prefers-reduced-motion`.
Users with vestibular disorders experience dizziness, nausea, and migraines from rapid parallax scrolling or spinning animations.
Accessible Tooltips and Disclosures (`aria-expanded`, `aria-controls`).
For accordions and expandable dropdown menus.
Automating Accessibility Testing in CI/CD with `axe-core` and Playwright.
Automating accessibility in CI/CD combines Playwright with @axe-core/playwright to audit live DOM pages against WCAG 2.1 AA rules and fail automated pull requests on violations. #### Code Example.
Accessible Breadcrumbs and Pagination.
Breadcrumbs: Wrap in with an list • Pagination: Use .
Part 3: Advanced Internals, Scale & Production Architecture (Senior / Lead)
26 QuestionsDeep Dive into the Browser Accessibility Tree and OS Accessibility APIs.
How browsers expose the DOM to the operating system.
Custom Focus Management in Single Page Applications (SPAs).
In traditional websites, full page navigation reloads the document, placing screen reader focus at the top (`). In SPAs (React, Next.js, Vue), client-side route transitions swap the DOM silently. Screen reader focus is stranded!: SPA Routing Focus Fix • On route change, update document.
Designing an Accessible Enterprise Design System.
Design Tokens: Enforce automated contrast calculation in Figma token pipelines • Component Keyboard Matrix: Every component specification documents its exact keyboard mapping before coding starts • Automated Linters: Enforce eslint-plugin-jsx-a11y in repositories.
The Combobox Pattern: Accessible Typeahead Autocomplete (`aria-activedescendant`).
When a user types in a search box and suggestions appear below: Instead of moving true focus away from the input to the dropdown items (which would stop the user from typing!), keep focus inside `` • Set role="combobox", aria-autocomplete="list", aria-expanded="true".
WCAG 2.2 New Success Criteria Breakdown.
Key additions in WCAG 2.2 (Released October 2023): Focus Appearance (2.4.11 - Level AA): Focus indicators must have a contrast ratio \ge 3:1 against unfocused states and a minimum perimeter.
Accessible Data Visualizations & Charts.
Complex D3 or SVG charts: Provide an alternative accessible HTML ` view toggle • Include and ` tags inside SVG • Do not rely exclusively on color to distinguish chart series (use dash patterns or distinct markers).
Virtualized Lists & Infinite Scrolls: Preserving Accessibility.
Virtualized lists (React Virtual, FlatList) unmount off-screen items from the DOM, corrupting total list count for screen readers: Use aria-setsize="5000" (total dataset size) and aria-posinset="142" (current item position) on rendered list items so screen readers announce.
Automated vs. Manual Accessibility Auditing Limitations.
Automated Tools (Lighthouse, axe-core) catch only 30% to 40% of accessibility barriers • They can check if an alt attribute exists, but cannot judge whether the text makes sense! • They cannot test if keyboard tab order is logical or if a focus trap works.
Preventing Keyboard Traps in Complex Embeds.
A Keyboard Trap occurs when focus enters a sub-element (like an embedded video player or third-party ad) and pressing Tab or Esc cannot navigate focus back out.: Violates WCAG Success Criterion 2.1.2 • Always provide standard escape instructions ("Press Esc to return to document").
VPAT (Voluntary Product Accessibility Template) Certification.
In B2B enterprise and government sales: Enterprise procurement teams require a VPAT (Section 508 / WCAG conformance report) audited by third-party accessibility specialists before • Non-compliance blocks multi-million dollar enterprise contracts.
The 10 Principles of Inclusive Frontend Architecture.
Semantic HTML first, ARIA only when necessary • Every mouse action must have an equivalent keyboard interaction • Visible focus indicators must never be suppressed • Color alone must never convey information.
WCAG 2.2 New Success Criteria: Focus Appearance, Target Size, and Redundant Entry.
WCAG 2.2 introduced critical criteria to support users with motor, cognitive, and vision disabilities: Target Size (Minimum) (2.5.8 - Level AA): Interactive targets must have an area of at least 24 \times 24\text{ CSS pixels} (or sufficient.
Focus Traps and the Native `inert` Attribute.
When a modal opens, keyboard focus must stay trapped inside the modal so pressing Tab doesn't cycle through invisible background links.: The Modern Native Solution: Add the HTML boolean attribute inert to background containers (``).
Accessible Form Design: Error Association and Validation.
To make form validation accessible to assistive technologies: Explicitly associate inputs with labels using matching • Link error messages using aria-describedby="email-error" • Set aria-invalid="true" dynamically when validation fails so screen readers announce "Invalid data" on focus.
ARIA Live Regions: `aria-live="polite"` vs `aria-live="assertive"`.
Live regions inform screen readers when content dynamically updates without a page reload (e.g. cart badge count, toast notifications, search result count): aria-live="polite": Waits until the screen reader finishes speaking its current sentence before announcing the update (ideal for search.
Landmark Roles and Navigational Bypass.
Landmarks allow screen reader users to jump directly between major sections of a page using shortcut keys (D in NVDA/JAWS): Standard landmarks: (banner), (navigation), (main), (complementary), (contentinfo).
Color Contrast Ratios: WCAG AA vs AAA Standards.
Contrast measures the luminance difference between text and its background: WCAG AA (Standard Compliance) • Normal text (< 18.5\text{px} bold or < 24\text{px}): \ge 4.5:1 • Large text (\ge 18.5\text{px} bold or \ge 24\text{px}): \ge 3:1 • UI components and graphical objects (buttons, input borders): \ge 3:1.
Keyboard Navigation: `tabindex` Rules and Skip Links.
tabindex="0": Inserts a naturally non-interactive element into normal keyboard tab order • tabindex="-1": Removes an element from tab order, but allows programmatic focus via JavaScript (element.focus()) • tabindex > 0 (Anti-pattern): Never use positive tabindex values!
Accessible Data Tables: Structure and Headers Association.
Screen readers cannot convey tabular data without proper markup: Use ` to describe the table's purpose • Use with scope="col" for column headers and scope="row"` for row headers • For complex multi-tier tables, link cells to headers explicitly using headers="header-id".
WAI-ARIA Combobox Pattern for Accessible Auto-complete.
An accessible search auto-complete combobox requires: Dropdown container: ` • Options: ` • Up/Down arrow keys move active selection, updating aria-activedescendant="opt-1" on the input so screen readers announce the selected option.
Accessible Carousels: Autoplay Governance and Controls.
Carousels frequently fail accessibility tests unless adhering to 4 strict rules: Pause / Play Button: Users must be able to pause automatic rotation at any time • Hover / Focus Pause: Autoplay must automatically pause when a mouse hovers or keyboard focus enters the carousel.
Media Accessibility: Captions, Transcripts, and Audio Descriptions.
Captions (Closed Captions - CC): Synchronized text of spoken dialogue + relevant sound effects ([Thunder rumbling], [Upbeat jazz music]) for • Transcripts: Full text version of audio/video content provided directly on the page, accessible to search engines and braille readers.
Motion Sensitivity: `@media (prefers-reduced-motion)`.
Aggressive animations, parallaxes, and smooth scrolling can trigger motion sickness, dizziness, or seizures in users with vestibular disorders.: Query @media (prefers-reduced-motion: reduce) in CSS and disable or minimize non-essential animations.
Accessible SVG Icons: Decorative vs Informative.
Decorative SVGs (Adjacent to text): Always add aria-hidden="true" and focusable="false" so screen readers ignore them and do not announce • Informative / Standalone Button SVGs (Icon-only buttons): Provide an accessible name either using aria-label="Search" on the button, or.
Automated vs Manual Accessibility Auditing: The 30/70 Rule.
Automated tools (Lighthouse, Axe-Core, Pa11y) only detect approximately 30-40% of all accessibility violations (color contrast, missing alt attributes, duplicate IDs). The remaining 60-70% require manual testing: Keyboard navigation (can every task be completed using only Tab, Enter, Space, Escape, and arrow keys?).
The Business and Legal Imperative of Digital Accessibility.
Web accessibility is not an optional polish item: Global Legal Compliance: Mandated by the European Accessibility Act (EAA 2025), Americans with Disabilities Act (ADA Title III), and Section 508.