Frontend Developer Interview Guide
Frontend Developer Interview Guide
Basic Questions:
Advanced Questions:
1. How can you make a webpage more accessible using HTML?
2. What is the purpose of <meta> tags?
3. How do you use data attributes in HTML, and why are they useful?
4. Explain the concept of iframes and their use cases.
5. How does the picture element work in responsive design?
6. What is the difference between <header>, <footer>, and <nav> tags, and how do
they contribute to semantic structure?
Basic Questions:
1. What is the difference between inline, internal, and external CSS?
2. What is the box model in CSS?
3. How do you add a background image to a webpage?
4. What is the difference between relative, absolute, and fixed positioning?
5. What are pseudo-classes and pseudo-elements?
6. What is the difference between em and rem units?
7. How do you apply styles specifically for print media?
8. What are media queries, and how do you use them for responsive design?
Advanced Questions:
Basic Questions:
Advanced Questions:
1.
2.
Create a function to fetch data using async/await and handle errors with try...catch.
async function fetchData(url) {
try {
const response = await fetch(url);
if (!response.ok) throw new Error('Network error');
const data = await response.json();
return data;
} catch (error) {
console.error('Error:', error);
}
}
3.
4. TypeScript Interview Questions
Basic Questions:
Advanced Questions:
1. What is the unknown type in TypeScript, and how does it differ from any?
2. Explain TypeScript decorators.
3. What are utility types in TypeScript?
4. How does TypeScript support mixins?
5. How do you handle modules and namespaces in TypeScript?
6. What is the difference between interface and type?
7. How do you implement type guards in TypeScript?
8. How does TypeScript support function overloading?
Write a function to handle both string and number input using generics.
function combine<T extends string | number>(a: T, b: T): T {
return (typeof a === "string" && typeof b === "string" ? a + b : (a as number) + (b as number))
as T;
}
9.
10.How does TypeScript handle mapped types?
11.How do you define and use union types in TypeScript?
12.What are TypeScript literal types, and when are they useful?
1. Implement a TypeScript function to calculate the factorial of a number using recursion.
2. Create a TypeScript interface for a Product object with properties name, price,
description, and category.
3. Write a TypeScript class for a basic calculator with methods for addition, subtraction,
multiplication, and division.
5. React JS Interview Questions
Basic Questions:
1. What are hooks in React, and why were they introduced?
2. Explain useState and provide an example.
3. How does useEffect work, and what are its use cases?
4. What is useContext, and how does it simplify prop drilling?
5. Explain useReducer and how it differs from useState.
6. What is useMemo, and when would you use it?
7. What is useCallback, and how does it optimize rendering?
8. How does useRef work, and what are its practical use cases?
9. What is useLayoutEffect, and how does it differ from useEffect?
10.What is useImperativeHandle, and how is it used?
11.Explain useId and its purpose in React.
12.What are custom hooks, and how do you create one?
13.What is the difference between useSyncExternalStore and useContext?
14.How do you manage side effects in React effectively?
Advanced Questions:
Basic Questions:
Advanced Questions:
1. How does data fetching work in the Next.js App Router? (e.g., fetch, use, and
react-query)
2. How do you implement caching strategies in the Next.js App Router?
3. What are loading states in the App Router, and how are they managed?
4. How do you handle dynamic routing in the Next.js App Router?
5. How do you implement middleware in Next.js for request handling?
6. What are the differences between pages and app directories in Next.js?
7. How do you optimize images and assets in the App Router?
8. Explain the role of head.js in the App Router.
9. How do you configure nested layouts in the App Router?
10.How do you handle streaming data in the Next.js App Router?
11.What is the role of React Server Components in Next.js, and how do they improve
performance?
12.How do you manage state in a server component-based architecture?