No video

ADVANCE REACT Interview Questions [ 2022 ]

  Рет қаралды 17,851

A Software Engineer

A Software Engineer

Күн бұрын

Advance React Interview Questions and Answers
This video contains the common react interview questions that may be asked on your next front-end interview.
Next recommended video to watch - • 40+ MOST COMMONLY Aske... (40+ Front-End Interview Questions)
Timestamps:
0:00 Introduction
0:07 What are React Hooks?
0:48 How to pass data between components?
1:13 What are some limitations of React?
1:42 What is props drilling and how can you avoid it?
2:09 What is the use of dangerouslySetInnerHTML?
2:33 Name a few techniques to optimize React app performance?
3:53 What is reconciliation?
4:16 What are Higher Order Component?
4:40 What is children prop?
4:48 How to pass parameter to an event handler or callback?
5:16 Why do we need to pass a function to setState?
5:43 Outro - Please like and subscribe to help me reach others and support this channel
What are React Hooks?
They let you use state and other React features without converting functional components to a class. Hooks does the same job with less code and with less code means less chances of producing bugs.
* Basic Hooks
* useState
* useEffect
* useContext
* Additional Hooks
* useReducer
* useCallback
* useMemo
* useRef
* useImperativeHandle
* useLayoutEffect
* useDebugValue
What is context?
Context provides a way to pass data through component tree without having to pass props down manually at every level. It is designed to share data that can be considered “global” for a tree of React components.
How to pass data between components?
1. To pass data from parent to child, use props
2. To pass data from child to parent, use callbacks
3. To pass data among siblings AND anywhere else
* use React’s Context API also use state management libraries
What are some limitations of React.
First, JSX can make the coding complex. It will have a steep learning curve for the beginners
Second, React documentation is not user friendly and thorough as it should be.
Third, every React project are unique to engineers as they will rely on numerous r technologies to incorporate in their projects.
What is prop drilling and how can you avoid it?
Prop Drilling is the process by which data is passed from one component to deeply nested components.
A common approach to avoid prop drilling is to use React context and state management libraries.
What is the use of dangerouslySetInnerHTML?
This property is React’s replacement for using innerHTML in the browser.
This property can be used to render raw HTML in a component.
Name a few techniques to optimize React app performance.
First, Use React.Suspense and React.Lazy for Lazy Loading Components
This will only load component when it is needed.
Second, Use React.memo for Component Memoization
React.memo is a higher order component that will render the component and memoizes the result. Before the next render, if the new props are the same, React reuses the memoized result skipping the next rendering
Third, Use React.Fragment to Avoid Adding Extra Nodes to the DOM
React Fragments do not produce any extra elements in the DOM
Fragment’s child components will be rendered without any wrapping DOM node.
This is a cleaner alternative rather than adding divs in the code.
Fourth, Use Reselect / Re-reselect in Redux to Avoid Frequent Re-render
Reselect is a library for building memoized selectors that is commonly used for redux.
Re-reselect is a lightweight wrapper around Reselect to enhance selectors with deeper memoization and cache management.
Last, Use Production Build
Ensure that application is bundled for production before deploying.
What is reconciliation?
When a component's props or state change, React decides whether an actual DOM update is necessary by comparing the newly returned element with the previously rendered one. When they are not equal, React will update the DOM.
What are Higher-Order Components?
A higher-order component (HOC) is an advanced technique in React for reusing component logic. It is a function that takes a component and returns a new component.
What is children prop?
It is a prop that allow us to pass components as data to other components, just like any other prop. Component tree between the component's opening tag and closing tag will be passed to that component as children prop.
How to pass a parameter to an event handler or callback?
You can use an arrow function to wrap around an event handler and pass parameters:
You can also pass arguments to a function which is defined as arrow function
Why do we need to pass a function to setState()?
setState() is an asynchronous operation.
React batches state changes for performance reasons. This means state may not change immediately after setState() is called.
We should not rely on the current state when calling setState() since we can't be sure what that state will be.
The solution is to pass a function to setState(), with the previous state as an argument.

