ProAdvancedInterview prep

CSS Performance

What actually costs: which property changes trigger layout, which only paint, and which the compositor handles alone. Layout thrash, containment, critical CSS, font loading and the image sizing that causes layout shift.

Questions90
Topics10
Answering time68 minutes
At five a day18 days
LevelAdvanced

Who it is for

Has never measured anything.

For someone confident in the language who wants the traps, the edge cases and the interview questions.

You will get the most out of it if you have written CSS recently enough to read it without effort, and have been surprised by it at least once. If you are picking the language up for the first time, start with CSS Essentials and come back to this one.

It is also built for interview preparation: the questions are the ones that get asked because they separate people who have read the documentation from people who have hit the behaviour in production.

How long it takes

90 graded questions at roughly 45 seconds each is about 68 minutes of answering in total.

At the default five questions a day, and because the session mixes in your other courses, expect around 18 days — call it 3 weeks — to see everything once, plus a few weeks of thinning reviews after that before it is all mastered.

A question is mastered on the third correct answer, once the gap between reviews has grown past a week — so a course cannot be finished in a weekend however long you sit with it.

Question mix

  • 60 multiple choice
  • 10 concept cards
  • 10 predict the output
  • 10 put it in order
  • 10 matching questions

Syllabus

What you will be asked about

  1. 01

    The Rendering Pipeline

    Say which of style, layout, paint and composite a given property change forces.

  2. 02

    Layout Thrash

    Spot a read-after-write that forces synchronous layout, and reorder the code so it does not.

  3. 03

    Compositor-Only Properties

    Explain why transform and opacity animate cheaply, and what promoting a layer actually costs.

  4. 04

    will-change And Its Cost

    Use will-change at the right moment and explain the side effects it brings with it.

  5. 05

    Containment

    Choose the right contain value and say which work the browser is then allowed to skip.

  6. 06

    content-visibility

    Apply content-visibility to long pages and size the placeholders so nothing jumps.

  7. 07

    Selector Cost And Invalidation

    Explain why selector length rarely matters and what does make style recalculation slow.

  8. 08

    Critical CSS And Render Blocking

    Decide what blocks the first paint and what to inline, preload or defer.

  9. 09

    Font Loading, FOIT And FOUT

    Choose a font-display strategy and explain when the font file is actually requested.

  10. 10

    Image Sizing And Layout Shift

    Reserve space for media so nothing moves, and choose sizes that do not waste bytes.

8 more topics, and all 90 questions

CSS Performance is a Pro course. One subscription opens it and every other course in the catalogue, including the ones still being written.

See pricing Find a free course

A question from this course

The Rendering Pipeline

The row is invisible. What has it done to the page's geometry?

<style>
  .row { visibility: hidden; }
</style>
<div class="row">Draft</div>
  • AIt is removed from the box tree, exactly like `display: none`
  • BNothing: it still generates a box and still occupies its space, so hiding it this way moves nothing
  • CIts box collapses to zero height but keeps its width
  • DIt is still painted, only with its pixels at zero alpha
Show the answer

B Nothing: it still generates a box and still occupies its space, so hiding it this way moves nothing

You may have read visibility: hidden as a synonym for display: none because both make the element disappear. It is not: the box is still laid out and still reserves its space, which is why toggling it costs paint but not layout. display: none removes the box and therefore does cost layout both ways.

The rest of the track

CSS at every depth

Start CSS Performance
in tomorrow’s session.

Enrol and this course joins your daily five, mixed in with everything else you are studying — 90 questions spread over about 18 days rather than dropped on you at once.

Browse the catalogue