Integer to Roman: The Greedy Mapping That Always Shows Up in Interviews

Most developers think accessibility is 'not urgent' until they get sued. Learn WCAG 2.2, POUR principles, and implementation techniques you can apply immediately before your digital presence becomes a legal nightmare — and more importantly — a human failure.
"The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect." — Tim Berners-Lee, W3C Director

1. Legal risk — 4,000+ accessibility lawsuits in the US in 2024 2. 15% of population — has limitations, and most developers skip this 3. SEO benefit — accessibility = better HTML structure
1.3 billion people with disabilities globally. 97% of homepages don't meet basic standards. Assistive technology market: $30 billion+.
Accessibility (A11y) = the practice of making digital products usable by everyone, including people with disabilities.
| Property | Type | Description |
|---|---|---|
| ADA — Americans with Disabilities Act | Law | Legal compliance in the US. Websites can be sued if not accessible. |
| WCAG — Web Content Accessibility Guidelines | Technical | Global standard from W3C. Used as implementation reference. |
graph TD
A[WCAG POUR] --> B[Perceivable]
A --> C[Operable]
A --> D[Understandable]
A --> E[Robust]
B --> B1[Alt text]
B --> B2[Captions/Transcripts]
B --> B3[Color contrast 4.5:1]
C --> C1[Keyboard navigation]
C --> C2[Skip links]
C --> C3[No keyboard trap]
D --> D1[Clear language]
D --> D2[Consistent navigation]
D --> D3[Error suggestions]
E --> E1[Valid HTML]
E --> E2[Proper ARIA]
E --> E3[Screen reader compatible]
| Property | Type | Description |
|---|---|---|
| Visual | Screen readers (JAWS, NVDA, VoiceOver) | Alt text, high contrast, keyboard nav |
| Motor | Switch access, voice control | Large targets, keyboard nav, extended time |
| Hearing | Hearing aids, captioning | Transcripts, captions, visual alerts |
| Cognitive | Screen magnifiers, reading assistants | Simple content, consistent nav |
Basic requirements. If you miss these, your website will fail accessibility tests.
Target for most regulations. Reasonable compliance for most organizations.
Full compliance rarely required. Strictest requirements.
Target WCAG AA as your baseline compliance. This is what most international regulations use.
4 Main Risks:
| Risk | Impact |
|---|---|
| Legal | Lawsuits in US/EU markets — can be very expensive |
| Users | 15-20% of population with limitations can't use your product |
| SEO | Poor HTML structure = SEO suffers |
| Brand | Non-inclusive = damaged brand image |
The latest version (October 2023) added 9 new Success Criteria:
Elements with focus must not be hidden by sticky headers.
Focus indicator must have 3:1+ contrast and sufficient area.
All drag-and-drop must have single-pointer alternatives (up/down buttons).
Interactive targets minimum 24x24 CSS pixels.
Adequate clearance for smaller targets.
Help mechanism on one page = help on all pages with consistent position.
Don't request information already input previously.
Cognitive puzzle CAPTCHAs not allowed — provide alternatives.
No part of focused element may be hidden.
| Property | Type | Description |
|---|---|---|
| Title I | Employment | Employees with disabilities must receive reasonable accommodations |
| Title III | Public Access | Public accommodations — including websites — must not discriminate |
Since Facebook v. Nizzud (2019) and Domino's Pizza v. Laredo (2019), courts have consistently ruled that ADA applies to websites.
For US federal entities, all EICT must meet Access Board standards.
Use HTML elements according to their function:
<!-- ❌ Bad: Not semantic -->
<div class="header">
<div class="nav">
<div class="logo">Brand</div>
</div>
</div>
<!-- ✅ Good: Semantic with landmarks -->
<header>
<nav aria-label="Main navigation">
<a href="/" aria-label="Home">Brand</a>
</nav>
</header>
<main id="main-content">
<article>...</article>
</main>
<footer>...</footer>Use <button> instead of <div> for interactive elements. Screen readers need to know this is a button.
| Property | Type | Description |
|---|---|---|
| Decorative | <img src="divider.svg" alt=""> | Empty (alt="") |
| Informative | <img src="dashboard.png" alt="Dashboard with 3 alerts"> | Brief description |
| Complex | alt="Chart..." + link | Detailed description + link to full description |
Ensure tab order follows visual reading order. Avoid positive tabindex.
Never remove outline without a clear alternative.
Ensure no element traps keyboard users.
Provide mechanism to disable/remap single-key shortcuts.
/* ✅ Good: Clear focus indicator */
:focus-visible {
outline: 3px solid #005fcc;
outline-offset: 2px;
}
/* ❌ Bad: outline: none without alternative */
button:focus {
outline: none;
}
<!-- Place as first element in body -->
<a href="#main-content" class="skip-link">
Skip to main content
</a>.skip-link {
position: absolute;
top: -40px;
left: 0;
background: #005fcc;
color: white;
padding: 8px 16px;
z-index: 100;
}
.skip-link:focus {
top: 0;
}:root {
/* ✅ Good: Sufficient contrast */
--text-primary: #1a1a2e; /* 15.5:1 against white */
--text-secondary: #4a4a68; /* 7.2:1 against white */
/* ❌ Bad: Insufficient contrast */
--text-muted: #888888; /* 2.8:1 against white */
}If native HTML is sufficient, use HTML. ARIA doesn't make elements more accessible — it just adds information for assistive technology.
// ❌ Bad: Unnecessary ARIA
<div role="button" tabindex="0" onClick={handleClick}>
Submit
</div>
// ✅ Good: Native HTML
<button type="submit">Submit</button>
// ❌ Bad: Label not connected
<input type="text" placeholder="Email" />
// ✅ Good: Explicit association
<label htmlFor="email">Email</label>
<input id="email" type="email" /><label htmlFor="password">Password</label>
<input
id="password"
type="password"
aria-describedby="password-requirements password-error"
aria-invalid="true"
/>
<p id="password-requirements">
Minimum 8 characters, 1 uppercase, 1 number
</p>
<p id="password-error" role="alert">
Password must contain at least 8 characters
</p>Google Lighthouse
Built-in Chrome DevTools. Quick audit with score + suggestions.
npx lighthouse https://example.com --only-categories=accessibilityaxe DevTools
More accurate than Lighthouse. Has CI/CD version.
npm install @axe-core/reactPa11y
CLI tool — suitable for pipeline automation.
npx pa11y https://example.comAccessibility Insights
Step-by-step audit + guided fixes from Microsoft.
Opinion: 80% of devs skip screen reader testing. This is the biggest blind spot.
Testing with real assistive technology is the only way to know the actual user experience.
| Property | Type | Description |
|---|---|---|
| NVDA | Windows / Firefox | General Windows accessibility |
| JAWS | Windows / Chrome/Edge | Enterprise environments |
| VoiceOver | macOS/iOS / Safari | Apple ecosystem |
| TalkBack | Android / Chrome | Mobile accessibility |
| Orca | Linux / Firefox | Linux desktop |
| Property | Type | Description |
|---|---|---|
| WebAIM Contrast Checker | Web Tool | Validate color contrast ratio |
| Stark (Figma/Sketch) | Design Plugin | Design-time checking |
prefers-reduced-motion?| Property | Type | Description |
|---|---|---|
| Real-time telehealth captions | Healthcare | Patients may be deaf or hard of hearing |
| Alternative for medical devices | Medical Devices | Data from glucose/BP monitors must be accessible |
| Multi-language support | Localization | Diverse patient populations |
| Cognitive load management | Cognitive Accessibility | Elderly/cognitively impaired frequently use portals |
| Emergency accessibility | Emergency Response | Critical alerts must be accessible in all modes |
In healthcare, compliance isn't just WCAG — must align with HIPAA Privacy Rule. Some accessibility accommodations must consider HIPAA implications.
Treat accessibility like a vulnerability. Broken accessibility = UX vulnerability. Like security, it must be integrated from the start.
If APIs must be predictable for machines, then UI must be predictable for humans with various limitations.
Engineers who understand this typically:
Without these:
With these:

Accessibility is not a feature added at the end — it is a fundamental architecture principle.
Good accessibility = good design. When we build for edge cases, the entire user experience improves.
A truly universal digital product works for everyone, without exception.
| Property | Type | Description |
|---|---|---|
| WCAG 2.2 Quick Reference | w3.org/WAI/WCAG22/quickref | Quick reference guide for WCAG 2.2 |
| WAI ARIA Documentation | w3.org/WAI/ARIA | Official WAI ARIA documentation |
| WebAIM Contrast Checker | webaim.org/resources/contrastchecker | Validate color contrast ratio |
| axe DevTools | deque.com/axe/devtools | Accessibility testing tool by Deque |
| Accessibility Insights | accessibilityinsights.io | Microsoft's accessibility auditing tool |
| Inclusive Components | inclusive-components.design | Pattern library for accessible components |



