Frontend Developer Interview Questions
A complete guide covering JavaScript Core, Asynchronous JS, React Fundamentals & Advanced, Next.js (App Router), TypeScript, Performance Optimization, and Web Security.
Total Questions:210
Difficulty Levels:
BeginnerIntermediateAdvanced
0%
Overall Progress
0/210
Status
Problem
Level
2.Explain closures in JavaScript with a real-world example.Medium
2.Explain closures in JavaScript with a real-world example.
Medium
3.What is the Event Loop in JavaScript?Hard
3.What is the Event Loop in JavaScript?
Hard
4.What is the difference between == and ===?Easy
4.What is the difference between == and ===?
Easy
5.Explain 'this' keyword and how it behaves in different contexts.Medium
5.Explain 'this' keyword and how it behaves in different contexts.
Medium
6.What is the difference between call, apply, and bind?Medium
6.What is the difference between call, apply, and bind?
Medium
7.What is hoisting in JavaScript?Easy
7.What is hoisting in JavaScript?
Easy
8.Explain prototypal inheritance.Hard
8.Explain prototypal inheritance.
Hard
9.What is the difference between undefined and null?Easy
9.What is the difference between undefined and null?
Easy
10.What are arrow functions and how do they differ from regular functions?Medium
10.What are arrow functions and how do they differ from regular functions?
Medium
11.What is the difference between synchronous and asynchronous code?Easy
11.What is the difference between synchronous and asynchronous code?
Easy
12.What is the difference between deep copy and shallow copy?Medium
12.What is the difference between deep copy and shallow copy?
Medium
13.What is the spread operator and rest parameters?Easy
13.What is the spread operator and rest parameters?
Easy
14.What is destructuring in JavaScript?Easy
14.What is destructuring in JavaScript?
Easy
15.Explain event bubbling and event capturing.Medium
15.Explain event bubbling and event capturing.
Medium
16.What is event delegation and why is it useful?Medium
16.What is event delegation and why is it useful?
Medium
17.What is the difference between map(), forEach(), filter(), and reduce()?Medium
17.What is the difference between map(), forEach(), filter(), and reduce()?
Medium
18.What are template literals?Easy
18.What are template literals?
Easy
19.What is the difference between slice() and splice()?Easy
19.What is the difference between slice() and splice()?
Easy
20.What are JavaScript promises?Medium
20.What are JavaScript promises?
Medium
21.What is the difference between Promises and async/await?Easy
21.What is the difference between Promises and async/await?
Easy
22.What is callback hell and how do you avoid it?Medium
22.What is callback hell and how do you avoid it?
Medium
23.What is the difference between microtasks and macrotasks?Hard
23.What is the difference between microtasks and macrotasks?
Hard
24.How do you handle errors in async/await?Easy
24.How do you handle errors in async/await?
Easy
25.What is Promise.all() and when would you use it?Medium
25.What is Promise.all() and when would you use it?
Medium
26.What is the difference between Promise.all(), Promise.race(), Promise.allSettled(), and Promise.any()?Hard
26.What is the difference between Promise.all(), Promise.race(), Promise.allSettled(), and Promise.any()?
Hard
27.What are generators in JavaScript?Hard
27.What are generators in JavaScript?
Hard
28.What is the fetch API and how does it work?Easy
28.What is the fetch API and how does it work?
Easy
29.How do you cancel a fetch request?Medium
29.How do you cancel a fetch request?
Medium
30.What is the difference between setTimeout() and setInterval()?Easy
30.What is the difference between setTimeout() and setInterval()?
Easy
31.What is React and why is it used?Easy
31.What is React and why is it used?
Easy
32.What is JSX and how does it work?Easy
32.What is JSX and how does it work?
Easy
33.What is the Virtual DOM?Medium
33.What is the Virtual DOM?
Medium
34.What is the difference between props and state?Easy
34.What is the difference between props and state?
Easy
35.What are React hooks and why were they introduced?Easy
35.What are React hooks and why were they introduced?
Easy
36.What is useState and how does it work?Easy
36.What is useState and how does it work?
Easy
37.What is useEffect and what is it used for?Easy
37.What is useEffect and what is it used for?
Easy
38.What is the difference between useEffect and useLayoutEffect?Hard
38.What is the difference between useEffect and useLayoutEffect?
Hard
39.What is useRef and when would you use it?Medium
39.What is useRef and when would you use it?
Medium
40.What is useContext and how do you use it?Medium
40.What is useContext and how do you use it?
Medium
41.What is useMemo and when should you use it?Medium
41.What is useMemo and when should you use it?
Medium
42.What is useCallback and when should you use it?Medium
42.What is useCallback and when should you use it?
Medium
43.What is useReducer and when would you use it over useState?Medium
43.What is useReducer and when would you use it over useState?
Medium
44.What is React reconciliation and the diffing algorithm?Hard
44.What is React reconciliation and the diffing algorithm?
Hard
45.What is the difference between controlled and uncontrolled components?Medium
45.What is the difference between controlled and uncontrolled components?
Medium
46.What are Higher-Order Components (HOCs)?Medium
46.What are Higher-Order Components (HOCs)?
Medium
47.What is the Render Props pattern?Medium
47.What is the Render Props pattern?
Medium
48.What are Compound Components?Hard
48.What are Compound Components?
Hard
49.What are React Portals and when would you use them?Medium
49.What are React Portals and when would you use them?
Medium
50.What are Error Boundaries in React?Medium
50.What are Error Boundaries in React?
Medium
51.What is React.memo() and when should you use it?Medium
51.What is React.memo() and when should you use it?
Medium
52.What is the difference between React.memo(), useMemo(), and useCallback?Medium
52.What is the difference between React.memo(), useMemo(), and useCallback?
Medium
53.What is React Suspense and how does it work?Hard
53.What is React Suspense and how does it work?
Hard
54.What are React Server Components?Hard
54.What are React Server Components?
Hard
55.What is React Concurrent Mode?Hard
55.What is React Concurrent Mode?
Hard
56.What is code splitting and lazy loading in React?Medium
56.What is code splitting and lazy loading in React?
Medium
57.What is the Context API and when should you use it?Easy
57.What is the Context API and when should you use it?
Easy
58.What is prop drilling and how do you avoid it?Easy
58.What is prop drilling and how do you avoid it?
Easy
59.What is the key prop and why is it important?Easy
59.What is the key prop and why is it important?
Easy
60.What happens when you use index as a key in lists?Medium
60.What happens when you use index as a key in lists?
Medium
61.What is React hydration in SSR?Medium
61.What is React hydration in SSR?
Medium
62.What are custom hooks and how do you create them?Medium
62.What are custom hooks and how do you create them?
Medium
63.What is the useImperativeHandle hook?Hard
63.What is the useImperativeHandle hook?
Hard
64.What is the useDebugValue hook?Hard
64.What is the useDebugValue hook?
Hard
65.What is the useTransition hook in React 18?Hard
65.What is the useTransition hook in React 18?
Hard
66.What is the useDeferredValue hook?Hard
66.What is the useDeferredValue hook?
Hard
67.What is the useId hook?Easy
67.What is the useId hook?
Easy
68.What is Automatic Batching in React 18?Medium
68.What is Automatic Batching in React 18?
Medium
69.How do you optimize React performance?Medium
69.How do you optimize React performance?
Medium
70.What causes unnecessary re-renders in React?Medium
70.What causes unnecessary re-renders in React?
Medium
71.What is debouncing and how do you implement it?Medium
71.What is debouncing and how do you implement it?
Medium
72.What is throttling and how is it different from debouncing?Medium
72.What is throttling and how is it different from debouncing?
Medium
73.What is lazy loading and when should you use it?Easy
73.What is lazy loading and when should you use it?
Easy
74.What is code splitting and how do you implement it?Medium
74.What is code splitting and how do you implement it?
Medium
75.What is tree shaking in JavaScript?Medium
75.What is tree shaking in JavaScript?
Medium
76.What are Web Vitals (LCP, FID, CLS)?Hard
76.What are Web Vitals (LCP, FID, CLS)?
Hard
77.How do you optimize images for web performance?Easy
77.How do you optimize images for web performance?
Easy
78.What is Critical CSS and how do you implement it?Hard
78.What is Critical CSS and how do you implement it?
Hard
79.What is the difference between preload, prefetch, and preconnect?Hard
79.What is the difference between preload, prefetch, and preconnect?
Hard
80.What is memoization in JavaScript?Medium
80.What is memoization in JavaScript?
Medium
81.What is the Intersection Observer API used for?Medium
81.What is the Intersection Observer API used for?
Medium
82.How do you implement infinite scroll?Medium
82.How do you implement infinite scroll?
Medium
83.What is virtual scrolling/windowing?Hard
83.What is virtual scrolling/windowing?
Hard
84.What is browser caching and how do you leverage it?Medium
84.What is browser caching and how do you leverage it?
Medium
85.What is CDN and how does it improve performance?Easy
85.What is CDN and how does it improve performance?
Easy
86.What is bundle size optimization?Medium
86.What is bundle size optimization?
Medium
87.What is the difference between client-side and server-side rendering?Medium
87.What is the difference between client-side and server-side rendering?
Medium
88.What is Progressive Web App (PWA)?Medium
88.What is Progressive Web App (PWA)?
Medium
89.What are Service Workers?Hard
89.What are Service Workers?
Hard
90.What is the difference between Service Workers and Web Workers?Hard
90.What is the difference between Service Workers and Web Workers?
Hard
91.What is Redux and when should you use it?Medium
91.What is Redux and when should you use it?
Medium
92.What is the Redux Toolkit?Easy
92.What is the Redux Toolkit?
Easy
93.What is the difference between Redux and Context API?Medium
93.What is the difference between Redux and Context API?
Medium
94.What is Zustand and how is it different from Redux?Medium
94.What is Zustand and how is it different from Redux?
Medium
95.What is Recoil?Hard
95.What is Recoil?
Hard
96.What is Jotai?Hard
96.What is Jotai?
Hard
97.What is MobX?Hard
97.What is MobX?
Hard
98.What is the Flux pattern?Medium
98.What is the Flux pattern?
Medium
99.What is the difference between local state and global state?Easy
99.What is the difference between local state and global state?
Easy
100.What are Redux middleware like Redux Thunk and Redux Saga?Hard
100.What are Redux middleware like Redux Thunk and Redux Saga?
Hard
101.What is the difference between Redux Thunk and Redux Saga?Hard
101.What is the difference between Redux Thunk and Redux Saga?
Hard
102.What is immer and why is it useful?Medium
102.What is immer and why is it useful?
Medium
103.What is Redux persist?Medium
103.What is Redux persist?
Medium
104.What is React Query and when would you use it?Medium
104.What is React Query and when would you use it?
Medium
105.What is SWR (stale-while-revalidate)?Medium
105.What is SWR (stale-while-revalidate)?
Medium
106.What is the difference between CSR, SSR, and SSG?Medium
106.What is the difference between CSR, SSR, and SSG?
Medium
107.What is Next.js and what problems does it solve?Easy
107.What is Next.js and what problems does it solve?
Easy
108.What is getStaticProps in Next.js?Medium
108.What is getStaticProps in Next.js?
Medium
109.What is getServerSideProps in Next.js?Medium
109.What is getServerSideProps in Next.js?
Medium
110.What is getStaticPaths in Next.js?Medium
110.What is getStaticPaths in Next.js?
Medium
111.What is Incremental Static Regeneration (ISR)?Hard
111.What is Incremental Static Regeneration (ISR)?
Hard
112.What is the App Router in Next.js 13?Hard
112.What is the App Router in Next.js 13?
Hard
113.What is Remix and how is it different from Next.js?Hard
113.What is Remix and how is it different from Next.js?
Hard
114.What is Astro and what is Islands Architecture?Hard
114.What is Astro and what is Islands Architecture?
Hard
115.What is hydration mismatch in SSR?Medium
115.What is hydration mismatch in SSR?
Medium
116.What are the benefits of SSR over CSR?Easy
116.What are the benefits of SSR over CSR?
Easy
117.What are the drawbacks of SSR?Medium
117.What are the drawbacks of SSR?
Medium
118.What is Edge Runtime?Hard
118.What is Edge Runtime?
Hard
119.What is Streaming SSR?Hard
119.What is Streaming SSR?
Hard
120.What is Partial Hydration?Hard
120.What is Partial Hydration?
Hard
121.What is TypeScript and why use it?Easy
121.What is TypeScript and why use it?
Easy
122.What is the difference between interface and type in TypeScript?Medium
122.What is the difference between interface and type in TypeScript?
Medium
123.What are generics in TypeScript?Hard
123.What are generics in TypeScript?
Hard
124.What are utility types in TypeScript (Partial, Pick, Omit, Record)?Medium
124.What are utility types in TypeScript (Partial, Pick, Omit, Record)?
Medium
125.What is type inference in TypeScript?Easy
125.What is type inference in TypeScript?
Easy
126.What is the difference between any and unknown?Medium
126.What is the difference between any and unknown?
Medium
127.What is type assertion in TypeScript?Easy
127.What is type assertion in TypeScript?
Easy
128.What are union and intersection types?Medium
128.What are union and intersection types?
Medium
129.What is the never type in TypeScript?Hard
129.What is the never type in TypeScript?
Hard
130.What are conditional types in TypeScript?Hard
130.What are conditional types in TypeScript?
Hard
131.What is mapped types in TypeScript?Hard
131.What is mapped types in TypeScript?
Hard
132.What is the readonly modifier in TypeScript?Easy
132.What is the readonly modifier in TypeScript?
Easy
133.What are enums in TypeScript?Easy
133.What are enums in TypeScript?
Easy
134.What is the difference between type guards and type assertions?Medium
134.What is the difference between type guards and type assertions?
Medium
135.What is the keyof operator in TypeScript?Medium
135.What is the keyof operator in TypeScript?
Medium
136.What is localStorage and sessionStorage?Easy
136.What is localStorage and sessionStorage?
Easy
137.What is the difference between localStorage, sessionStorage, and cookies?Easy
137.What is the difference between localStorage, sessionStorage, and cookies?
Easy
138.What is the Fetch API?Easy
138.What is the Fetch API?
Easy
139.What is the difference between XMLHttpRequest and Fetch?Medium
139.What is the difference between XMLHttpRequest and Fetch?
Medium
140.What is CORS and how do you handle it?Medium
140.What is CORS and how do you handle it?
Medium
141.What is the History API?Medium
141.What is the History API?
Medium
142.What is the Geolocation API?Easy
142.What is the Geolocation API?
Easy
143.What is the Notification API?Medium
143.What is the Notification API?
Medium
144.What is the File API?Medium
144.What is the File API?
Medium
145.What is IndexedDB?Hard
145.What is IndexedDB?
Hard
146.What is the Cache API?Hard
146.What is the Cache API?
Hard
147.What is the Broadcast Channel API?Hard
147.What is the Broadcast Channel API?
Hard
148.What is the Page Visibility API?Easy
148.What is the Page Visibility API?
Easy
149.What is the Network Information API?Medium
149.What is the Network Information API?
Medium
150.What is the Clipboard API?Easy
150.What is the Clipboard API?
Easy
151.What is WebSockets and when would you use it?Medium
151.What is WebSockets and when would you use it?
Medium
152.What is the difference between WebSockets and HTTP?Medium
152.What is the difference between WebSockets and HTTP?
Medium
153.What are Server-Sent Events (SSE)?Hard
153.What are Server-Sent Events (SSE)?
Hard
154.What is WebRTC?Hard
154.What is WebRTC?
Hard
155.What is the Drag and Drop API?Medium
155.What is the Drag and Drop API?
Medium
156.What is the difference between unit testing, integration testing, and E2E testing?Easy
156.What is the difference between unit testing, integration testing, and E2E testing?
Easy
157.What is Jest and how do you use it?Easy
157.What is Jest and how do you use it?
Easy
158.What is React Testing Library?Medium
158.What is React Testing Library?
Medium
159.What is the difference between React Testing Library and Enzyme?Medium
159.What is the difference between React Testing Library and Enzyme?
Medium
160.What is snapshot testing?Medium
160.What is snapshot testing?
Medium
161.What is mocking in testing?Medium
161.What is mocking in testing?
Medium
162.What is code coverage?Easy
162.What is code coverage?
Easy
163.What is Test-Driven Development (TDD)?Medium
163.What is Test-Driven Development (TDD)?
Medium
164.What is Cypress and when would you use it?Medium
164.What is Cypress and when would you use it?
Medium
165.What is Playwright?Hard
165.What is Playwright?
Hard
166.How do you test async code in Jest?Medium
166.How do you test async code in Jest?
Medium
167.How do you test React hooks?Hard
167.How do you test React hooks?
Hard
168.What is MSW (Mock Service Worker)?Hard
168.What is MSW (Mock Service Worker)?
Hard
169.What is Vitest?Medium
169.What is Vitest?
Medium
170.What are integration tests for APIs?Medium
170.What are integration tests for APIs?
Medium
171.What is XSS (Cross-Site Scripting) and how do you prevent it?Medium
171.What is XSS (Cross-Site Scripting) and how do you prevent it?
Medium
172.What is CSRF (Cross-Site Request Forgery)?Medium
172.What is CSRF (Cross-Site Request Forgery)?
Medium
173.What is SQL Injection and how do you prevent it?Easy
173.What is SQL Injection and how do you prevent it?
Easy
174.What is Content Security Policy (CSP)?Hard
174.What is Content Security Policy (CSP)?
Hard
175.What is HTTPS and why is it important?Easy
175.What is HTTPS and why is it important?
Easy
176.What is the same-origin policy?Medium
176.What is the same-origin policy?
Medium
177.What are httpOnly and secure flags in cookies?Medium
177.What are httpOnly and secure flags in cookies?
Medium
178.What is JWT and how does it work?Medium
178.What is JWT and how does it work?
Medium
179.What is OAuth 2.0?Hard
179.What is OAuth 2.0?
Hard
180.What is the difference between authentication and authorization?Easy
180.What is the difference between authentication and authorization?
Easy
181.What is token-based authentication?Medium
181.What is token-based authentication?
Medium
182.What is session-based authentication?Medium
182.What is session-based authentication?
Medium
183.How do you securely store passwords?Easy
183.How do you securely store passwords?
Easy
184.What is bcrypt?Easy
184.What is bcrypt?
Easy
185.What is OWASP Top 10?Medium
185.What is OWASP Top 10?
Medium
186.What is Webpack and what problem does it solve?Easy
186.What is Webpack and what problem does it solve?
Easy
187.What is Vite and how is it different from Webpack?Medium
187.What is Vite and how is it different from Webpack?
Medium
188.What is Babel and what does it do?Easy
188.What is Babel and what does it do?
Easy
189.What is the difference between development and production builds?Easy
189.What is the difference between development and production builds?
Easy
190.What is Hot Module Replacement (HMR)?Medium
190.What is Hot Module Replacement (HMR)?
Medium
191.What is Rollup?Medium
191.What is Rollup?
Medium
192.What is esbuild?Hard
192.What is esbuild?
Hard
193.What is Turbopack?Hard
193.What is Turbopack?
Hard
194.What is SWC?Hard
194.What is SWC?
Hard
195.What are source maps and why are they useful?Medium
195.What are source maps and why are they useful?
Medium
196.What is minification and uglification?Easy
196.What is minification and uglification?
Easy
197.What is the difference between CommonJS and ES Modules?Medium
197.What is the difference between CommonJS and ES Modules?
Medium
198.What is dynamic import in JavaScript?Medium
198.What is dynamic import in JavaScript?
Medium
199.What is module federation in Webpack?Hard
199.What is module federation in Webpack?
Hard
200.What is a monorepo and what tools support it (Nx, Turborepo, Lerna)?Medium
200.What is a monorepo and what tools support it (Nx, Turborepo, Lerna)?
Medium
201.What is micro-frontends architecture?Hard
201.What is micro-frontends architecture?
Hard
202.What is the BFF (Backend for Frontend) pattern?Hard
202.What is the BFF (Backend for Frontend) pattern?
Hard
203.What is GraphQL and how is it different from REST?Medium
203.What is GraphQL and how is it different from REST?
Medium
204.What is tRPC?Hard
204.What is tRPC?
Hard
205.What is Web Components and Shadow DOM?Hard
205.What is Web Components and Shadow DOM?
Hard
206.What is the Jamstack architecture?Medium
206.What is the Jamstack architecture?
Medium
207.What is headless CMS?Easy
207.What is headless CMS?
Easy
208.What is serverless architecture?Easy
208.What is serverless architecture?
Easy
209.What is edge computing?Medium
209.What is edge computing?
Medium
210.What is design systems and component libraries?Easy
210.What is design systems and component libraries?
Easy