Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

CSS Module 23

Debugging, performance, accessibility, tooling and print interview questions

Interview questions on debugging, performance, accessibility, tooling and print: warm-ups, then what each harder question tests and how a good answer starts.

9 questions: 3 warm-ups and 6 with model answers · Levels: Fresher to senior

Warm-up questions

Short questions with short answers, each answered in full.

  1. Fresher

    Why do people debug layouts with outline instead of border?

    Answered in the lesson Debugging CSS systematically

  2. Fresher

    What does the visually hidden pattern do, and why not use display: none or opacity: 0 instead?

    Answered in the lesson Accessible CSS: focus, motion, contrast and reflow

  3. Fresher

    What does a print stylesheet usually change, and how can you check it without printing?

    Answered in the lesson Print stylesheets and paged media

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Fresher to mid

    Users report that a product page scrolls sideways on phones, but nothing on the screen looks wider than the page. Walk through how you find the cause and fix it without hiding any content.

    What it tests
    A repeatable method for horizontal overflow, which boxes can and cannot widen a page, overflowing text, and fixing causes instead of clipping symptoms.
    First step
    Reproduce it at 360 px in device mode and measure it: the root element's scrollWidth is larger than its clientWidth. Then list everything that ends past the right edge, leaving out boxes inside a box that scrolls or clips sideways, and fixed boxes. Check text too: a long code can spill out of a paragraph whose box still fits.
    Follow-ups

    From the lesson Debugging CSS systematically

    Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.

    Opening the model answers with your pass…

    Model answers open with any MySmartCoPilot pass.

    • Pro pass · 1 week₹79$2.99
    • 30 days₹179$5.99
    • 1 year₹1,699$45

    One payment; nothing renews unless you choose to. The price shown is the total you pay: no fees or charges are added at checkout.

    It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  2. Mid to senior

    After a release of 50 commits that changed CSS in 40 files, the checkout's two-column layout collapses into one column, but only on screens between 900 and 1,100 px wide. Nobody knows which change did it. How do you find the cause quickly and prove the fix?

    What it tests
    Reproducing a width-dependent bug, reading the width range as a clue, bisecting commits and then rules, bugs that need two changes, and verifying a fix.
    First step
    Pin the width first: reproduce at 1,000 px and find, in 10 px steps, where the layout breaks and recovers. Round numbers point to a media or container query. Without a lead, run git bisect between the previous release and this one: about 6 checks for 50 commits.
    Follow-ups

    From the lesson Debugging CSS systematically

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  3. Mid to senior

    Your checkout passes an automated accessibility audit with no violations, yet a keyboard user at 125 % zoom reports that they cannot finish an order. What do you test by hand, and which CSS causes do you expect to find?

    What it tests
    What automated rules cannot see, a manual plan for keyboard, zoom, reflow and forced colours, and tracing each failure back to its CSS.
    First step
    Reproduce it at the same zoom with the keyboard only, from the first field to the confirmation. At every Tab, check that you can see the focus, that the focused field is not under a sticky header or banner, and that nothing needs sideways scrolling or is cut off.
    Follow-ups

    From the lesson Accessible CSS: focus, motion, contrast and reflow

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  4. Fresher to mid

    A landing page has an auto-playing carousel of customer quotes, parallax backgrounds and tooltips that appear on hover. Which WCAG 2.2 success criteria are at risk, and how do you fix each with CSS and as little script as possible?

    What it tests
    The motion criteria 2.2.2 and 2.3.3, the reduced-motion preference as a default, and the three conditions of content on hover or focus (1.4.13).
    First step
    Sort them by criterion. The carousel moves by itself for more than five seconds, so 2.2.2 needs a way to pause it. Parallax is motion the reader did not ask for: write it inside prefers-reduced-motion: no-preference. The tooltips must also open on focus and stay while the pointer moves onto them.
    Follow-ups

    From the lesson Accessible CSS: focus, motion, contrast and reflow

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  5. Fresher to mid

    Customers say an invoice that fits on one screen prints on two pages, the second holding only a line of the app's footer, and that the green "Paid" badge is missing on paper. Diagnose both problems and fix them with CSS.

    What it tests
    Page chrome in print, how backgrounds and text colours are adjusted when printing, print-color-adjust, @page, and checking the result as a PDF.
    First step
    Print to PDF and look at each page. The app's toolbar, navigation and footer are printing, and the footer line spills onto a page of its own. The badge is a background colour, which browsers leave out by default when printing, so its white text is lost too.
    Follow-ups

    From the lesson Print stylesheets and paged media

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  6. Mid to senior

    A 30-page report printed from the browser has table rows cut in half, headings stranded at the foot of pages and a wide chart squeezed onto a portrait page. How do you fix each with CSS, and which fixes can you rely on in every browser?

    What it tests
    The break properties and their support, repeated table headers, keeping headings with text, named landscape pages, and testing page breaks.
    First step
    Sort them by property. Rows: break-inside: avoid on tr, widely available, with the headings in a thead so they repeat. Headings: break-after: avoid works only in Chromium, so keep each heading and its first paragraph in one box with break-inside: avoid. The chart: a named landscape page.
    Follow-ups

    From the lesson Print stylesheets and paged media

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes

All CSS interview questions · The CSS track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.