Front-end developer interview questions for freshers
Entry-level front-end interviews focus on HTML, CSS and JavaScript fundamentals, building something small in front of the interviewer, and the projects in your portfolio.
Below are commonly asked questions for freshers, with what a good answer includes.
What interviewers assess
- HTML and CSS: structure, layout and responsive design
- JavaScript basics: variables, functions, arrays, the DOM and events
- Building a small feature and explaining your choices
- Your portfolio projects and what you personally built
HTML and CSS questions
What is the difference between block and inline elements?
What a good answer covers: Block elements take the full width and start on a new line (div, p); inline elements flow within text (span, a). Mention inline-block.
How do you make a page responsive?
What a good answer covers: A viewport meta tag, flexible layouts with flexbox or grid, relative units and media queries. Mention designing mobile-first.
How do you centre a div horizontally and vertically?
What a good answer covers: Flexbox with justify-content and align-items set to center, or grid with place-items: center. Interviewers like seeing that you know the modern way.
What is CSS specificity?
What a good answer covers: How the browser chooses between conflicting rules: inline styles, IDs, classes, then elements. Explain why heavy use of !important causes problems.
JavaScript basics questions
What is the difference between == and ===?
What a good answer covers: == converts types before comparing; === compares value and type. Use === by default.
Explain map, filter and reduce with examples.
What a good answer covers: map transforms each item, filter keeps the items that pass a test, reduce combines items into one value. Show a short example of each.
How do you handle a button click and change text on the page?
What a good answer covers: Select the element, add an event listener, update textContent. Mention why textContent is safer than innerHTML for user input.
What is a promise, and how do async and await work?
What a good answer covers: A promise represents a future result; async/await lets you write it like synchronous code. Show fetch with try/catch.
About your projects questions
Walk me through a project in your portfolio.
What a good answer covers: What it does, the stack, the part you are proudest of, one problem you solved and what you would improve. Have the live link ready.
Why did you use React (or plain JavaScript) for this project?
What a good answer covers: A sensible reason related to the project's needs. It's fine to say you chose it in order to learn it.
How did you make your project work on mobile?
What a good answer covers: What you tested, the layout changes you made and any issues you found on small screens.
HR and motivation questions
Tell me about yourself.
What a good answer covers: Degree, how you got into web development, your best project and why this company.
How do you keep learning new front-end skills?
What a good answer covers: Concrete habits: building small projects, reading documentation, following a course, contributing to open source.
How do you respond to feedback on your code?
What a good answer covers: Welcome it, ask questions to understand it, apply it, and give an example from a project or internship.
Common mistakes
- A portfolio of tutorial clones with nothing you designed yourself.
- Not being able to explain CSS you copied from somewhere.
- Skipping JavaScript fundamentals and going straight to a framework.
- Sending a portfolio link that is broken or doesn't work on mobile.
How to prepare
- Build two or three small projects of your own and deploy them so they're easy to show.
- Practise building a to-do list or search filter from scratch without a tutorial.
- Revise flexbox, grid, media queries and the basic DOM methods.
- Prepare a two-minute walkthrough of your best project.
Reading questions only goes so far: the real test is answering them aloud, under follow-up questions. Career Scan builds a mock interview from your own resume and the job, then shows exactly which answers need work.
Frequently asked questions
Do I need to know React for a fresher front-end role?
Many job posts ask for it, but strong HTML, CSS and JavaScript come first. Learn React once the basics are solid.
Is a portfolio required?
It isn't always required, but it helps a lot. A few working projects you can explain are worth more than a long list of skills.
Will there be a live coding task?
Often. You may be asked to build a small component or fix a layout. Talk through what you're doing as you go.