REAL React Interview Questions

2021 ж. 10 Мам.
176 502 Рет қаралды

Ever wondered what you'll be asked in front-end engineer/React interviews?!
This video is to give an idea of what you questions could reasonably expect from a React developer hiring process.
Many of these questions are approximations of what I think you could expect as an entry-level software engineer, or the types of things I would ask if I were coming up with topics from scratch. They all offer opportunities to show off your knowledge, even if they seem basic on the surface.
Let me know if you find them helpful!
Links:
One-on-one interview mentoring: superpeer.com/peterelbaum
My interviewing course - Ace the Front End Interview: gum.co/KlowV
Kent C. Dodds blogpost: kentcdodds.com/blog/use-terna...
--
Follow Me Online Here:
🌏 My website/blog - peterelbaum.com
✉️ My newsletter (weekly on Sundays) - peterelbaum.com/subscribe/
🗣 One-on-one mentoring - superpeer.com/peterelbaum
🤓 My courses: peterelbaum.gumroad.com/
🐦 Twitter: / peterelbaum
💻 GitHub: github.com/elbaumpj
☎️ Office Hours: calendly.com/elbaumpj/saturda...
--
My gear:
Main Camera: amzn.to/2Tv1WBe
Tripod: amzn.to/2t570AH
External HD: amzn.to/2t1UphI
Memory card: amzn.to/2UEQfIn
Computer mic: amzn.to/2t7mUue
--
Who am I?
I'm Peter Elbaum, a software engineer living in Raleigh, North Carolina. I make videos about code, software engineering career development, and self improvement. I also have a newsletter (peterelbaum.com/subscribe) and tweet my thoughts on money, work, and being a great dev. Feel free to get in touch!

