
Web Development Interview Questions and Answers
Top 100 Web Development Interview Questions for Freshers
Full Stack Development is one of the most in-demand skills in top tech companies, including IDM TechPark. Mastering both frontend and backend technologies, databases, and deployment strategies makes a Full Stack Developer a valuable asset in modern software development. To secure a Full Stack Developer role at IDM TechPark, candidates must be proficient in technologies like HTML, CSS, JavaScript, React, Angular, Node.js, Express.js, Python, Java, .NET, PHP, MySQL, MongoDB, and cloud services, as well as ready to tackle both the Full Stack Online Assessment and Technical Interview Round.
To help you succeed, we have compiled a list of the Top 100 Full Stack Developer Interview Questions along with their answers. Mastering these will give you a strong edge in cracking Full Stack Development interviews at IDM TechPark.
HTML & CSS
-
What is the difference between <section> and <div> in HTML?
<section> is a semantic tag representing a standalone section of content, whereas <div> is a generic container with no semantic meaning. -
How can you make a website mobile-responsive?
Use media queries, flexible grid layouts, and relative units like %, em, or rem. Example:@media (max-width: 768px) { body { font-size: 14px; } }
-
What is the difference between absolute, relative, fixed, and sticky positioning in CSS?
-
Relative: Positioned relative to its normal position.
-
Absolute: Positioned relative to the nearest positioned ancestor.
-
Fixed: Stays fixed relative to the viewport.
-
Sticky: Sticks to a defined position while scrolling.
-
-
What is the difference between visibility: hidden; and display: none;?
-
visibility: hidden; hides the element but still occupies space.
-
display: none; removes the element from the document flow.
-
-
How can you create a flexbox-based layout?
.container { display: flex; justify-content: center; align-items: center; }
JavaScript
-
What is the difference between let, const, and var in JavaScript?
-
var: Function-scoped, can be re-declared.
-
let: Block-scoped, cannot be re-declared.
-
const: Block-scoped, immutable reference.
-
-
Explain event delegation in JavaScript.
Event delegation is when a parent element handles events for its child elements using event bubbling. Example:document.getElementById("parent").addEventListener("click", function(event) { if (event.target.tagName === "BUTTON") { console.log("Button clicked!"); } });
-
What is the difference between synchronous and asynchronous JavaScript?
-
Synchronous: Code executes line-by-line.
-
Asynchronous: Uses callbacks, promises, or async/await to execute without blocking execution.
-
-
How does async and await work in JavaScript?
-
async makes a function return a promise.
-
await pauses execution until the promise resolves.
async function fetchData() { let data = await fetch("https://api.example.com/data"); return data.json(); }
-
-
What is a JavaScript closure?
A closure is a function that retains access to variables from its outer scope even after execution.
function outer() { let count = 0; return function inner() { count++; console.log(count); }; } let counter = outer(); counter(); // 1 counter(); // 2
React & Frontend Frameworks
-
What is the virtual DOM in React?
The virtual DOM is a lightweight copy of the real DOM that React uses to efficiently update UI changes. -
How do you pass data between React components?
-
Parent to child: Use props (<ChildComponent propName={value} />).
-
Child to parent: Use callback functions (props.onChange(data)).
-
Global state: Use Redux, Context API, or Recoil.
3.What are React hooks?
Hooks allow functional components to use state and lifecycle features. Examples:
useState for state management.
useEffect for side effects.
useContext for global state.
4.How do you optimize React performance?
Use React.memo for component re-renders.
Use useCallback and useMemo to optimize functions and computations.
Implement lazy loading with React.lazy().
5.What is the difference between controlled and uncontrolled components in React?
Controlled: Component state is managed by React. Example:
function App() { const [value, setValue] = useState(""); return <input value={value} onChange={(e) => setValue(e.target.value)} />; }
Uncontrolled: Uses direct DOM references (ref).
Backend & Databases
-
What is REST API?
A REST API follows REST principles using HTTP methods (GET, POST, PUT, DELETE) to communicate between a client and server. -
What is the difference between SQL and NoSQL databases?
-
SQL (MySQL, PostgreSQL) is structured with tables and relationships.
-
NoSQL (MongoDB, Firebase) uses flexible schema (documents, key-value stores).
-
How do you prevent SQL injection?
Use prepared statements:
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?"); $stmt->execute([$email]);
-
What is middleware in Express.js?
Middleware functions process requests before reaching route handlers. Example:
app.use((req, res, next) => { console.log("Middleware executed"); next(); });
-
How do you handle authentication in a web app?
-
Use JWT (JSON Web Token) for token-based authentication.
-
Implement OAuth for third-party logins.
-
Secure passwords using bcrypt.
Security & Performance
-
What is Cross-Site Scripting (XSS)?
XSS is an attack where attackers inject malicious scripts into a website, affecting users. Prevent it using:
-
Input sanitization
-
Content Security Policy (CSP)
-
Encoding output
-
What is the difference between HTTP and HTTPS?
HTTPS encrypts data using SSL/TLS, making communication secure. -
What is CORS (Cross-Origin Resource Sharing)?
CORS allows web apps to request resources from a different domain. Example Express.js setup:
app.use(cors({ origin: "https://example.com" }));
-
What is lazy loading, and why is it useful?
Lazy loading defers the loading of non-critical resources to improve performance. Example in React:
const LazyComponent = React.lazy(() => import("./Component"));
-
How do you optimize website performance?
-
Minify CSS and JavaScript.
-
Enable caching.
-
Use a CDN.
-
Optimize images using tools like WebP.
​