Frontend Interview Questions: HTML, CSS, JavaScript, React

Recently attended a Frontend / React interview and thought of sharing the actual questions asked — might help someone preparing 👇 🔹 Questions Covered HTML What is the difference between div and span? What are semantic HTML elements? Difference between id and class What is the purpose of meta tags? How does browser rendering work? CSS Difference between display: none and visibility: hidden What is Flexbox? Explain justify-content and align-items Difference between Flexbox and Grid What is position and its types? How do you make a website responsive? Difference between px, %, em, and rem JavaScript Difference between var, let, and const What is hoisting? What is closure? Difference between == and === What is event delegation? How does async/await work? Difference between map, filter, and reduce What is debouncing and throttling? React What is React and why is it used? What is SPA (Single Page Application)? Difference between state and props What are React Hooks? Explain useState and useEffect Difference between useMemo and useCallback Controlled vs Uncontrolled components What is Context API? How do you optimize React performance? #HTML #CSS #JavaScript #React #FrontendDeveloper #InterviewExperience #WebDevelopment #CareerGrowth

Short answers from my mind right now: 1. Div is a Block tag and span is the Inline tag. 2. Semantic elements describe meaning, not just structure. 3. Id is unique and class is reusable. Selector: #idname , .class getElementById , querySelectorAll 4. Meta tags provide metadata about the document.( SEO, responsive design, charector encoding, social sharing ( open graph )). 5. How Browser Rendering Works HTML - DOM CSS - CSSOM DOM + CSSOM - Render Tree Layout (position & size) Paint (pixels on screen) CSS 1. display: none Element removed from layout visibility: hidden Element invisible but space remains. 2. One-dimensional layout system (row OR column). justify-content - main axis alignment align-items - cross axis alignment 3. Flexbox: 1D layout Grid: 2D layout Flexbox: Content-first Grid: Layout-first Flexbox: Rows or columns Grid: Rows and columns 3.static (default) relative (offset from itself) absolute (relative to the nearest positioned parent) fixed (viewport-based) sticky (scroll-aware hybrid) 4. Media queries Flexible units (%, rem, vw) Flexbox/Grid Mobile-first design. 5. px - fixed % - relative to parent em - relative to parent font-size rem - relative to root (html) font-size preferred.

To view or add a comment, sign in

Explore content categories