Пікірлер
  • Are these questions helpful to you? What React questions have you encountered in your interviews? Let me know!

    @PeterElbaum@PeterElbaum3 жыл бұрын
    • How React works with the DOM is a good one i've seen before. A good example is using useState with a text input.

      @kingivan1151@kingivan11512 жыл бұрын
    • Could you make 40 more of these exact videos? Perfect to prepare for interviews

      @chrisdietrich1533@chrisdietrich15332 жыл бұрын
    • super helpful

      @dancewithzinnia@dancewithzinnia2 жыл бұрын
    • I always hated questions like the 4th back in the days. Kinda falsely phrased, sometimes even on purpose to see the response. Good that I'm already wise and old but maybe just old by now. :)

      @oliverk3190@oliverk31902 жыл бұрын
    • In most of the React Interview videos that I watched on youtube, all questions are about React or at least related to React, I applied for a React position, in tests, I have been asked to solve 2 JavaScript problems which were Ok and I passed that tests, then I have been informed that I will have a 20 minutes technical interview on real problems for react and after a week later, I attended to technical interview for React Dev position and the following questions asked : Question #1: Think you are a Full Stack Developer and your project takes data from another API supplier and you do not have control over it, the API brings data about Weather forecasts and current temperature but API takes 6 seconds to bring data, How can you solve this problem for better user experience on showing current temperature? Question #2: You have an application that generates a PDF report for the user, the user selects some filters and according to filters your application creates a PDF report for the user. Whatever the selected filters are, the app generates a report in 10 minutes and there is no way to decrease this duration. In this case, what kind of solution you can present for the best user experience. And if the user closes the page after request, what kind of process you would apply? Question #3: Interviewer explained about Technical Debt and then asked, you have code that has been written without considering best practices and readability of the code, in which cases you chose to leave this code like (without refactoring). Give some cases that you may need to deliver code without refactoring for best readability. On the other hand, let's say, you have enough time to refactor the code but your manager told you to leave it like that what you would do? For which type of companies technical debt is more important Enterprises or Startups? I couldn't find any React relation on these questions? I Tried to give answers on Frontend and React Basis especially for the first question, interviewer stopped me and told me that I am not asking on React basis, you must assume that you are a Full Stack Developer. In the end, I understood that for a React Dev position, apart from the questions on React Interview Videos, there is the possibility to encounter any kind of question, in my next interview, I am expecting a question about pancake recipe in detail or how to prepare and cook cookies. I have to say, up to now, I tried to attend many interviews and all was about React Position and only in one of them I have been asked about React, they have asked mostly on class-based components and at that time because I focused on Hooks, I couldn't answer. After that interview, in none of React dev position interviews, I have gotten a single question about React, they mostly asked about JavaScript, tested on JavaScript, and in my last interview, I got the above 3 questions. AND I WILL BE HAPPY IF SOMEBODY TALKS ABOUT WHAT SHOULD BE THE EXACT ANSWERS TO THE ABOVE QUESTIONS...

      @aytacg26@aytacg262 жыл бұрын
  • Could you make 40 more of these exact videos? Perfect to prepare for interviews

    @chrisdietrich1533@chrisdietrich15332 жыл бұрын
    • Glad to hear it! I can definitely work on a few more :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • Hi sir, please tell me, how to get a job in Australia for the position of react developer, i am a fresher from India

      @vaibhaviupreti5609@vaibhaviupreti5609 Жыл бұрын
    • @@vaibhaviupreti5609 bro did you done it?

      @Telugucoder1@Telugucoder14 ай бұрын
  • 1.What is JSX? => syn. sugar of createElement 2.what class named as classname in react? => class is reserved in JS 3. Describe DataFlow in the React? => Unidirectional 4.How would you delay API Call untill component is mounted? => useEffect Hook 5. Should you use ternary or && operator to conditionally render React components? use ternary operator (&& have falsy thing)

    @tempgrey9862@tempgrey98622 жыл бұрын
    • ty

      @ashoksoni8931@ashoksoni89312 жыл бұрын
    • could you please show an example for the 5th question? thank!

      @michal3833@michal38332 жыл бұрын
    • @@michal3833 GOOD: {!something ? null : ......... } BAD: {something && ......... }

      @denistsaplind357@denistsaplind3572 жыл бұрын
    • Hey temp grey, could you please share more questions that you have encountered in all your interviews?

      @purnimabaranwal@purnimabaranwal2 жыл бұрын
    • 1,2,5 - these three questions will go to my list of the most stupid recruitment questions Do you ask the animal handler during the job interview what is the average length of an elephant's trunk? Or do you ask him how he would behave in the event of an elephant attack? When are we going to finish asking during job interviews about interesting facts not related to the real work of a programmer?

      @4funszejk442@4funszejk4422 жыл бұрын
  • Thank you so much! I was watching your video before my interview and I actually got asked the jsx question. I kinda knew it already, but, having researched it more thoroughly after this video, I was even more confident answering it. Really appreciate your help!

    @y-yyy@y-yyy Жыл бұрын
  • This video was super helpful I never thought about whether or not the ternary or && operator would be better, since I usually use ternary but your response was definitely a huge plus to know

    @berniezhong@berniezhong Жыл бұрын
  • Was saving this for when I became ~technical~. Awesome stuff, Peter 👏

    @HenryBelcaster@HenryBelcaster2 жыл бұрын
    • Thanks brother! Let me know if I can be helpful as you're learning

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • One of the best. And yes these are the questions that are asked mostly especially Use Effect

    @kashmirtechtv2948@kashmirtechtv2948 Жыл бұрын
  • Great questions, and I like how to you explain the area where to shine. I would encourage to please create more React or Angular questions like these. Amazing, thanks a lot.

    @ankitalath3681@ankitalath368111 ай бұрын
  • Thanks so much for all these basic looking yet tricky questions

    @srinivasnahak3473@srinivasnahak34736 ай бұрын
  • This was really eye opening. Keep up the great content!

    @karthikeyans2825@karthikeyans28252 жыл бұрын
    • Thank you! Will do!

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • Hello sir. I am just starting my career and am preparing for my first interview as a mern stack developer. I came across your interview playlist.... And it seems just made for me.. thank you sir.. and yeah.. you won a subscriber 😅

    @m.k.mubarak7479@m.k.mubarak7479Ай бұрын
  • Thanks for a great video! I was putting it on pause, thinking about the way I’d answer and the resuming the video. The question about the ternary operator and && I wound answer in the following way: “You should consider the reasons why you are about to use conditional rendering. If the reason is that assuming a particular condition is met you display a component, if not, nothing is displayed instead, use && operator (and handle it with care 😌). If you are considering displaying either one component OR the other, use ternary operator. The caveat in here: keep in mind react reconciliation algorithm. If components are of different type, React will unmount the whole component’s tree and the state (which you potentially need) will be lost. Plus it’s always more costly operation then just changing an attribute. So consider further examining the case, maybe you just need to change some attributes instead in the same component.”

    @ekaterinalukyanets3475@ekaterinalukyanets34752 жыл бұрын
    • Thanks for your comment! I like your distinction with the use cases. I probably could have provided a bit more nuance in my explanation. Thanks for watching!

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • Thank you, that was a great, concise video!

    @Srishti9015@Srishti90156 ай бұрын
  • Very helpful. Thank you! I appreciate if you talk about common mistakes programmers make when using react just like the && operator you mentioned in this video.

    @birukamare2073@birukamare2073 Жыл бұрын
    • You're very welcome!

      @PeterElbaum@PeterElbaum Жыл бұрын
  • Regarding point #5: that's why we need to use double inversion in such cases, which casts the value into boolean: !!items.length && ...

    @VolodymyrDovbenko@VolodymyrDovbenko Жыл бұрын
  • Great set of questions thank you

    @harshithvenkatesh2053@harshithvenkatesh20532 жыл бұрын
    • You're very welcome! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • You can also Cast the length to a Boolean before using the && operator to fix the issue of a zero being rendered

    @viktorricchiuto7599@viktorricchiuto75992 жыл бұрын
    • Good call! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • Great vid, Peter!

    @firetrainer@firetrainer3 жыл бұрын
    • Thanks mate! Hope you found it helpful :)

      @PeterElbaum@PeterElbaum3 жыл бұрын
  • Great content, Peter!

    @alekseivlasov8505@alekseivlasov8505 Жыл бұрын
    • Thank you! :)

      @PeterElbaum@PeterElbaum Жыл бұрын
  • Great video, and great advice! I have an interview myself today and this was great. The ternary operator question was a bit misleading: when using rhe && operator to conditionally render some element, you can simply cast arr.length to a boolean using !!arr.length && ..., this will be a very simple way to still use the && operator

    @sirlasagna50@sirlasagna508 ай бұрын
    • or just use a ternary. I don't belie the question is misleading.

      @adeleke5140@adeleke51406 ай бұрын
    • @@adeleke5140 && is more readable I reckon?

      @RW-he5fu@RW-he5fu3 ай бұрын
  • very nice questions, bawss

    @luisbarbosa5597@luisbarbosa55972 ай бұрын
  • Thanks, great video. What's are some of the shibboleths of an amateur with react?

    @wudao88@wudao88 Жыл бұрын
  • React is how you want to respond and control the screen or code outputs. Just process management controls. Three things. Get put react respond pm.

    @venkybabu8140@venkybabu8140 Жыл бұрын
  • Thanks for this. Most of the stuff I know already but the answers aren’t immediately obvious in relation to the question, so everytime you say the answers, I was like “ohhh so that’s what you mean”.

    @dlysele@dlysele2 жыл бұрын
    • Glad it was helpful! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • Didn't know about this ternary and &&, now I know. Thanks Peter.

    @danielkamau8436@danielkamau8436 Жыл бұрын
    • Glad to help!

      @PeterElbaum@PeterElbaum Жыл бұрын
  • I don't use zero as false in js. Even though I used to do it a lot in C++. Is there any other reason not to use & for rendering in react?

    @adirmugrabi@adirmugrabi3 ай бұрын
  • Thank you.

    @AlvaroFernandoMS@AlvaroFernandoMS Жыл бұрын
  • In most of the React Interview videos that I watched on youtube, all questions are about React or at least related to React, I applied for a React position, in tests, I have been asked to solve 2 JavaScript problems which were Ok and I passed that tests, then I have been informed that I will have a 20 minutes technical interview on real problems for react and after a week later, I attended to technical interview for React Dev position and the following questions asked : Question #1: Think you are a Full Stack Developer and your project takes data from another API supplier and you do not have control over it, the API brings data about Weather forecasts and current temperature but API takes 6 seconds to bring data, How can you solve this problem for better user experience on showing current temperature? Question #2: You have an application that generates a PDF report for the user, the user selects some filters and according to filters your application creates a PDF report for the user. Whatever the selected filters are, the app generates a report in 10 minutes and there is no way to decrease this duration. In this case, what kind of solution you can present for the best user experience. And if the user closes the page after request, what kind of process you would apply? Question #3: Interviewer explained about Technical Debt and then asked, you have code that has been written without considering best practices and readability of the code, in which cases you chose to leave this code like (without refactoring). Give some cases that you may need to deliver code without refactoring for best readability. On the other hand, let's say, you have enough time to refactor the code but your manager told you to leave it like that what you would do? For which type of companies technical debt is more important Enterprises or Startups? I couldn't find any React relation on these questions? I Tried to give answers on Frontend and React Basis especially for the first question, interviewer stopped me and told me that I am not asking on React basis, you must assume that you are a Full Stack Developer. In the end, I understood that for a React Dev position, apart from the questions on React Interview Videos, there is the possibility to encounter any kind of question, in my next interview, I am expecting a question about pancake recipe in detail or how to prepare and cook cookies. I have to say, up to now, I tried to attend many interviews and all was about React Position and only in one of them I have been asked about React, they have asked mostly on class-based components and at that time because I focused on Hooks, I couldn't answer. After that interview, in none of React dev position interviews, I have gotten a single question about React, they mostly asked about JavaScript, tested on JavaScript, and in my last interview, I got the above 3 questions. AND I WILL BE HAPPY IF SOMEBODY TALKS ABOUT WHAT SHOULD BE THE EXACT ANSWERS TO THE ABOVE QUESTIONS...

    @aytacg26@aytacg262 жыл бұрын
    • Totally hear you - it can be hard to predict the _exact_ questions that will be in an interview. I think the best strategy is to have solid fundamentals, and if there's a nitpicky question then so be it. Hope that helps!

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • @@PeterElbaum thank you very much 🙂

      @aytacg26@aytacg262 жыл бұрын
    • To Answer question 1: For the best user experience I'd simply play an animation for the duration it'll take the api to deliver the data for entertainment For the second question: After the user finishes all the filter, I'd simply create a program that emails the report directly to the user in 10mins. So they don't have to wait on the application for the report to be processed For the third question, I'd inform the interviewer that I ensure I write clean code for readability, and I ensure that i adopt all the best practices. I'll convince the manager if he says I should not clean the code, and inform him if the huge disadvantageous factors that could happen in the future due to leaving the code uncleaned. I believe startups have more importance to technical debts

      @steevgr3y71@steevgr3y712 жыл бұрын
    • @@steevgr3y71 for the first one, animation has not been accepted, they were expecting something caching old data, may be, fetching every 10min and catch data on server. I am not sure, but they did not accept animation etc. For second one, I gave the similar answer but interviewer was not happy about that, but I believe it is the best approach. For third one, I couldn't give exact answer 😊 and as a result they rejected me

      @aytacg26@aytacg262 жыл бұрын
    • @@aytacg26 Of course they won't accept animation, and only caching it is also not the full answer. The best way is to load the animation for the fist time for the data to be fetched and store it and keep updating it every interval you want(greater or equal to 6s). The next time the user opens the application, you fetch the cache value and update it by making a new request (no animation this time)

      @ahurein1641@ahurein16412 жыл бұрын
  • 6:30 short circuit evaluation ( not evaluation the right side of the && operation if the left side if falsy) has nothing to do with rendering 0. 0 gets rendered because React would only skip rendering nullish and boolean values.. and 0 is neither nullish nor boolean

    @SirSidi@SirSidi2 жыл бұрын
    • 0 is not boolean but it's "falsy", so in logical && operations it counts as a boolean false and will short circuit. The behavior you are describing is provided by the nullish coalescing operator (??)

      @abird35@abird352 жыл бұрын
  • In my opinion, ternary makes code too long (sometimes we use null for the second condition) but it is easier to render component with a && operator

    @jocelynnsa9316@jocelynnsa9316 Жыл бұрын
    • u can avoid 0 by adding !!array.length && rendersomething

      @imkir4n@imkir4n Жыл бұрын
    • @@imkir4n Great point!

      @TommyPiano.@TommyPiano. Жыл бұрын
    • @@TommyPiano. thanks

      @imkir4n@imkir4n Жыл бұрын
  • technically in react you can pass the reference to a function down as props to a child, and run that function from the child... so in a way you can pass data from the child to the parent using this... but ull most likely doing it using global state a k a context

    @OS-Advertisingg@OS-Advertisingg15 күн бұрын
  • Amazing thanks a lot!!

    @deepak8586@deepak85862 жыл бұрын
    • Glad you liked it! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • what if I the condition is not about the length but it is undefined? ternary is long for that logical condition.

    @halopinx3398@halopinx3398 Жыл бұрын
  • really good one!

    @dancewithzinnia@dancewithzinnia2 жыл бұрын
    • Thank you! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • The className thing has nothing to do with the class being reserved syntax as it's working just fine in Preact.

    @phead2137@phead213710 ай бұрын
  • Best of till now. 👍

    @niketanjha@niketanjha2 жыл бұрын
    • Thanks! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • Regarding the use of `&&` : This is an incomplete statement being compared with a ternary operator. To mimic ternary operators, always specify an `||` clause as well, so the expression always has something truthy to evaluate to in case the left-hand operand is false. So in the case of the Ken Dodds article, it would have worked just fine if he'd written `!!contacts.length && something || somethingElse`. I've used this code pattern in tons of production code with zero issues. (Also, note the use of `!!` to force an operand to a boolean value)

    @LuveenWadhwani@LuveenWadhwani2 жыл бұрын
    • does the double bang change anything? the value is converted to a boolean either way

      @michastruck2584@michastruck2584 Жыл бұрын
    • @@michastruck2584 No it isn't - the value gets interpreted as truthy or falsy, not boolean. Double bang coerces the value under consideration to a boolean so we are guaranteed to be working with a single type (boolean), and not the potentially unbounded type of our test expression without the double bang.

      @LuveenWadhwani@LuveenWadhwani Жыл бұрын
    • @@LuveenWadhwani how does the double bang determine the boolean? in the same way doesn’t it?

      @michastruck2584@michastruck2584 Жыл бұрын
  • What is virtual dom and how does it work ?

    @randompointlessness2766@randompointlessness27662 жыл бұрын
  • Instead of && we could use the nullish coellescing operator, ?? , to bypass the situation

    @johnmathew8543@johnmathew85432 жыл бұрын
  • I still rarely use ternary to conditionally render. That's because I just use a boolean. Don't throw out readability for no reason.

    @kr30000@kr300006 ай бұрын
  • On the question regarding ternary vs && operator, I could see how that could happen, however if he used an expression like "array.length > 0 && ..." would that not fix the issue? I think there are situations where && is more readable and more concise to write and maintain.

    @down__lo7359@down__lo73592 жыл бұрын
    • Correct, depends on the context of how you use them :)

      @BarryMichaelDoyle@BarryMichaelDoyle2 жыл бұрын
    • You could also just do (array && ...) since a defined array will always be truthy even if it's empty (the same is not true for empty strings though)

      @abird35@abird352 жыл бұрын
    • && is used when we want to display error messages and loading indicator

      @balddog470@balddog470 Жыл бұрын
  • Dang I would ace that lol. That’s like the simplest stuff you can know. But I’ve been working with react alone while in college for two years and I also just read a react 17 book that explained a lot of in depth concepts so maybe I’ve just finally reached a point passed beginner 😂

    @sethheinzman5823@sethheinzman58232 жыл бұрын
    • Nice! Like I said, there are varying levels of depth to each question. Glad you're feeling confident! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • Alright tough guy

      @keifer7813@keifer7813 Жыл бұрын
  • 🙏🏻✨

    @ayabc4320@ayabc43202 жыл бұрын
  • I am working like a JS dev (react) for a long time. I was lost while during interview the CTO asked me what is "Hoisting". I stucked. After 5 secs of my cilence he asked me "whats the difference with let and var definition?" I understood the previous question. So: during interview, a lot of companies use "smart definitions" you like to know. This is nothing related to the coding.

    @chil178@chil178 Жыл бұрын
    • Can you elaborate on this?

      @edcoronado@edcoronado Жыл бұрын
    • @@edcoronado hoisting is like function vs arrow function. If you define a function in the bottom on your js file, you can still use it at the start since the function get hoisted up. but you can't do the same thing with arrow function. It's the same thing as Var vs let /const. Var has this weird variable hoisting, so you can define a variable in the bottom of the lexical scope, but use it above the definition.

      @maharta8458@maharta8458 Жыл бұрын
  • The last question is interesting. Because I have only use ternary operators when rendering component's, if possible. I think, I'm gonna fail from the first question alone. I either would say Jsx is a file you usually use to create components or Jsx is like a javascript but you can also put your html codes there... These are good questions that I should learn about.

    @asagiai4965@asagiai4965 Жыл бұрын
  • Using && operator with prefixing the left hand condition with !! (double bangs) should eliminate the wrong rendering problem.

    @abhisheksharma9796@abhisheksharma97962 жыл бұрын
    • Yep - good call! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • Thanks bro I found it useful👌👌👌👌👌👌👌👌

    @uzbekdev4980@uzbekdev4980 Жыл бұрын
    • Glad to hear that :)

      @PeterElbaum@PeterElbaum Жыл бұрын
  • Thank you for the video, first of all, but I noticed that your video is "choppy" and has chunks removed. IDK if that it something that your recording software does to remove the pieces of "silence" of N milliseconds or if it is done intentionally in your post-processing software but it actually really messes up with the watcher's brain and after several minutes of watching it becomes very very annoying. Kind of reminds of those fast-flashing Insta-tiktok videos. Just FYI

    @fr33s7yl0r@fr33s7yl0r27 күн бұрын
  • class classname decision is purely based on react-core team's choice, & nothing else. They knewnthat class can serve multiple meanings based on the contexts, which they dont wanted to get in.

    @sandrinjoy@sandrinjoy8 ай бұрын
  • does something automatically correct the whole class vs className cuz I often copy paste components from css frameworks and yes it yells at me but the code always runs

    @sbarter@sbarter2 жыл бұрын
    • Hmm. Not sure, it may have to do with your settings, but typically with CRA (create-react-app), I'd expect class/className to throw an error

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • Yup. It yells but it runs for me too

      @wise5674@wise56742 жыл бұрын
  • Why we have to check the length of the list? {List && List.map(()=>some JSX)} should work without bug. Am I right?

    @xiupingwu3952@xiupingwu39522 жыл бұрын
    • It depends a little bit on what `List` is. It could be an empty array, in which case nothing would render and you would avoid this bug, but you would be mapping the array for no reason. You don't have to check for length, it's just a common pattern because it doesn't really make sense to try and render components or elements out of an empty array. Hope that helps! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • @@PeterElbaum In my case, if the List is empty, will && logic execute the second expression? In my point of view, it would just stop at the first express. [] == false, then the expression is evaluated as false, the second expression will not execute. Nothing get rendered.

      @xiupingwu3952@xiupingwu39522 жыл бұрын
    • @@xiupingwu3952 you might check the length of the list to generate some header text or a button. For example the dropdown button of this comment section that says "3 Replies". Though I think it's stupid to use {List.length && ...} instead of {List.length > 0 && ...} in the first place.

      @HaloDude557@HaloDude557 Жыл бұрын
  • So why do we not need to use className in svelte

    @letsgetto1millwithoutvids@letsgetto1millwithoutvids Жыл бұрын
  • I usually use !!arr.length && .... instead of ternary condition.

    @hash2020@hash20202 жыл бұрын
    • That could work too - love the double bang

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • Good job, your explanations are great!

    @Alvaro_Mejia_Kali_Epitixia@Alvaro_Mejia_Kali_Epitixia11 ай бұрын
    • Glad you like them!

      @PeterElbaum@PeterElbaum11 ай бұрын
  • Hey Peter, if you're just speaking to the camera, why not consider adding all your content to a podcast too? There's definitely space for good react content within the podcast realm.

    @lukeparker6026@lukeparker60262 жыл бұрын
    • You know, that's a great point but not something I had considered before. Thanks for the suggestion!

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • when can you show the second part?

    @jaifranhernandez3901@jaifranhernandez39012 жыл бұрын
    • Not quite sure what you mean, but I do plan to release more interviewing videos in the next couple weeks :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • If the length is 0, isn't that desired behavior to not evaluate the right side since the array is empty?

    @snake1625b@snake1625b2 жыл бұрын
    • Maybe, but the point is you don't want a 0 to render to the screen

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • I never understood the "class is a reserved keyword in JS, so you can't use it in JSX" argument. Because if JSX is a syntactic sugar over `React.createElement`, then shouldn't the compiler just change the `class` to `className`? Great video, btw

    @pawekoaczynski4505@pawekoaczynski45052 жыл бұрын
    • I think this is a good question! In my view the answer has two parts: 1. React.createElement was designed to mimic the DOM API, which uses `className`: developer.mozilla.org/en-US/docs/Web/API/Element/className 2. The `class` keyword can be used elsewhere in React, for example when you're creating a class component. It might read a bit strange to have class in both places but doing different things. Glad you found the video helpful!

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • It ain't gonna differ if it's js class or a css class.

      @sidharth5665@sidharth56652 жыл бұрын
    • Actually you can use class instead of className and compiler would only throw a warning and not an error.

      @pooyaestakhry@pooyaestakhry2 жыл бұрын
    • I asked Dan Abramov this question in a twitter AMA. Here's his response: "it’s because you can’t use it as an argument, like function Button({ class }) or let class = ... so you have to rename it at usage anyway, which is annoying to explain. arguably taking class as a prop is not a great api but it’s a very common thing people do"

      @ChrisMinnickMWS@ChrisMinnickMWS Жыл бұрын
  • 2:25 mmmmmm. Solid's JSX just uses 'class' instead of 'className' so it's not inherent to js to error on 'class'.

    @bigmistqke@bigmistqke Жыл бұрын
  • Most Asked Tuff Questions on React for 4+years experienced, you can watch part1 on channel - 'Codetailed' Let see how many questions you can solve...

    @someshgupta5324@someshgupta53242 жыл бұрын
  • amazing

    @michaelmontero2902@michaelmontero29022 жыл бұрын
    • Thank you! Cheers :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • i am watching this few hours to my interview, i hope i scale through.

    @tobiillz@tobiillz2 жыл бұрын
    • Good luck! You've got this!! :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • Did you get the job?

      @canalinactivo9607@canalinactivo96072 жыл бұрын
    • @@canalinactivo9607 I didn't get that particular job, the good news is i got another.

      @tobiillz@tobiillz2 жыл бұрын
    • @@tobiillz Congratulations!

      @canalinactivo9607@canalinactivo96072 жыл бұрын
  • bug with && easily solved by double conversion like !!condition

    @dmytro-skh@dmytro-skh Жыл бұрын
  • Ah finally, questions if asked I could answer and get hired.

    @stolensentience@stolensentience2 жыл бұрын
    • :)

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • I wouldn't call JSX syntactic sugar since it has to be transpiled.

    @hatifnatt57@hatifnatt57 Жыл бұрын
    • Fair point!

      @PeterElbaum@PeterElbaum Жыл бұрын
  • 7:15 I don't actually see how ternaries fix the issue with falsy values more than && operator. If you're using variables that can get falsy without dealing with it, you're going to have the same issues with both. E.g. `myList.length && ` E.g. `myList.length ? : null`. What you need to fix is the condition, so to actually check for what you're checking. E.g. `myList?.length != undefined`. Then you can use whatever conditional construct you like 😉

    @fcole90@fcole902 жыл бұрын
    • Good call! The specific error I'm talking about happens when we're using an array's length to decide whether or not to render the list. If array.length is false, then a 0 will show up. More here: kentcdodds.com/blog/use-ternaries-rather-than-and-and-in-jsx

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • @@PeterElbaum My favourite solution to this problem is doing something like this `!!myArray.length && `. The `!!` at the beginning will ensure that 'myArray.length' returns a boolean value.

      @TheJaySaw@TheJaySaw2 жыл бұрын
  • They asked me what are solid princibles and can we apply them on react projects last time :/

    @gradar7891@gradar78912 жыл бұрын
    • Tough one! It's hard to prepare for any possible question, it's probably best to focus on the foundational ideas

      @PeterElbaum@PeterElbaum2 жыл бұрын
    • @@PeterElbaum Yeah I see so. They got me bad that time 😄

      @gradar7891@gradar78912 жыл бұрын
  • Can’t believe i found this!

    @03greedo29@03greedo29 Жыл бұрын
    • :)

      @PeterElbaum@PeterElbaum Жыл бұрын
  • I can code and build apps with React. But explaining React in an interview, that I'm not confident.

    @pjguitar15@pjguitar157 ай бұрын
    • Interviewing is definitely its own skillset!

      @PeterElbaum@PeterElbaum7 ай бұрын
  • I like your video format, other creators are boring jejejje

    @BanaCJ@BanaCJ Жыл бұрын
  • Does anyone still use classes ? 😅

    @samoniumuziejus@samoniumuziejus2 күн бұрын
  • We deployed that 0 into SIT

    @Kira-ji5pr@Kira-ji5pr Жыл бұрын
    • Classic

      @PeterElbaum@PeterElbaum Жыл бұрын
  • If i would been asked with only these difficulty of questions then I would be probably a react developer already :/

    @dawheeler5556@dawheeler5556 Жыл бұрын
  • provide example and talk...

    @RahulDasAdhikary-usa@RahulDasAdhikary-usa Жыл бұрын
  • Great questions. The background music is annoying and anxiety inducing to me!

    @pingvp@pingvpАй бұрын
  • The density of terms is pretty overwhelming. It takes 30 minutes to watch an 8 min video.

    @dralithi@dralithi2 жыл бұрын
    • Thanks for your feedback - I'll take that into account in the future.

      @PeterElbaum@PeterElbaum2 жыл бұрын
  • dude, /highfive

    @adnantariq3346@adnantariq3346 Жыл бұрын
    • 🙏

      @PeterElbaum@PeterElbaum Жыл бұрын
  • You can still do someArray.length > 0 && renderElement()

    @jhaeberli@jhaeberli Жыл бұрын
KZhead