> cs·fundamentals
interview 0% 26m read
8.8 ★ core [B][J] 1 interview Q's

Accessibility & inclusive basics

Accessible UI is just well-built UI — semantic HTML, keyboard reach, contrast, touch targets. It's also where AI is laziest. Learn the non-negotiables.

Accessible UI is mostly just well-built UI — real buttons, labelled inputs, enough contrast, things you can reach with a keyboard. It’s also the area an AI is laziest about, because the happy-path demo looks fine without it. The non-negotiables here aren’t a separate “accessibility pass”; they’re the baseline you ask for up front, and most of them also make the UI better for everyone.

Semantic HTML does the work for you

The foundation of accessibility is using the right element. A real <button> is focusable, clickable by keyboard (Enter/Space), and announced as a button to screen readers — all for free. A <div> dressed up to look like a button is none of those things until you reimplement them by hand, badly. Same for <nav>, <header>, <label>, <table>. “Div soup” — everything built from generic divs — is the root cause of most accessibility failures and a classic sign of AI-generated markup. Asking for “semantic HTML” up front prevents a whole category of problems.

Keyboard, labels, and contrast

Three checks catch most of the rest. Keyboard: every actionable thing must be reachable by Tab, in a logical order, with a visible focus ring; overlays trap focus and close on Esc. Labels: every input needs a real, visible label (a placeholder doesn’t count), and an icon-only button needs an accessible name. Contrast: body text must hit WCAG AA — 4.5:1 against its background — and you must never use colour alone to convey meaning (pair the red with an icon or text), since not everyone perceives it.

Two swatches: high-contrast text marked AA pass, and low-contrast faint text marked fail.Readable body text✓ 4.5:1 — passes AA“Subtle” grey text✗ ~2.5:1 — fails AA
FIG 1 · contrast: AA pass vs fail The same accent on the same background. The left clears WCAG AA (4.5:1); the “subtle” grey on the right fails — and is exactly what AI reaches for.

Reaching everything by keyboard

A surprising amount of “it’s broken” turns out to be “it’s mouse-only.” Tab through any screen: can you reach every button, field, and link? Is the focus ring visible at each stop? In a modal, does focus stay trapped inside and return sensibly when it closes? This 30-second test catches the failures AI most often ships — icon buttons with no accessible name, custom dropdowns you can’t open with the keyboard, and the removed focus ring.

A form with two fields and two buttons, numbered 1 through 4 to show keyboard tab order, with a focus ring on the first field.Name1Email2Cancel3Save4
FIG 2 · a sensible focus order Tab should move through a form in reading order, with a visible ring at each stop and Esc to close any overlay.
Image is…alt strategyWhy
Informative (a chart, a product photo)meaningful alt describing itthe content is lost otherwise
Decorative (a background flourish)empty alt=""screen readers skip it — no noise
A functional icon (an icon-only button)an accessible name on the button“button, settings” not “button, unlabelled”
Alt text isn't “describe every pixel” — it's “convey the purpose, skip the decoration.”

01 Learning objectives

0 / 6 done

02 Curated reading

03 Knowledge check

knowledge check3 questions · pass ≥ 70%
  1. 01easy

    Conveying status with colour alone (e.g. a red dot) is sufficient for accessibility.

  2. 02medium

    WCAG AA requires body text to have a contrast ratio of at least…

  3. 03medium

    What's wrong with a clickable <div> styled to look like a button?

04 Interview questions

browse all ↗

What gets asked on this topic — tap a card for how to approach it, the follow-ups, and the trap. Company tags are best-effort & sourced.

  • ★ must-know Commonly asked mid concept common What are the most common accessibility mistakes, and how do you catch them?

    The frequent offenders: div-soup (clickable <div>s instead of real <button>/<a>, so there's no keyboard or screen-reader support), placeholder-as-label (an unlabelled field), low-contrast text that fails WCAG AA, missing or removed focus rings, and icon-only buttons with no accessible name. You catch most of them in two minutes: Tab through the screen (can you reach and see focus on everything?), check contrast against AA (4.5:1 body), and confirm every input has a real label.

    What a strong answer covers
    • Div-soup → use semantic <button>/<a>/<nav> for free keyboard + meaning.

    • Placeholder-as-label and icon buttons with no name → add real labels/names.

    • Low contrast / removed focus ring → meet AA, keep the focus ring.

    • Catch it: Tab through it, check contrast, check labels.

    Quick self-check

    An icon-only 'delete' button (just a trash icon) is announced by a screen reader as 'button, unlabelled'. The fix?

    Red flag Treating accessibility as a separate 'pass' at the end — it's a baseline you ask for up front, and most of it is just using the right element.

    source: W3C WAI — Accessibility Principles ↗