React Interview Questions | Beginner to Advanced

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 54

  • @PedroTechnologies
    @PedroTechnologies  6 หลายเดือนก่อน +1

    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 หลายเดือนก่อน +1

      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 หลายเดือนก่อน +11

    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

  • @foysalmohammad3278
    @foysalmohammad3278 3 หลายเดือนก่อน +10

    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 หลายเดือนก่อน +14

    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 17 วันที่ผ่านมา

      Depends on our choice both are ok

    • @johnddonnet5151
      @johnddonnet5151 12 วันที่ผ่านมา

      @@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 หลายเดือนก่อน +5

    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

  • @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 (

    );
    };```

  • @calvinputera2504
    @calvinputera2504 6 หลายเดือนก่อน +1

    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 👋

  • @naveenbasyal001
    @naveenbasyal001 5 หลายเดือนก่อน +2

    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 .

  • @mkum2141
    @mkum2141 6 หลายเดือนก่อน +8

    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 หลายเดือนก่อน +2

      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 หลายเดือนก่อน +2

      @@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.

  • @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.

  • @raviel_0422
    @raviel_0422 6 หลายเดือนก่อน +1

    Hello Pedro. Congratulations on 200k subscribers. You deserved it man, I learned a lot of React from you.

  • @lucasrmendonca
    @lucasrmendonca หลายเดือนก่อน

    Hi Pedro, doesnt the native html tag already provide this filtering functionality?

  • @godofwar8262
    @godofwar8262 6 หลายเดือนก่อน +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 หลายเดือนก่อน +1

      With typescript it would be better

    • @godofwar8262
      @godofwar8262 6 หลายเดือนก่อน +1

      @@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

  • @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

  • @adududuke3995
    @adududuke3995 หลายเดือนก่อน

    Nice content. What is the music playing after the intro ?

  • @ugogalliano1176
    @ugogalliano1176 6 หลายเดือนก่อน +9

    Where is the github repo ?

  • @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.

  • @samialvi4226
    @samialvi4226 5 หลายเดือนก่อน

    Please make a series on it!!!!

  • @deadb1t
    @deadb1t 6 หลายเดือนก่อน +1

    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.

  • @GigaSquidward.
    @GigaSquidward. 6 หลายเดือนก่อน

    This video is a very useful for me now. Thanks a lot )

  • @powercircuitacademy
    @powercircuitacademy 6 หลายเดือนก่อน +1

    Congratulations🎉 200k

  • @xisidorix
    @xisidorix 6 หลายเดือนก่อน

    Great video for interview confidence. I owe you!

  • @ihebbenaicha1353
    @ihebbenaicha1353 6 หลายเดือนก่อน +4

    where is the github repo bro ?

  • @soumyajitmandal3503
    @soumyajitmandal3503 6 หลายเดือนก่อน

    Please make a microservice project using Mern

  • @g-g-9
    @g-g-9 หลายเดือนก่อน

    Great coding by using just 1 eye

  • @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?

  • @Shoxie34
    @Shoxie34 6 หลายเดือนก่อน

    Nice video, how old are you Pedro?

  • @Misica11000
    @Misica11000 6 หลายเดือนก่อน +2

    Second task is much more complicated with that useeffect shit,why,just why programing couldnt be simplier?...These are examples why people quit programing.....😢😢😢😢

  • @wanjeeric4885
    @wanjeeric4885 6 หลายเดือนก่อน

    this is cool bro

  • @Bruno_Corso
    @Bruno_Corso 6 หลายเดือนก่อน +1

    Are you brazilian? Ótimo conteduo

  • @gawolimgexige
    @gawolimgexige 6 หลายเดือนก่อน +1

    Congress 200k

  • @viveksah2069
    @viveksah2069 3 หลายเดือนก่อน +1

    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