Skip to main content
All interview theory questions
flexboxeasy

When would you choose Flexbox over CSS Grid?

Answer

Flexbox lays out along one axis and sizes items from their content, so it suits a row of buttons, a nav bar, or anything that should distribute space in a single direction. Grid defines rows and columns up front, so it suits page-level and two-dimensional layouts where things must line up in both directions. They aren't rivals — grid the page, flex the components inside it.

Points an interviewer listens for

  • Flexbox: one axis, content-driven
  • Grid: two axes, layout defined up front
  • Grid for page structure, flex for components
  • They nest together routinely

Reported at

Similar questions have been reported by candidates at Appscrip, Autovyn Consultancy, Codeflies Technologies Pvt. Ltd, GrapplTech, Hexon Global, La Net Team Software Solutions.

Now try answering it out loud

Interview practice mode times your spoken answer and checks it against the points above.

Practise this question