← The archive Dispatch

Article · Field notes

Frontend Interview

01 Feb 2023 2 min read

Frontend Interview

I keep coming back to the same two things in frontend interviews:

Not because I want trivia answers. I want to see how people think out loud and debug in real time.

CSS and layout questions

How do you explain CSS specificity to a teammate who is stuck?

Which units do you actually use in production, and why?

  • %
  • px
  • em
  • rem
  • vh

Height question: how would you make a div truly full-page height?

Internationalization question: in LTR/RTL layouts, how would you set a 1em margin at the end of text correctly?

Spacing question: how would you build a footer with predictable margins across breakpoints?

Which positioning modes do you trust, and when?

  • static (default)
  • initial
  • absolute
  • fixed
  • relative
  • sticky

Explain absolute positioning in plain language. What happens with inset: 10px?

Stacking context

What is a stacking context, and what bugs have you seen because of it?

  • Setting opacity to a value less than 1
  • Setting position to fixed or sticky
  • Applying a mix-blend-mode other than normal
  • Adding a z-index to a child inside a display: flex or display: grid container
  • Using transform, filter, clip-path, or perspective
  • Explicitly creating a context with isolation: isolate

How would you make a container scroll on y but not x?

The practical pattern I like: outer wrapper handles clipping/border radius, inner wrapper handles scrolling.

Copyright 2022 Andras Hejj