In this article · 7 sections
Interviews for junior and mid-level roles in India usually mix basic theory, a few practical questions and often a small coding task. These web developer interview questions cover what's asked most, with short answers to revise from.
HTML and CSS
- What is semantic HTML? Tags that describe meaning (
header,nav,main,article) for SEO and accessibility. See semantic HTML - Difference between
idandclass? An id is unique on a page; classes are reusable - What is the box model? Content + padding + border + margin;
box-sizing: border-boxincludes padding and border in the width - Flexbox vs Grid? Flexbox for one-dimensional layouts, Grid for two-dimensional. See Flexbox vs Grid
- How do you make a site responsive? Fluid layouts, media queries, flexible images, mobile-first CSS
- What is specificity? Rules deciding which CSS wins: inline > id > class > element
JavaScript
letvsconstvsvar?let/constare block-scoped;constcan't be reassigned;varis function-scoped and older==vs===?===compares value and type; prefer it- What is a closure? A function that remembers variables from its outer scope
- What is event delegation? One listener on a parent handles events from children using
event.target - What are promises and async/await? Ways to handle asynchronous work like fetch requests. See fetch tutorial
- What is debouncing? Delaying a function until input pauses, used for live search
- How do you avoid XSS when inserting text? Use
textContent, escape output, and validate on the server
PHP and MySQL
- GET vs POST? GET sends data in the URL (for reading); POST sends it in the body (for submitting)
- Sessions vs cookies? Sessions store data on the server with an ID cookie; cookies store data in the browser
- How do you prevent SQL injection? Prepared statements with bound parameters. See PHP security
- How should passwords be stored?
password_hash()andpassword_verify(). See secure login tutorial includevsrequire?requirestops with a fatal error if the file is missing;includegives a warning- What is a JOIN? Combines rows from related tables. See SQL joins
- What is an index? A structure that speeds up searches on columns, at some cost to writes
- What is normalisation? Organising tables to reduce duplication
Web fundamentals
- What happens when you type a URL? DNS lookup, TCP/TLS connection, HTTP request, server response, browser rendering
- What is a REST API? Resource URLs with HTTP methods returning JSON. See REST API explained
- Common status codes? 200, 201, 301, 302, 400, 401, 403, 404, 500
- What is CORS? A browser rule controlling which origins can call your API
- HTTP vs HTTPS? HTTPS encrypts traffic with TLS
- How do you improve page speed? Optimised images, caching, minified assets, fewer requests, CDN, fast server response
Tools and practice
- Basic Git commands?
clone,add,commit,push,pull,branch,merge. See Git basics - How do you debug? DevTools Console and Network, error logs, breakpoints. See DevTools guide and debugging PHP errors
- Tell us about a project you built. Explain the problem, your role, technical choices, challenges and results
Practical round tips
- Common tasks: a CRUD app, form with validation, API fetch and display, or fixing a bug in existing code
- Think aloud and write readable code; handle errors and edge cases
- Have live project links and a clean GitHub ready
FAQs
Do they ask DSA for web roles?
Product companies often do; agencies focus on practical skills.
How should freshers prepare?
Build 3–5 real projects, revise these basics, and practise explaining your code. See web developer roadmap.
Was this article helpful?
Your answer helps us improve our guides