Frontend X-Ray

Debug Challenges

Find the bug, fix it, learn why it happened. 54 challenges across 4 categories.

CSSeasy

Flex centering gone wrong

The card should be perfectly centered both vertically and horizontally inside the container, but it sticks to the top-left corner.

15 XP
CSSeasy

Z-index doesn't work

The modal overlay should appear above everything, but it's hidden behind the header despite having z-index: 9999.

15 XP
CSSeasy

Overflowing text breaks layout

Long user names overflow the card width instead of being truncated with an ellipsis.

15 XP
CSSeasy

Grid columns collapse on mobile

The product grid should adapt from 3 columns on desktop to 1 column on mobile, but all items stack with zero width.

15 XP
CSSmedium

Sticky header scrolls away

The header should stick to the top when scrolling, but it scrolls away with the page content.

25 XP
CSSmedium

Margin collapse surprise

Two stacked sections should have 60px total spacing between them (30px bottom + 30px top), but they only have 30px.

25 XP
CSSmedium

Flex item won't shrink

The sidebar text content overflows its flex container instead of wrapping or shrinking.

25 XP
CSShard

Transform breaks position: fixed

A tooltip with position: fixed inside a transformed container positions relative to the container instead of the viewport.

40 XP
CSSeasy

Image aspect ratio breaks

Product images appear stretched and distorted inside their fixed-size containers.

15 XP
CSSeasy

Button text isn't vertically centered

The button text appears shifted up despite using padding for height.

15 XP
CSSmedium

Hover effect on touch devices

Dropdown menus rely on :hover, but on mobile they require a tap and then stay open. Use a media query to only apply hover effects on devices that support it.

25 XP
CSSmedium

100vh too tall on mobile

The hero section uses height: 100vh but on mobile browsers the content is hidden behind the URL bar.

25 XP
CSSmedium

Transition on display: none

A panel should fade in smoothly, but it just appears instantly despite having a transition.

25 XP
CSSeasy

Gap doesn't work in older Safari

Flex gap doesn't render in Safari 13. Provide a fallback that achieves the same spacing.

15 XP
CSSeasy

Absolute child escapes relative parent

A badge should sit at the top-right corner of its parent card, but it positions relative to the viewport.

15 XP
CSShard

Scrollbar gutter layout shift

Content shifts horizontally when a scrollbar appears (e.g., navigating to a longer page). Prevent this layout shift.

40 XP
CSSeasy

Focus outline removed without replacement

The developer removed the focus outline for aesthetics but now keyboard users can't see what's focused. Fix accessibility while keeping it visually clean.

15 XP
CSShard

Container query not working

A component should change layout based on its container's width, but the container query has no effect.

40 XP
CSShard

Subgrid alignment broken

Card headers and footers in a grid don't align across columns. Use subgrid to fix cross-card alignment.

40 XP
CSSmedium

Clipped shadows on overflow hidden

Box shadows on child elements are being clipped by the parent's overflow: hidden.

25 XP
JavaScripteasy

Closure trap in a loop

This code should log 0, 1, 2, 3, 4 after 1 second each, but it logs 5 five times instead.

15 XP
JavaScripteasy

Equality gotcha

This validation should reject empty strings, but '' == false evaluates to true, letting empty inputs through.

15 XP
JavaScripteasy

Array.sort() surprise

Sorting numbers produces [1, 10, 2, 20, 3] instead of [1, 2, 3, 10, 20].

15 XP
JavaScriptmedium

this context lost in callback

The event handler loses `this` context when passed as a callback, throwing 'Cannot read property of undefined'.

25 XP
JavaScriptmedium

Async/await error swallowed

API errors are silently swallowed — the user sees no error message and the app appears to hang.

25 XP
JavaScripthard

Race condition in state update

Rapid clicks on a 'like' button send multiple API calls and the count goes out of sync.

40 XP
JavaScripteasy

Shallow copy mutation