Пікірлер: 25
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
Next recommended video to watch - kzfaq.info/get/bejne/pNaTgal-nrm1hJs.html (40+ Front-End Interview Questions)
@SebastianSastre
@SebastianSastre 2 жыл бұрын
I'm loving the format in which you are delivering the questions answers. I have to pause and replay several times but is precisely how I want it.
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
great to hear! i will create more content like these as they are most requested on this channel. i appreciate you dropping a quick line because it just validates what my viewers want and i get to see what i am doing right. thanks a lot and have s great day!
@jamesjustis6549
@jamesjustis6549 2 жыл бұрын
Thank you. I have an assessment test for a new job and am studying your vids. This is very helpful
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
You are most welcome! Best of luck and hope my current videos will help you ace your interview.
@animeshanandcool
@animeshanandcool 2 жыл бұрын
Please post more videos.Its very Helpful. Thanx
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
i’m currently making another video. hopefully will release next week. stay tuned. thanks Animesh.
@shashankkulkarni993
@shashankkulkarni993 2 жыл бұрын
OK THANK YOU
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
you are welcome! thanks for dropping a comment.
@jiweihe3413
@jiweihe3413 2 жыл бұрын
Thanks! For the question about passing data from child to parent using "callback", does that refer to functions such as setState in useState? Could you give an example?
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
Hi Jiwei! In order to pass data from Child Component to Parent Component, we pass a function (with data as many as necessary) created from Parent Component and pass it to Child Component and this can be a regular function or the useState setter hook. This is first way of doing it and there are couple more ways - i linked a video below if you want to see other ways using store management and React context. Here is an example: codepen.io/angelo_jin/pen/KKXoKgO Here are great videos for you to watch that talks about this as this pattern is not as simple/obvious at first esp when you are just getting started with ReactJS. kzfaq.info/get/bejne/m5h_f7WVr7HSdZs.html - ReactJS: 3 Ways Components Passes Data (In -depth) kzfaq.info/get/bejne/jOB-gc1_0si8oI0.html - 10 React Coding Exercises Please let me know if you have any other questions. Happy to help. Cheers!
@jiweihe3413
@jiweihe3413 2 жыл бұрын
@@ASoftwareEngineer thanks! These videos are super helpful. Your channel is definitely underrated.
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
@@jiweihe3413 thank you! i’ll continue posting helpful video and the rest should follow hopefully 😉
@fullstackdeveloperckay
@fullstackdeveloperckay Жыл бұрын
Good job
@ASoftwareEngineer
@ASoftwareEngineer Жыл бұрын
thank you! 😉🎉🎊
@Ameersoccerdev
@Ameersoccerdev 2 жыл бұрын
Great
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
thank you Ameer! Stay tuned for more cool vids 👍
@Ameersoccerdev
@Ameersoccerdev 2 жыл бұрын
Yeah definitely
@Ameersoccerdev
@Ameersoccerdev 2 жыл бұрын
Air can I contact with you on WhatsApp or Skype etc
@ziadamer7621
@ziadamer7621 2 жыл бұрын
♥️♥️♥️♥️♥️
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
👊
@ziadamer7621
@ziadamer7621 2 жыл бұрын
@@ASoftwareEngineer I actually love this video so much.. Good explanation and good presentation.. Really appreciate ur hard work ♥️
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
@@ziadamer7621 glad to hear that my hard work and effort is appreciated! i do hope that you will find success in your interview and i am confident that this video will help you to get there. good luck and let me know if there is something i can do to help
@goodgamershow6505
@goodgamershow6505 2 жыл бұрын
That's actually not advance react at all, these are some basic. But still a decent video
@ASoftwareEngineer
@ASoftwareEngineer 2 жыл бұрын
thanks for the feedback. what kind of question would you consider as advance? perhaps i can make video of those questions. thanks.
10 React Coding Exercises (CODING INTERVIEW Prep - 2022)
5:38
A Software Engineer
Рет қаралды 35 М.
REAL React Interview Questions - Live Coding
13:03
Peter Elbaum
Рет қаралды 68 М.
CHOCKY MILK.. 🤣 #shorts
00:20
Savage Vlogs
Рет қаралды 26 МЛН
SCHOOLBOY. Последняя часть🤓
00:15
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 9 МЛН
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 33 МЛН
3 Advanced React Interview Questions
12:44
PedroTech
Рет қаралды 20 М.
Difference between SA and TAM
12:52
Cloud With Raj
Рет қаралды 15 М.
React Interview Questions and Answers - Dominate Your Next Interview
45:43
Monsterlessons Academy
Рет қаралды 24 М.
Here is a more challenging react interview exercise
33:24
Web Dev Cody
Рет қаралды 39 М.
6 React Interview Questions You Have to Know
13:10
PedroTech
Рет қаралды 116 М.
10 Tips For FASTER React App
8:21
A Software Engineer
Рет қаралды 30 М.
🔴 React Interview Experience 🔥 (Live Coding 💻) | MUST WATCH
27:32
Redux Interview Questions | Most Asked Interview Questions
10:27
Sofia Goyal
Рет қаралды 17 М.