Frontend Interview

Frontend Interview

Tags
Software Development
Published
February 1, 2023
Author

Things I typically like to ask during a frontend dev interview

 
  1. CSS (see below)
  1. React pair coding (https://codesandbox.io/s/coding-challenge-template-7gkem1)
 

Can you explain CSS Specificity?

 

Which measures do you know? When would you use which one?

  • %:
  • px:
  • em:
  • rem:
  • vh:
 

Let’s talk about height - style a div so that it’s the full page height:

 
 

Talk about internationalisation - LTR - style a paragraph with a 1em margin at the “end” of the text?

Talk about margins - style a footer

 

Can you name different positioning “algorithms”? How do they “work”?

  • default: static
  • initial
  • absolute
  • fixed
  • relative
  • sticky
 

Explain the logic of an absolute element? How will it be positioned (imagine inset: 10px)?

 

What is a stacking context? What are different ways to create a stacking context?

  • Setting opacity to a value less than 1
  • Setting position to fixed or sticky (No z-index needed for these values!)
  • Applying a mix-blend-mode other than normal
  • Adding a z-index to a child inside a display: flex or display: grid container
  • Using transformfilterclip-path, or perspective
  • 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?

 
unfortunately not widely supported yet + border-radius will clip y-axis as well in certain browsers (e.g. chrome, not firefox)
 
or make a wrapper “outside”