R WNX NVF 8 JMG 5 W PGX BYNp MV
R WNX NVF 8 JMG 5 W PGX BYNp MV
FRONTEND
INTERVIEW
(SDE1, SDE2 +)
30 HTML questions
20+ CSS questions
50 frequent JavaScript questions (including 10 machine-round coding challenges)
50 frequent React.js questions (with 10 machine-round coding challenges)
20 important Next.js questions.
Along with these technical insights, I’ve included invaluable career advice:
By the end of this book, you'll be equipped with the knowledge and skills to
confidently tackle frontend development challenges and land your dream job,
whether it's remote or on-site.
TABLE OF
CONTENTS
HTML Page 03
CSS Page 11
Javascript Page 21
React.js Page 40
Next.Js Page 53
Job Opportunity :
Page 62
(Cold Email, Referral, Job Platform and Job Apply)
Interview Page 65
( Preparation Tips, Questions, How to explain, Body Language)
HTML
1. What is HTML?
HTML stands for HyperText Markup Language, which is the most fundamental
building block of the Web. HTML defines the structure and meaning of web content.
Attributes are extra properties that alter the behavior of an HTML tag. For example,
the tag <input> has `type` attribute which defines what the input field is, such as a
text field, checkbox or radio button, etc.
1. Geolocation
2. Offline application caching
3. Improved error handling
4. Better Browser Support and Compatibility
5. Client-side databases
The <!DOCTYPE html> declaration appears at the top of any HTML5 document. This
will inform the web browser as to which version of HTML it will be presented with,
making the document display properly within that particular web browser. In fact,
there are three doctypes: Strict, Frameset, and Transitional.
Page 3
5. What are semantic elements in HTML5?
Semantic HTML provides meaning to a webpage’s content rather than just focusing
on presentation. For example, a <p> tag indicates a paragraph, conveying both
meaning and format. In contrast, tags like <b> and <i> are non-semantic as they only
define presentation without additional meaning.
<article>
<aside>
<figure>
<footer>
<header>
<main>
<mark>
<nav>
<section>
<summary>
<time>
The anchor tag (<a>) is used to create links between different sections of a page or
between different web pages.
7. What is an iFrame?
The <iframe> tag allows the inclusion of another webpage within a web page. It is
often used for displaying banner ads from third-party platforms but can pose
security risks due to potential cross-site vulnerabilities.
Page 4
8. What are the common lists used in web design?
The <canvas> element serves as a container for drawing graphics on web pages
using a scripting language like JavaScript. It enables the dynamic rendering of 2D
shapes and images.
<span> is an inline element used for styling small portions of text within a block
without disrupting the flow of content.
Page 5
11. What are empty elements?
Empty elements, or void elements, are HTML tags that do not have any content
and do not require a closing tag. Examples include <img>, <br>, and <hr>
Frames are rarely used in modern web design due to issues with usability, SEO,
and accessibility. but alternatives like <iframe> or responsive design are generally
recommended.
You can create a clickable email link using the <a> tag with a mailto: URL:
Page 6
16. Explain the difference between block-level and inline elements.
Block-level elements start on a new line and occupy the full width of their
container. Examples : <p>, <div>, and <h1-h6>.
Inline elements don't start on a new line and only take up the space they need.
Examples include <span>, <a>, and <img>.
The <head> section contains metadata about the page, such as the title, description,
keywords, stylesheets, and scripts.
The <form> element is used to create forms for collecting user input. Input fields
are created using the <input> element with various type attributes like text, email,
password, checkbox, radio, and submit.
Use the <select> element with <option> elements for the options.
We should use a consistent coding style, avoid using proprietary features, and
test your code in different browsers.
Page 7
22. What is the purpose of the <meta> tag, and what are some common uses?
The <meta> tag provides metadata about the page, such as the character encoding,
viewport settings, and keywords. It helps for SEO.
The <title> element specifies the title of the webpage, which is displayed in the
browser's tab or title bar.
Use the <table> element with <tr> rows, <th> header cells, and <td> data cells.
Page 8
25. How can I create a login form in HTML with email and password fields?
To create a login form in HTML, you'll need to use the following elements and
attributes:
<form> element: Defines the form.
<label> element: Associates a label with a form control.
<input> element: Creates input fields.
type="email": Creates an email input field.
type="password": Creates a password input field.
<button> element: Creates a button for submitting the form.
26. What is the role of the <link rel="preload"> and <link rel="prefetch">
elements in improving page performance?
<link rel="preload"> : This element tells the browser to load a resource immediately,
as it is likely to be needed soon. This can help reduce page load times, especially for
critical resources like stylesheets and scripts.
<link rel="prefetch">: This element tells the browser to load a resource in the
background, as it might be needed later. This can help improve perceived
performance, as the resource will already be available if the user decides to navigate
to a page that requires it.
27. How can you prevent cross-site scripting (XSS) attacks in your HTML code?
1. Input validation: validate all user inputs so that they have the correct form for
the data that they expect. This avoids injection of malicious data into your
application.
2. Encode user-generated content: To prevent cross-site scripting (XSS) attacks,
always encode user-generated content before inserting it into the DOM.
This means converting potentially harmful characters into their encoded
equivalents, preventing malicious scripts from being executed.
(Continue...)
Page 9
3. Use CSP: A CSP is a policy that defines which resources a web page may load. It can
also contribute to the prevention of XSS attacks by limiting malicious scripts from
executing on the server.
28. How to use <picture> element and how it can be used for responsive images?
The <picture> element is newly released of HTML5, It allows you to specify multiple
image sources for different screen sizes or conditions, ensuring that the most
appropriate image is displayed for the user's device.
29. Explain the importance of using HTTPS for secure web communication.
Page 10
-End-
CSS
1.What is CSS?
CSS helps you design your website's appearance. It's like choosing colors, fonts, and
layout for your website. Think of it as a stylist for your online space
The box model represents the rectangular boxes that elements generate in the
document tree. It comprises
1. ?
Content-box
Padding-box border-box
(default)
CALCULATION
100px/100px 100px/100px 100px/100px
(Height/width)
Page 11
3.How can you center a block element in CSS?
1. ?
Class:
Multiple elements can share the same class. This allows you to apply the same
styles to multiple elements on a page.
Classes are defined using a dot (.) followed by the class name. (.my-class)
ID
Only one element can have a specific ID. IDs are unique identifiers for elements.
IDs are defined using a hash (#) followed by the ID name. For example, #my-id.
Page 12
5.What is a CSS preprocessor?
CSS preprocessors extend CSS with features like variables, nested rules, and
functions, enhancing maintainability and efficiency. Popular preprocessors
include Sass, LESS, and Stylus.
1. ?
Page 13
8. What are media queries in CSS?
The media query adjusts the style on smaller screens in order to change layout,
font size, and padding that make the content readable and accessible while giving a
better user experience for mobile devices.
Flexbox, short for Flexible Box Layout, is a CSS layout module that makes building
complex layouts easier, without floats and positioning
1. ?
1. Flexbox makes it simple to create flexible, responsive layouts that adapt to
different screen sizes.
2. Flexbox automatically distributes spare space between items, or around them,
so you'll avoid computing margins or padding.
Page 14
10.What is the difference between display: none, visibility: hidden and opacity: 0
1. ?
1. Use Fluid Grid Layouts: Use percentage-based widths rather than fixed pixel
values when designing your layout, so elements can adapt dynamically to
screens of all sizes.
2. Flexible Media (Images/Videos): Use max-width: 100% to scale images and
media so they do not exceed their parent containers. Still, on smaller screens,
they should not overflow.
3. Media Queries: Media queries add specific CSS rules for their application based
on specific characteristics like width. This would mean adapting the positions,
fonts, or even the visibility of an element based on the screen size.
4. Use relative units-like em, rem, or %-for the size of fonts instead of pixels to
ensure that all texts are well scaled according to screen size and users'
preferences.
Page 15
12.What are CSS transitions?
CSS transitions enable smooth changes between property values over a specified
duration
The float property positions elements to the left or right, allowing text to wrap
around them. While still used, modern layouts often utilize Flexbox and Grid
instead.
Page 16
15.What is the z-index property?
The z-index property controls the stacking order of overlapping elements. Higher
values appear on top. It only applies to positioned elements (those with position
set to relative, absolute, fixed, or sticky).
1. ?
Footer
Page 17
17.What is the position property in CSS?
1.static
Default positioning, where the element follows the normal document flow without
any special positioning applied.
2.relative
Positions the element relative to its original place in the normal flow, allowing for
small offsets using top, left, right, or bottom.
3.absolute
Removes the element from the document flow and positions it relative to its
nearest positioned (non-static) ancestor, allowing for precise placement.
4.fixed
1. The element is removed from the document flow
? and stays fixed relative to the
viewport, meaning it remains in the same spot even during scrolling.
5. sticky
A hybrid between relative and fixed, where the element switches from relative to
fixed positioning based on the user's scroll position within its container.
The @import rule imports one CSS file into another and should be placed at the
top of the CSS file:
Page 18
19.What are CSS selectors?
CSS selectors tell the browser which elements to style on a webpage, like pointing
at a heading or button and applying the right colors, fonts, or layouts to them.
👉 FULL SCREEN 🔗
1.
20.Explain the concept of specificity in CSS. ?
Higher specificity will apply styles to an element, overriding those with lower
specificity.
👉 Details Explaination
Page 19
21.What are the different types of CSS size units such as px, rem, and others? Please
provide a brief description and an example for each unit.
1. ?
Page 20
-End-
JAVASCRIPT
1. What are JavaScript data types?
Page 21
4. What is a closure in JavaScript?
A closure is a function that retains access to its outer scope even after the outer
function has finished execution. Closures allow encapsulation and are widely
used in callbacks and event handlers.
Page 22
7. What is the difference between == and ===?
== : Performs equality after type coercion, meaning 2 == "2" will return true.
=== : Performs strict equality without type coercion, so 2 === "2" will return false.
1. ?
1. ?
Page 23
10. What are async/await?
11. What is the difference between call, apply, and bind in JavaScript?
call: Invokes a function with a specified this value and arguments provided
individually.
apply: Similar to call, but arguments are provided as an array.
bind: Returns a new function with a bound this value that can be called later.
1. ?
1. ?
Prototypal inheritance allows objects to inherit properties and methods from another
object via the prototype chain. Every JavaScript object has an internal [[Prototype]]
property, which can be accessed using Object.getPrototypeOf() or __proto__.
Page 24
13. What is the `this` keyword in JavaScript?
The this keyword refers to the object that is executing the current function. Its value
depends on how the function is invoked:
In the global scope, this refers to the global object (window in browsers).
In a regular function (non-strict mode), this refers to the global object.
In strict mode, this is undefined inside a function.
In an object method, this refers to the object itself.
Arrow functions do not have their own this and inherit it from the surrounding
context.
You can explicitly set the value of this using call(), apply(), and bind().
In a class, this refers to the instance of the class.
1. ?
1. ?
Page 25
14.Explain the concept of currying?
JavaScript modules allow code to be organized into reusable chunks by using import
and export. ES6 introduced modules to manage dependencies and improve
maintainability.
1. ?
?
16. What are IIFEs (Immediately Invoked Function Expressions)?
IIFEs are functions executed immediately after they are defined. They create a new
scope to avoid polluting the global namespace
17. What is the difference between shallow copy and deep copy?
Shallow Copy: Copies the reference of objects; nested objects are not copied.
Deep Copy: Creates a completely independent copy of all objects and nested objects.
(continue...) Page 26
18. What are destructuring and rest/spread operators?
Destructuring: Unpacks values from arrays or properties from objects into variables.
Spread: Expands an array or object into individual elements.
Rest: Collects arguments into an array.
1. ?
. ?
Event delegation is a technique where a parent element handles events for its child
elements by leveraging event bubbling. This improves performance when handling
events for dynamically added elements.
Page 27
20. What are generator functions?
Generator functions are special functions that can pause their execution and
resume later. They are defined using the function* syntax and use yield to return
values.
1. ?
. ?
Page 28
23. Explain debouncing in JavaScript.
Debouncing ensures that a function is executed only after a specified delay has passed
since the last time it was invoked. It’s commonly used in search input fields or window
resize events.
1. ? ?
25. What is the difference between a shallow freeze and a deep freeze in objects?
Page 29
26. What is the difference between Object.create and class inheritance?
Event Bubbling: The event starts from the target element and propagates up to the
parent elements.
Event Capturing: The event starts from the root element and propagates down to
the target element.
Use addEventListener(event, handler, useCapture) to control the phase
(useCapture is false for bubbling, true for capturing).
1. ?
1. ?
28. What are the differences between mutable and immutable objects in JavaScript?
Mutable: Objects that can be modified after creation. Example: Arrays and objects.
Immutable: Objects that cannot be modified after creation. Example: Strings.
Page 30
29. Explain the Set object in JavaScript.
The super keyword is used to call methods or access properties of a parent class in the
child class. It is often used in constructors of derived classes.
1. ?
?
Page 31
31. Explain the Set object in JavaScript.
A Set is a collection of unique values. It does not allow duplicate entries and provides
methods like add, delete, and has.
A WeakMap is a collection of key-value pairs where keys are objects and values can be
arbitrary values. Keys are weakly referenced, meaning they can be garbage collected
if not referenced elsewhere.
1. ?
1. ?
Page 32
34. What is the Intl object in JavaScript?
The Intl object provides tools for language-sensitive formatting of dates, numbers,
and strings.
Service workers are background scripts that enable features like offline caching, push
notifications, and background synchronization.
Decorators are special functions that modify the behavior of classes or class methods.
They are proposed for ES7+.
Page 33
38. What is the purpose of the Reflect object in JavaScript?
The Reflect object provides methods for interceptable JavaScript operations. It offers a
way to perform actions on objects similar to Object but in a functional style, and it
works well with proxies.
39. Can you compare the three common web storage mechanisms: LocalStorage,
SessionStorage, and Cookies? Please explain their key differences, use cases, and
security implications.
1. ?
?
40. What is the difference between the window object and the DOM object in JavaScript?
The window object represents the browser's global context and provides access to
browser-specific functions like window.location, window.alert(), and global variables
(document, console).
The DOM object is a programming interface for the HTML document, allowing
manipulation of its structure, content, and style (e.g., document.getElementById(),
document.createElement()).
The window object manages the browser's environment, and the DOM is a part
of the window that allows interaction with the page content.
Page 34
JS Coding Round
1. Write a custom implementation of the map function for arrays. The function should
take a callback function as an argument and return a new array where each element
is the result of applying the callback to the corresponding element in the original array.
1. ? ?
Page 35
3. Implement a custom version of the reduce function. The function should take a
callback and an optional initial value, and return the accumulated result after applying
the callback function across all elements in the array.
1. 4. Write your own filter function that mimics ?the behavior of JavaScript's native filter
method. The function should take a callback that tests each element and return a new
array of elements that pass the test.
Page 36
5. Implement a custom flat function that flattens a nested array. The function should
accept a depth argument to specify how deep the flattening should go (similar to
Array.prototype.flat() in modern JavaScript).
Page 37
7. Write a function that takes an object and a string representing a path (e.g., "a.b.c") and
returns the value at that path in the object. The function should handle cases where the
path is invalid or the object does not have the specified property.
8. Design a class that allows chaining of arithmetic operations like addition and
multiplication. For example, a sequence like operation(10).add(2).multiply(10) should
work. The class should return the instance of the object to enable method chaining,
and a final getResult() method to retrieve the result.
1. ?
1. ?
Page 38
9. Create a function curry that transforms a function with addition parameters into a
curried function. Your curry function should handle any function with any number of
parameters and should allow you to call the function step by step (one argument at a
time).
1. ?
1. ?
10. Write a function deepClone that creates a deep copy of a given object or array.
-End- Page 39
React.js
1. What is React? Why use it?
ReactJS is a widely-used JavaScript library for building dynamic and interactive user
interfaces, especially for single-page applications. Developed by Facebook, it's known for
its efficient rendering, reusable components, and strong community support.
2. What is the Virtual DOM in React, and how does the diffing algorithm work behind
the scenes?
The Virtual DOM is an in-memory copy of the real DOM, used by React to efficiently
update the UI. When the state changes, React updates the Virtual DOM first, then
compares it with the previous version using the diffing algorithm.
The algorithm:
1. Compares old and new Virtual DOM trees.
2. Identifies differences and updates only the changed parts of the real DOM.
3. What is JSX?
1. ?
1. JSX is a syntax extension for JavaScript that allows
? writing HTML-like code within
JavaScript, making it easier to describe UI components
Props are inputs to components that allow data to be passed from parent to child
components. They are read-only and help in rendering dynamic content.
Props access
passing props
State is a component's internal data storage, allowing it to manage and respond to user
interactions. Unlike props, state is mutable and managed within the component
(Continue...) Page 40
using state
Functional components are stateless and defined as functions, while class components
can hold state and are defined using ES6 classes. With hooks, functional components
can now manage state and side effects.
functional component
(Continue...) Page 41
react hook
useEffect is a hook that allows you to perform side effects in functional components,
such as data fetching or manual DOM manipulations.
The Context API allows for sharing state across components without prop drilling,
making it easier to manage global state.
3. useContext hook to
accessing context data.
Page 42
11. What is prop drilling and how can it be avoided?
Prop drilling refers to passing props through multiple layers of components to reach a
deeply nested component. It can be avoided using the Context API or state management
libraries.
HOCs are functions that take a component and return a new component. They are used
to share common functionality between components without repeating code.
1. ?
High-Order
Component
Usage
using
refs handle
input change
uncontrolled
using and not
state to re-render
handle
input change
Page 43
14. What is React Router? How does it work?
React Router is a library for routing in React applications. It allows navigation between
components without reloading the page.
1. ?
StrictMode is a development mode tool that helps identify potential issues in a React
app, like deprecated APIs or unexpected side effects.
Fragments let you group multiple elements without adding extra nodes to the DOM.
We can use
Fragment or <></> React.Fragment
<> </>
Page 44
19. What is reconciliation in React?
Reconciliation is React's process of comparing the current and previous virtual DOM
trees to determine the minimum number of changes required to update the UI.
Keys are unique identifiers used by React to track and update individual items in lists
efficiently.
ReactDOM.createPortal
Page 45
23. What is the difference between useMemo and useCallback?
Error boundaries are components that catch JavaScript errors in their child
components and display fallback UI instead of crashing the application.
react-error-boundary package
Alternate >
1. ?
usage >>
React.forwardRef is a function that allows you to pass a ref from a parent component to
a child component. This is especially useful when you want the parent component to
directly access a DOM element or a child component's instance.
Page 46
26. What is hydration in React?
Hydration is the process of attaching React's event handlers to the HTML elements
rendered during SSR
useId returns a unique ID string associated with this particular useId call in this
particular component.
The useDeferredValue hook allows us to fix this slow render problem by implementing a
delay before some information is calculated. This works in a very similar way to
debouncing and throttling since our deferred value will only be calculated after the
important state updates have finished running.
Page 47
Defers the searchQuery to avoid
unnecessary re-renders while typing
To detect a click outside a React component, use the useRef hook to reference the
component and add an event listener for mouse clicks. When a click occurs, check if the
event target is outside the referenced component to trigger a specific action.
Page 48
this ref contains will check if
clicked element is not a child of
current container then required
function can be invoked
32. How does useEffect differ from useLayoutEffect, and when should each be used?
Page 49
34. How is the Shadow DOM different from the virtual DOM?
The Shadow DOM provides encapsulation for styles and markup in web components,
isolating them from the global DOM. It's a browser feature used for creating reusable,
self-contained components.
Bundlers in React.js package your code and assets into optimized files for the browser.
They handle dependency management, JSX compilation, and performance
optimizations like minification, tree-shaking, and code splitting. Common bundlers:
Webpack, Vite, and Parcel.
In ReactJS, Cross-Origin Resource Sharing (CORS) refers to the method that allows you
to make requests to the server deployed at a different domain. As a reference, if the
frontend and backend are at two different domains, we need CORS there.
We can setup CORS evironment in frontend using two methods:
axios
fetch
Eliminating the use of inline attributes as they slow the process of loading
Avoiding extra tags by using React fragments
Lazy loading
Minimize and lift the state only when necessary to avoid unnecessary complexity.
Use useMemo/useCallback to memoize event handlers and avoid re-creating
functions.
Analyze and optimize rendering performance using the React Profiler.
Remove unused code with tree shaking using modern bundlers like Webpack.
Page 50
38. What is custom hooks in React?
Custom hooks are normal JavaScript functions whose names start with “use” and
they may call other hooks. We use custom hooks to maintain the DRY concept that is
Don’t Repeat Yourself. It helps us to write a logic once and use it anywhere in the
code.
useFetch is a custom
hooks that can be used
anywhere of our
components
usage
39. What are some strategies for managing application state in large-scale React
applications?
40. Describe the differences between server-side rendering (SSR), client-side rendering
(CSR), and static site generation (SSG) in the context of React.
1. Server-Side Rendering (SSR): HTML is generated on the server for each request,
improving SEO and providing faster initial load times. Next.js is commonly used for
SSR.
2. Client-Side Rendering (CSR): The initial HTML is minimal, with rendering done in
the browser using JavaScript. This allows interactivity but can result in slower
initial loads.
3. Static Site Generation (SSG): HTML is generated at build time and served as static
files, offering fast page loads. Gatsby is a popular tool for SSG in React.
Page 51
React.js Coding Round
Machine Round 10 Coding Solutions Github Repo : Link
1. Todo List Application: Implement adding, editing, deleting, and completing tasks,
testing dynamic state management and UI updates.
2. Counter Application: Involves creating increment, decrement, and reset
functionality and evaluating event handling and state manipulation.
3. Dynamic Form Creation: Tasks include adding/removing fields and implementing
validation, focusing on handling complex and dynamic states.
4. Drag-and-Drop Functionality: Requires reordering items or moving them between
lists, testing event handling, and maintaining consistent states.
5. Paginated Data Display: Fetch data from an API and create pagination controls,
assessing API integration and state management for navigation.
6. Reusable Modal/Popup: Build a modal with open/close functionality and
customizable content to test component reusability.
7. Search and Filter Functionality: Implementing search and filters tests array
manipulation and efficient rendering techniques.
8. Infinite Scrolling: Dynamically load data as the user scrolls, assessing event
handling and API optimization.
9. Debounced Search Input: Delays API calls during search to optimize network
requests and user experience.
10. Folder Structure Implementation: Mimics a file explorer with features like creating,
renaming, and deleting, testing hierarchical data handling and state management.
-End- Page 52
Next.Js
1. What is Next.js, and how does it differ from traditional React applications?
Next.js is a React framework that allows for server-side rendering and static site
generation. Unlike traditional React, it pre-renders pages on the server, resulting in
improved performance and SEO.
2. What is SSR ?
SSR is the process of rendering web pages on the server and sending them to the
client. In Next.js, you should use SSR when you need better SEO, faster initial page
loads, and dynamic content that requires server-side data fetching.
3. What are the different ways to fetch data in Next.js, and when should you use each
method?
1. ?
getServerSideProps: Used when you need to fetch data on every request, such as
user-specific content. It runs on the server for each page load and passes data to the
component.
getStaticProps: Ideal for fetching static content that doesn’t change often (e.g., blog
posts). It runs at build time and allows the page to be pre-rendered with the fetched
data.
getInitialProps: An older method that's still supported but less recommended. It runs
both on the server (on the initial load) and the client (on navigation), but newer
methods like getServerSideProps and getStaticProps are preferred for better
flexibility and performance.
Custom API routes in Next.js enable you to manage backend logic, such as form
submissions or authentication, without requiring a separate server. These routes are
serverless functions that reside in the pages/api directory, allowing you to easily
incorporate server-side processes into your project.
Page 53
5. How can you perform code splitting in Next.js?
Next.js automatically splits your code based on the page structure. that means only
the JavaScript required for the specific page is loaded, improving performance. You
can also manually split code by dynamically importing components when needed.
1. ?
6. How do you implement a custom 404 page in Next.js?
You can create a custom 404 page by simply creating a pages/404.js file. This file will
automatically be used when a user navigates to a non-existent route.
To handle API rate limiting, you can implement custom logic within your API routes
using middleware or packages like express-rate-limit.
For example, you can create an API route with rate limiting to prevent too many
requests from the same IP.
Page 54
8. What are hybrid Next.js applications, and why are they useful?
A hybrid Next.js project combines server-side rendering (SSR) and static site
generation (SSG) on the same page. This is beneficial when certain elements of a page
require dynamic content (SSR) and others can be pre-rendered (SSG).
1. ?
Dynamic routes allow you to create pages with parameters that change based on the
URL. For example, for a page that shows user profiles, you can create a dynamic route
like pages/profile/[id].js, where [id] is a dynamic parameter.
Example
Page Structure
Page 55
11. How can you handle errors in Next.js applications?
Error file
Page Structure
1. 12. What is client-side rendering, and how does? it differ from server-side rendering?
Client-side rendering (CSR) is the process of rendering a web page on the client's
browser using JavaScript after receiving the initial HTML, CSS, and JavaScript from
the server. The key difference between SSR and CSR is that SSR sends a fully
rendered HTML page to the client's browser, while CSR sends an empty HTML page
that is populated by JavaScript.
Next.js provides built-in support for server-side caching through the Cache-Control
header. You can set the cache duration for each page using the getServerSideProps
function or by setting the cacheControl property in the page component.
We can also use caching libraries like Redis or Memcached to cache API responses or
database queries. Options like CDN caching or edge caching can also be implemented
to improve the performance of static assets and reduce the load on the server.
1. ?
Multi-Zones: Deploy multiple Next.js apps as one to keep large projects
organized, allowing different teams to work independently without affecting the
user experience.
Dynamic Imports: Split your code into smaller chunks that load only when
needed, speeding up your app.
Route-Based Splitting: Next.js automatically loads only the necessary code for
the current page, improving performance.
Component-Based Splitting: Load complex components only when required or
after user interaction to reduce the initial load time.
Delay Non-Essential Scripts: Use the Next/script component to control when
third-party scripts load, optimizing performance (before or after interactive).
Caching: Customize caching for dynamic content while Next.js handles static
assets for faster load times.
Incremental Static Regeneration (ISR): Regenerate static content in the
background without rebuilding the whole site, ensuring fresh content without a
heavy build process.
Bundle Analysis: Use the @next/bundle-analyzer to identify large dependencies
and reduce unnecessary imports, improving load speed.
Personalization: Use edge middleware to handle requests closer to users for
faster, personalized experiences.
Micro Frontends: Implement independent app sections using Webpack’s Module
Federation, making development more efficient and scalable.
Page 57
16. Explain the Concept of “Prefetching” in Next.js and How It Impacts Performance
Environment variables are typically stored in a .env.local file. These are important for
securing sensitive information, such as API keys or database credentials, and they allow
you to configure different settings for development, staging, and production
environments.
.env.local
1. ?
.env.production
1. Authentication:
JWT (JSON Web Tokens) or cookies are used to authenticate users.
An API route is created for logging in users. Upon successful login, a JWT is
generated and stored in an HTTP-only cookie to prevent client-side access for
security.
2. Authorization:
After authentication, the user’s role (e.g., admin, user) is checked to determine
access to certain resources.
getServerSideProps is used to verify the token on the server before rendering
protected pages. If the token is valid, the page is served; otherwise, the user is
redirected to the login page.
-End- Page 58
Resume Builder
An ATS (Applicant Tracking System)-friendly resume is important because many
companies now use software to screen resumes before a human even looks at them.
Think of it as a filter that helps employers find the right candidates quickly. If your
resume isn't formatted in a way the ATS can understand, it might not even make it to the
hiring manager’s desk. So, making your resume ATS-friendly increases your chances of
getting noticed in today’s job market. It’s all about making sure the right information is
visible and easy for the system to pick up!
Resume Template (Click on this Link to create your resume for free.)
Here's a guide to optimizing your resume for ATS (Applicant Tracking System) as a
1.
frontend developer, whether you're a fresher or
?
have a few years of experience:
Example:
"Motivated Frontend Developer with 2 years of experience specializing in React and
JavaScript. Passionate about building responsive and accessible user interfaces. Eager to
contribute to innovative projects in a collaborative environment."
Page 59
3. Key Skills (Tailored to the Job Description)
Create a list of the most relevant skills for the role you're applying for. Use a mix of
technical skills and soft skills.
Example:
Frontend Technologies: React.js, HTML5, CSS3, JavaScript
Libraries/Frameworks: Redux, Next.js, jQuery
Version Control: Git, GitHub
Other Tools: Webpack, Babel, Figma (if applicable)
Soft Skills: Problem-solving, Collaboration, Time Management
Example:
Relevant Coursework: Web Development, Algorithms, UI/UX Design
This approach makes your education section more approachable while still showcasing
key information.
Resume Template (Click on this Link to create your resume for free.)
1. ?
Page 61
Job Opportunity :
(Cold Email, Referral, Job Platform and Job Apply)
Cold Emailing:
Proactively reach out to potential employers or industry professionals to
express interest in job opportunities. Craft a concise, personalized email
highlighting your skills and how you can add value to their organization.
This approach can set you apart from other candidates.
Over the past few years, I’ve had the opportunity to intern at some exciting places like
Koo App, Swiggy, and currently ShareChat, where I’ve worked on real-world
applications, contributing to performance improvements and building scalable
systems.
Here’s my resume, and I would be thrilled if you could consider me for [Position/Job
ID/Job Link]. If you believe I could be a good fit, I’d greatly appreciate it if you could
refer me for the role or share any insights on how I can contribute further to
[Company Name].
Page 62
Referrals:
Leverage your professional network to obtain referrals. An employee
referral involves a current staff member recommending you for an open
position, often through an internal referral program. This can increase
your chances of securing an interview.
3. Engage with Their Content: Before requesting a referral, engage with their posts or
articles to build rapport and demonstrate genuine interest.
4. Request the Referral: Once connected and after some interaction, send a polite
message requesting a referral.
Example:
"Hi [Name], I hope you're doing well. I noticed that [Company] has an opening for
[Position], and I believe my background in [Your Field] aligns well with the role. If you
feel comfortable, would you consider referring me? I'd be grateful for your support."
Page 63
Job Platforms:
Utilize online job platforms like LinkedIn, Indeed, and Glassdoor to discover and apply
for job openings. These platforms allow you to search for positions based on your skills
and preferences, and often provide company reviews and salary insights.
Direct Applications:
Networking Events:
Page 64
Interview
( Preparation Tips, Questions, How to explain, Body Language)
Preparation Tips:
By incorporating this tip into your interview preparation, you can present
yourself as a well-prepared and professional candidate.
Page 65
Common Interview Questions and How to Answer Them:
How to Answer: Discuss aspects of the company that align with your
values and career goals, showing you've done your research.
Q4. "Tell me about a time when you faced a challenge at work and how you
handled it."
How to Answer: Use the STAR method (Situation, Task, Action, Result) to
structure your response. Describe a specific challenge, the actions you
took to address it, and the positive results that followed.
Example:
1. Situation: In my previous role, we redesigned the user dashboard for
better engagement.
2. Task: I was tasked with implementing a dynamic data visualization
feature using charts.
3. Action: I chose Chart.js, integrated real-time data via APIs, and made it
responsive.
4. Result: The feature increased user engagement by 30% in the first
month.
Page 66
How to Explain
Use the STAR Method: Structure your responses to behavioral
questions by describing the Situation, Task, Action, and Result. This
method provides clear and concise answers.
Body Language:
1. ?
Make Eye Contact: Engage with the interviewer through appropriate
eye contact, showing attentiveness and interest.
Page 67
THANK YOU
Thank you so much for taking the time to read this e-book.
I truly hope the insights shared have provided you with
valuable guidance and boosted your confidence in your
frontend interview journey.
Email : codewithayaan01@gmail.com
Instagram: @_codewithayaan/
024
/2
3/12
2