Article
Frontend Interview
Things I typically like to ask during a frontend dev interview:
- CSS fundamentals
- React pair coding (challenge template)
CSS and layout questions
Can you explain CSS specificity?
Which units do you know, and when would you use each one?
%pxemremvh
Let's talk about height. How would you style a div so it is full-page height?
Talk about internationalization and LTR/RTL. How would you style a paragraph with a 1em margin at the end of text?
Talk about margins. How would you style a footer with predictable spacing?
Can you name different positioning algorithms and how they work?
static(default)initialabsolutefixedrelativesticky
Explain the logic of an absolutely positioned element. How will it be positioned with inset: 10px?
Stacking context
What is a stacking context? What are different ways to create one?
- Setting
opacityto a value less than1 - Setting
positiontofixedorsticky - Applying a
mix-blend-modeother thannormal - Adding a
z-indexto a child inside adisplay: flexordisplay: gridcontainer - Using
transform,filter,clip-path, orperspective - Explicitly creating a context with
isolation: isolate
How do you achieve a container that can overflow on the y-axis but not on x-axis?
One practical pattern is to use an outer wrapper to control clipping/rounding and an inner scroller to control the overflow behavior.
Copyright 2022 Andras Hejj