Modifying a copied object also modifies the original because the copy is shallow.

15 XP
JavaScriptmedium

Memory leak from event listeners

This component adds scroll listeners each time it mounts but never removes them, causing memory leaks and performance degradation.

25 XP
JavaScripteasy

parseInt radix trap

parseInt('08') returns 0 in older environments because it interprets the string as octal.

15 XP
JavaScriptmedium

Promise.all fails everything

Loading a dashboard with multiple API calls — one failing endpoint causes ALL data to be lost.

25 XP
JavaScripteasy

Floating point arithmetic

0.1 + 0.2 !== 0.3 in JavaScript, breaking price calculations.

15 XP
JavaScriptmedium

forEach can't be awaited

Processing items sequentially with async/await inside forEach — but all requests fire at once.

25 XP
JavaScripteasy

typeof null is 'object'

A type check treats null as a valid object, causing property access crashes.

15 XP
JavaScriptmedium

Event delegation missing

Dynamically added list items don't respond to click events because listeners were attached to elements that didn't exist yet.

25 XP
JavaScriptmedium

Debounce implementation broken

This debounce function fires on every keystroke instead of waiting for the user to stop typing.

25 XP
JavaScripteasy

JSON.parse crashes the app

Reading from localStorage with JSON.parse crashes when the stored value is corrupted or undefined.

15 XP
JavaScriptmedium

Map vs Object confusion

Using an object as a dictionary with user-provided keys causes prototype pollution — keys like '__proto__' or 'constructor' break the app.

25 XP
JavaScripteasy

Optional chaining pitfall

Optional chaining returns undefined silently, masking the real bug — the data structure changed but the code wasn't updated.

15 XP
JavaScripthard

Infinite re-render loop

A React component causes an infinite loop because useEffect creates a new object on every render, triggering itself.

40 XP
JavaScriptmedium

Date timezone confusion

new Date('2024-01-15') creates a date at midnight UTC, but displaying it in US timezones shows January 14 instead of 15.

25 XP
A11yeasy

Missing alt text on images

Product images have no alt text, making them invisible to screen reader users.

15 XP
A11yeasy

Click handler on a div

This clickable card uses a <div> with an onclick handler. Keyboard users can't activate it.

15 XP
A11yeasy

Missing form labels

Form inputs use placeholder text instead of labels. Screen readers don't announce what each field is for.

15 XP
A11ymedium

Color-only error indication

Form validation errors are shown only by turning the input border red. Color-blind users can't distinguish valid from invalid fields.

25 XP
A11ymedium

Modal trap — no focus management

Opening a modal doesn't move focus to it. Keyboard users can tab to elements behind the overlay.

25 XP
A11yeasy

Heading hierarchy skipped

The page jumps from <h1> to <h4>, breaking the document outline for screen reader navigation.

15 XP
A11ymedium

Auto-playing video with no controls

A hero video autoplays with sound on page load. Users can't pause it and screen reader users don't know it exists.

25 XP
A11yeasy

Link text says 'click here'

Screen readers list all links on a page. Multiple 'click here' links are meaningless out of context.

15 XP
Perfmedium

Layout thrashing in a loop

Reading and writing DOM properties in a loop forces the browser to recalculate layout on every iteration.

25 XP
Perfmedium

Unoptimized scroll handler

A scroll handler does expensive work on every frame, causing visible jank at 60fps.

25 XP
Perfeasy

Render-blocking CSS and JS

The page takes 5 seconds to show any content because all CSS and JS files block rendering.

15 XP
Perfeasy

Images loaded all at once

A page with 50 product images loads all of them on page load, even those far below the fold.

15 XP
Perfhard

Massive bundle — no code splitting

The entire app (including admin panel, charts library, and PDF generator) is in one 2MB bundle loaded on every page.

40 XP
Perfmedium

Re-rendering entire list

A list of 1000 items re-renders completely when a single item's checkbox is toggled.

25 XP