Skip to content
RED SAGSkills
easyFrontend Developer interview question

How do you make a web page responsive for mobile, tablet and desktop?

What the interviewer wants to hear

  • Viewport meta tag
  • Mobile-first CSS with media queries
  • Flexible layouts with Flexbox and Grid, relative units
  • Responsive images with srcset and sizes
  • Test on real devices and DevTools device mode

Model answer

First I make sure the page has the viewport meta tag so mobile browsers do not zoom out. I write CSS mobile-first: base styles for small screens, then min-width media queries to add layout for larger screens. For layout I use Flexbox and Grid with flexible units like percentages, fr, rem and clamp for font sizes, instead of fixed pixel widths. Container queries help when a component must adapt to its own space rather than the whole screen. For images I use srcset and sizes so phones download smaller files, and I make sure tap targets are large enough. Finally I test in DevTools device mode and on at least one real Android phone and iPhone.

Can you answer it under time pressure?

Take a timed easy round and get scored on every answer.

Start mock interview

More easy Frontend Developer questions