Тёмный

Trickiest React problem for Fresher and SDE1 | Increment Counter 

Learnersbucket
Подписаться 11 тыс.
Просмотров 4,3 тыс.
50% 1

JavaScript Interview Question - 10 | In this video, we will see how to create an increment counter component in React, it is one of the trickiest frontend interview questions that I often ask the freshers and SDE1 and the majority of them fail to provide a working solution.
You can expect this frontend system design/coding question in Rippling, Uber, Flipkart, Atlassian, Meta, Google, Microsoft, Dropbox, TCS, Infosys, Wipro, Cognizant, Capgemini, Accenture, Nvidia, Nutanix, and other product-based organizations' interviews.
Read about this question - learnersbucket.com/examples/i...
Read about why the state does not update in setInterval - overreacted.io/making-setinte...
Get my Ebook "JavaScript Interview Guide" with 120+ solved JavaScript questions.
Free preview - drive.google.com/file/d/16I0P...
Purchase it - learnersbucket.com/javascript...
Interview Questions - learnersbucket.com/examples/t...
JavaScript SDE cheat sheet - learnersbucket.com/javascript...
Social links
Twitter - / learnersbucket
Linkedin - / prashant-yadav-lb

Опубликовано:

 

5 фев 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 22   
@rameshkumar-dt5hn
@rameshkumar-dt5hn Год назад
Thanks Prashant it was insightful
@veersingh-bv9bz
@veersingh-bv9bz Год назад
Please upload more videos like this one. Thank you I was searching for this problem and your explanation is too good.
@Learnersbucket
@Learnersbucket Год назад
Sure, please share it in your network
@tusharabbott9946
@tusharabbott9946 Год назад
great video!!!
@Krishnasaini
@Krishnasaini Год назад
Very detailed insights, hoping to see more such videos in future
@Learnersbucket
@Learnersbucket Год назад
Thank you. Many more in the pipeline.
@swastikpatro6436
@swastikpatro6436 Год назад
Thanks for this Prashant, really liked it ❤
@Learnersbucket
@Learnersbucket Год назад
Please share in your network, let others learn from it.
@divyamishra1671
@divyamishra1671 Год назад
As you said in 8:16 .. setCount callback will give previous state. Please help me with some article to read more on this.
@Learnersbucket
@Learnersbucket Год назад
blog.logrocket.com/accessing-previous-props-state-react-hooks/
@alchemistmd2422
@alchemistmd2422 Год назад
hey can you please make a video about class vs Funcional components or please share any good resource to learn about it
@Learnersbucket
@Learnersbucket Год назад
Ignore the class components just focus on the functional component. The class components will be discarded in later React versions.
@alchemistmd2422
@alchemistmd2422 Год назад
@@Learnersbucket thanks
@sachinkumar-ks2ih
@sachinkumar-ks2ih Год назад
Please explain why count inside setCount( count + 1 ) is always 0.
@Learnersbucket
@Learnersbucket Год назад
As set interval runs in different queue, even after state update, it is not able to get the updated count value
@jatin5846
@jatin5846 Год назад
Bhaiya can i use interval in this problem
@Learnersbucket
@Learnersbucket Год назад
Yes, i have used as well
@abhinavsrivastava9320
@abhinavsrivastava9320 11 месяцев назад
the reason why the initial approach doesn't work is that it forms a closure within the setInterval with count=1
@mohithguptakorangi1766
@mohithguptakorangi1766 Год назад
Why did u use a ref instead of a normal let variable?
@Learnersbucket
@Learnersbucket Год назад
Variables will be redeclared when components re-render, that is why we either use useState or useRef to store values in React.
@mohithguptakorangi1766
@mohithguptakorangi1766 Год назад
@@Learnersbucket Damn, I didn't know that!👌 Thanks man
Далее
Stay on your way 🛤️✨
00:34
Просмотров 4,3 млн
doing impossible challenges✅❓
00:25
Просмотров 5 млн
This is a good intermediate react interview challenge
38:30