React Interview Questions | Beginner to Advanced

  Рет қаралды 41,051

PedroTech

PedroTech

Күн бұрын

Пікірлер: 54
@PedroTechnologies
@PedroTechnologies 6 ай бұрын
To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/PedroTech . You’ll also get 20% off an annual premium subscription.
@godofwar8262
@godofwar8262 6 ай бұрын
Bro please start backend series by covering topic like node js for beginners to advanced i had learn front-end from you please start backend
@xyves6327
@xyves6327 6 ай бұрын
1. First question Use the provided input field, display filtered list of items when typing that match typing 3:45 2. Second question 12:40 3. Third question 18:40
@dngathondu
@dngathondu Ай бұрын
For the 3rd question, the following code worked for me ```import { useState } from "react"; export default PhoneNumber = ({ maxLength = 10 }) => { const [input, setInput] = useState(""); const handleInputChange = (e) => { const numbers = e.target.value.replace(/[^0-9]/g, ""); const size = numbers.length; if (size > maxLength) return; if (size > 3 && size 3 && size > 6) { setInput( `(${numbers.slice(0, 3)}) ${numbers.slice(3, 6)} - ${numbers.slice(6)}` ); } else { setInput(numbers); } }; return ( ); };```
@foysalmohammad3278
@foysalmohammad3278 3 ай бұрын
Good video with nice explanation. I think two states are not necessary. You can Just use one useState variable to store onchange value of input element, and then filter like this: const filteredFruits = fruits.filter((fruit) => fruit.toLowerCase().includes(typedFruits.toLowerCase()) ); And render filteredFruits
@medmolay8627
@medmolay8627 2 ай бұрын
yes , i was having the same question
@kooyaw4445
@kooyaw4445 2 ай бұрын
This was my approach too, and it worked perfectly
@williamrinaldi1808
@williamrinaldi1808 5 ай бұрын
Why set state for the search term? You can just set filtered fruits state in handle input function and filter using the event target value.
@maheshshirsat9075
@maheshshirsat9075 19 күн бұрын
Depends on our choice both are ok
@johnddonnet5151
@johnddonnet5151 15 күн бұрын
@@maheshshirsat9075 Event target value is better as it can be easily transalated to other frameworks, which shows that you understand that codebases are not forever.
@akhilkumarsingh5041
@akhilkumarsingh5041 3 ай бұрын
The third Qs can be solve like this as well!! am I correct import React from 'react' import { useState } from 'react' const PhoneNum = () => { const [phone, setphone] = useState(""); const handleInputChange=(e:any)=>{ let value = e.target.value; let numericValue = value.replace(/[^0-9]/g, ""); if (numericValue.length > 3) { numericValue = `(${numericValue.slice(0, 3)})-${numericValue.slice(3)}`; } setphone(numericValue); } return ( PhoneNum ) } export default PhoneNum
@calvinputera2504
@calvinputera2504 6 ай бұрын
thank's for your content about React I learned a lot from your videos.. because of that I was able to get a job as frontend developer now I have been in this career for about 3 years.. you have changed my life.. keep uploading your videos because many people who have been helped because of this.. greetings from Indonesia 👋
@mkum2141
@mkum2141 6 ай бұрын
why do we need to create fruitData state in question 1? Can't we just filter the original fruits array based on the search term state? Eveytime the user types in a new search term the component will rerender and this refilter the data - doesn't seem like we need the additional state for the fruit
@setasan
@setasan 6 ай бұрын
Yeah i thought the same lol
@PranshuSahu-pl7gx
@PranshuSahu-pl7gx 6 ай бұрын
no we cannot do so. state is necessay as whenever there is change in state , new dom will painted in screen.
@mkum2141
@mkum2141 6 ай бұрын
@@PranshuSahu-pl7gx yes, but we only need to change the fruit when the searchTerm changes. When the serchTerm changes, the component will rerender and the the fruits will be filtered using the new search term. If you actually look at the code we aren't doing anything with the fruitData state other than initialising. Try implementing this yourself and youll see you only need the search term state and the fruit state. You can directly filter the fruits array on each render using the search term state.
@naveenbasyal001
@naveenbasyal001 5 ай бұрын
1st and 2nd is pretty nice and easy, which we use on daily basis but the 3rd one is definitely the trickiest one, although we mostly use libraries for this but it's better to understand how things are working, we'll surely gonna forget the logic in future even if we try to do it from scratch .
@juancarlosrodriguez1085
@juancarlosrodriguez1085 3 ай бұрын
Hello Pedro. Your videos are very instructive. I’ve learn a lot with them. I would like to ask you for a video where you implement & explain the search functionality in a MERN scenario with redux toolkit for state. Thanks a million for your hard work.
@lucasrmendonca
@lucasrmendonca Ай бұрын
Hi Pedro, doesnt the native html tag already provide this filtering functionality?
@raviel_0422
@raviel_0422 6 ай бұрын
Hello Pedro. Congratulations on 200k subscribers. You deserved it man, I learned a lot of React from you.
@KatiaZanotti-g1g
@KatiaZanotti-g1g 2 ай бұрын
in the phone input you have to manage the user backspace after the "-" or the ")" now there is an error and the cursor goes back to the end of the input
@ugogalliano1176
@ugogalliano1176 6 ай бұрын
Where is the github repo ?
@godofwar8262
@godofwar8262 6 ай бұрын
Bro please start backend series by covering topic like node js for beginners to advanced i had learn front-end from you please start backend
@regilearn2138
@regilearn2138 6 ай бұрын
With typescript it would be better
@godofwar8262
@godofwar8262 6 ай бұрын
@@regilearn2138 yeah it will be cherry on the top also if he make a video on typescript before this Crouse just a crash course would be great
@Herxh428
@Herxh428 5 ай бұрын
Just learn by yourself
@regilearn2138
@regilearn2138 6 ай бұрын
with this search question can you do a video on how to do client side search/filtering and server side search in react.
@deadb1t
@deadb1t 6 ай бұрын
Thx for sharing this knowledge with us Pedro!
@fabricator.cap.hill.seattle
@fabricator.cap.hill.seattle 5 ай бұрын
Great variety! 2 and 3 are on my to do list.
@adududuke3995
@adududuke3995 Ай бұрын
Nice content. What is the music playing after the intro ?
@xisidorix
@xisidorix 6 ай бұрын
Great video for interview confidence. I owe you!
@GigaSquidward.
@GigaSquidward. 6 ай бұрын
This video is a very useful for me now. Thanks a lot )
@ihebbenaicha1353
@ihebbenaicha1353 6 ай бұрын
where is the github repo bro ?
@samialvi4226
@samialvi4226 5 ай бұрын
Please make a series on it!!!!
@powercircuitacademy
@powercircuitacademy 6 ай бұрын
Congratulations🎉 200k
@8888-t4d
@8888-t4d 6 ай бұрын
Hi my brother, l have problem about react can you explain how can l make twitter setting page pc and mobile responsivibility?
@soumyajitmandal3503
@soumyajitmandal3503 6 ай бұрын
Please make a microservice project using Mern
@Misica11000
@Misica11000 6 ай бұрын
Second task is much more complicated with that useeffect shit,why,just why programing couldnt be simplier?...These are examples why people quit programing.....😢😢😢😢
@Javed_Khan_.
@Javed_Khan_. 2 ай бұрын
🥲
@Shoxie34
@Shoxie34 6 ай бұрын
Nice video, how old are you Pedro?
@g-g-9
@g-g-9 Ай бұрын
Great coding by using just 1 eye
@wanjeeric4885
@wanjeeric4885 6 ай бұрын
this is cool bro
@Bruno_Corso
@Bruno_Corso 6 ай бұрын
Are you brazilian? Ótimo conteduo
@PedroTechnologies
@PedroTechnologies 6 ай бұрын
Sou, vlww mano!!
@gawolimgexige
@gawolimgexige 6 ай бұрын
Congress 200k
@PedroTechnologies
@PedroTechnologies 6 ай бұрын
Thank you!!!!
@viveksah2069
@viveksah2069 3 ай бұрын
This is pathetic it’s showings you don’t have the basic understanding of react it can be done only one function by useing useMemo with filter why do you need so many use effects and const
@PedroTechnologies
@PedroTechnologies 3 ай бұрын
loll i have 6 years of react job experience, ofc i don't have a basic understanding of it...
@viveksah2069
@viveksah2069 2 ай бұрын
@@PedroTechnologies then you have bad experience need to educate yourself
@faustozambrano4901
@faustozambrano4901 4 ай бұрын
3 minutes just for vanter....Nice
6 React Interview Questions You Have to Know
13:10
PedroTech
Рет қаралды 120 М.
كم بصير عمركم عام ٢٠٢٥😍 #shorts #hasanandnour
00:27
hasan and nour shorts
Рет қаралды 10 МЛН
What type of pedestrian are you?😄 #tiktok #elsarca
00:28
Elsa Arca
Рет қаралды 33 МЛН
The React Interview Questions You need to Know
21:29
CoderOne
Рет қаралды 45 М.
React Like a Pro: React Best Practices
9:55
PedroTech
Рет қаралды 14 М.
Coding Interview with Dan Abramov
58:20
Ben Awad
Рет қаралды 645 М.
10 JavaScript Interview Questions You HAVE TO KNOW
13:41
James Q Quick
Рет қаралды 71 М.
Mid-level React Interview
46:08
Justin Lawrence
Рет қаралды 69 М.
How I Passed The Google Coding Interviews
18:50
Chris Jereza
Рет қаралды 68 М.
Solving a practical intermediate react interview challenge
13:28
Web Dev Cody
Рет қаралды 99 М.
Beginner React.js Coding Interview (ft. Clément Mihailescu)
36:31
Ben Awad
Рет қаралды 2,2 МЛН
I FAILED 30+ Coding Interviews Until I Learned THIS
9:16
Ashish Pratap Singh
Рет қаралды 43 М.
كم بصير عمركم عام ٢٠٢٥😍 #shorts #hasanandnour
00:27
hasan and nour shorts
Рет қаралды 10 МЛН