Тёмный
No video :(

JavaScript Interview Question - 3 out of 4 Candidates Fail | Event Loop Concept | by Arnav Gupta 

Coding Blocks
Подписаться 130 тыс.
Просмотров 74 тыс.
50% 1

Arnav has a simple 5 minute Javascript question with which he can filter out easily those who are beginners in JavaScript and those who really understand how event loop, multi threading and concurrency works in JavaScript.
#javascript #interview #questions
Check these Videos for More:
How SetTimeout Works : • Javascript: How setTim...
Phillip Roberts Event Loop • What the heck is the e...
Join our Discord Channel: cb.lk/discord
Follow Arnav on
Twitter: / championswimmer
LinkedIn: / arnavgupta
------------------------ About Coding Blocks ---------------------------
Join our #TelegramCommunity at t.me/CodingBlo... to get updates on our latest workshops, talks, and announcements.
Get started with our Online Courses with a Free Trial: online.codingb...
Coding Blocks is India's best Programming and software training institute that offers courses like C++ and Java, Data Structures and Algorithms, Web and Android Development (Java and Kotlin), Competitive Programming, Coding Interview Preparation, Machine Learning, AI and get placed in your Dream Company! ♥️
#CodeYourWayToSuccess #Programming #Coding #Learning #LearnFromHome #COVID19
📌 We are on Social Media!
Facebook: / codingblocksindia
Instagram: / codingblocks
Twitter: / codingblocksin
LinkedIn: / codingblocksindia
GitHub: www.github.com/Coding-Blocks
👍 Support us by hitting the LIKE and the SUBSCRIBE button. You can share your thoughts, questions, doubts in the comment section and our mentors will help you out as soon as possible.
Share our RU-vid Channel: cb.lk/ytcb

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

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 112   
@omkareshpali8486
@omkareshpali8486 3 года назад
Was waiting you to start singing Tum hi ho!
@VikashKumar-ox2hv
@VikashKumar-ox2hv 3 года назад
Exactly 😀
@nishantnirala5106
@nishantnirala5106 3 года назад
😂😂
@sujit_pasalkar
@sujit_pasalkar 3 года назад
😅🤣🤣
@MOHIT151290
@MOHIT151290 3 года назад
Hahahaha... Exactly
@ishumishra8104
@ishumishra8104 3 года назад
🤣🤣 same here, i was thinking bhai ye kisi ki tarha toh lagrha
@JosuaLeonard
@JosuaLeonard 3 года назад
Downside is you can also missed a lot of good candidates since most of hardworking developers focused working on the things related to their project. Good video though.
@nasirudeenluqmankunle2828
@nasirudeenluqmankunle2828 2 года назад
I hope @coding block sees this as most of his focus is asking an irrelevant question.
@vguptae
@vguptae 2 года назад
i agree
@ravipal-vz9ej
@ravipal-vz9ej 2 года назад
Agree
@ravipal-vz9ej
@ravipal-vz9ej 2 года назад
This kind of people trying to be so oversmart and always asking irrelevant questions
@himanshupareek66
@himanshupareek66 Год назад
I also think so, but still I believe the first question is so logical, and clears the concept of all the theories which has been read by the candidate.
@_lifestylefusion
@_lifestylefusion 3 года назад
the call stack never gets empty and it keeps on printing hello, nice catch and yes again great video arnav
@caleboke2771
@caleboke2771 3 года назад
I know about the event loop, but I didn't think about that. It is tricky.
@anupamdubey5736
@anupamdubey5736 3 года назад
Thanks Arnav. You explain things with a practical approach while most creators explain with theory point of view.
@akshayshinde2403
@akshayshinde2403 3 года назад
I have watched event loop video of Jake Archibald by JSconf, and after that I was searching for a better example of event loop to clear the concept. Finally it is, and I really liked the question it's tricky and really clears a lot of concept. The mistake I am doing is not actually thinking by call stack, I just see the code and tries to get the answer but now I have got a lesson to always see the code from call stack perspective. Again really thanks for the video.
@BalwinderSingh-gb6cn
@BalwinderSingh-gb6cn 2 года назад
What is purpose of asking these questions(about loops). For Example web developer might never solved this problem or similar problem like this. So, he cannot answer this question. Developer job is way easier than cracking a interview. It is a problem.
@tilllupahalwan8697
@tilllupahalwan8697 3 года назад
we can use process.exit() inside setTimeout() if we just want to exit out of node.
@Anas74Khan
@Anas74Khan 3 года назад
Once I was trying something like this and I didn't understood what happened why my while loop is not ending thanks for the explanation
@mohanish35
@mohanish35 3 года назад
Arijit in his leisure hours..
@suvmatrix
@suvmatrix 2 года назад
Saying any question Basic or Essential is subjective
@sampathsam1049
@sampathsam1049 Год назад
Good great explanation bro
@krishpanchal6087
@krishpanchal6087 3 года назад
Hey, Can anyone explain why sometimes it prints till 9 instead of 8 in the second question asked by Arnav Sir?
@LeonardoSantos-lp9hp
@LeonardoSantos-lp9hp 3 года назад
I would like to know this too
@AkshayPatange29
@AkshayPatange29 3 года назад
Try executing let t = Date.now(), c = 0 let interval = setInterval(() => console.log(c++, Date.now() - t), 200) setTimeout(() => clearInterval(interval), 2000) You will see that setInterval() does not really fire after exactly 200ms but slightly more than that. So it clears interval of 2000ms by the 9th execution.
@krishpanchal6087
@krishpanchal6087 3 года назад
@@AkshayPatange29 Thankyou
@adityatripathi1904
@adityatripathi1904 2 года назад
8:24 You can also do it with promises
@yogesh-gupta
@yogesh-gupta 3 года назад
Hello Sir, I have observed something, please clarify. The question which you have pointed there that how many time the 'hello' and counter value will be printed in the case of setInterval()? Both will be printed for 9 times. Isn't it? 'hello' 9 times and count from 0 to 8 which results into 9 times. Isn't it?
@dzikiborsuk5388
@dzikiborsuk5388 2 года назад
All that proves, that you should work more on your recruitment process, rather than on JavaScript ;) I guarantee you, that many JavaScript developers could ask you a question "What my tricky code would print" and you would not be able to answer correctly, even if you are familiar with concepts such as Event Loop, Prototypes and more - especially when you would combine such functions, that no one uses in real-life scenarios.
@sidharth5665
@sidharth5665 2 года назад
Isn't when we replaced the code from while. To set interval then how setTimeout got the thread to execute the statement after 2 seconds while setInterval was running as while was running in previous example. Pls explain what's the difference somebody.
@akshayaghera8123
@akshayaghera8123 3 года назад
Good content mate, having in depth understanding of event loop is must, Ancient ppl said don't block the eventloop 😉
@anuragpandey6760
@anuragpandey6760 3 года назад
thats it this is you litmus test ! you shouldn't be allowed to judge candidates then
@10xprogrammer
@10xprogrammer 3 года назад
Thanks a lot Arnav Bhaiya, It helps me a lot
@shriduttpatel1350
@shriduttpatel1350 3 года назад
Just 1 word for this. AWESOME 👍👍
@RaGa_BABA
@RaGa_BABA 3 года назад
The stack will not be empty to execute the seTimeout... Print infinit
@arnobchowdhury1804
@arnobchowdhury1804 2 года назад
this vid gave me reason to why not to go for coding blocks coaching : )
@therailchannelofficial
@therailchannelofficial 2 года назад
That's the problem with coding interviews, isn't it? Interviewers like you tend to assume things based on the candidate's ability to answer such questions while ignoring all other aspects of that particular candidate; like you yourself mentioned, he might have built a kick-ass portfolio site but if he can't answer this question, sorry, rejected...
@krnkoravi
@krnkoravi 2 года назад
Why set Interval doesn't make make main stack busy just like while loop?
@hakooplayplay3212
@hakooplayplay3212 2 года назад
watch the video of Jake Archibald by JSconf. The while loop have no "gaps", it take entire main thread and block it, interval creates and run the task when there is a turn for macrotask and after one iteration leaves loops for the next time, so the setInterval loop have "gaps" where other code can work.
@krishna1.097
@krishna1.097 3 года назад
Thank you for this. This is a very informative video👍👍👍
@him99ful
@him99ful 8 месяцев назад
Good topic. But never ever judge an interviwee with an single question. Their is a difference between knowing an output based question and actually doing a development. Its important to know but give them ample question to check their wholistic knowledge. I knw developers who dont even know what closure and hoisting are but do quality development.
@kustipriv4712
@kustipriv4712 2 года назад
Why if i use this code in terminal using node i get from 0 to 8 but if i use chrome i get from 0 to 9
@unibrow9384
@unibrow9384 3 года назад
Love your content, Arnav sir.
@rohit1kumar
@rohit1kumar 2 года назад
Hire me I answered all questions correctly ofc I watched Philip Roberts' video before this one :p
@parthokr
@parthokr 3 года назад
I was waiting for Tum Hi Ho
@yashdewan3633
@yashdewan3633 Год назад
thanks arijit singh for this proper explanation
@mannojreddy
@mannojreddy Год назад
to handle this we use cluster module to create child processes in nodeJs.
@ngneerin
@ngneerin 3 года назад
I don't think that's fair. I very well understand how web APIs have a separate area of execution. I also know main thread is run in call stack and only after it empties, engine goes after callback queue, I use it heavily in my designed web game. But yet, I would not have figured this out, as there is confusion to whether the while code is required in main thread or not. I had assumed, you can't move the while outside of main thread. So I couldn't solve. And not because I don't understand the working of web APIs
@pradipta9345
@pradipta9345 3 года назад
Exactly, same here.
@hakooplayplay3212
@hakooplayplay3212 2 года назад
even if you cant move the while outside of main thread there is a solution to put nexttick or setImmediate in this loop to allow it get "gaps" for other code.
@DriveandThrive
@DriveandThrive Год назад
Kind of a gotcha to actually use this in an interview. Guy spends tons of time coding and then misses a job due to an event loop question lol.
@squidwurrd
@squidwurrd 2 года назад
Yea but why does it only print up to 8 and not 9?
@Agustin-jo8mv
@Agustin-jo8mv 2 года назад
Damn. Really interesting video! Thank you for his.:)
@pez5491
@pez5491 7 месяцев назад
brillant!
@puneetsingh9678
@puneetsingh9678 3 года назад
Felt good that I knew the answer to this 😁
@adarshchacko6137
@adarshchacko6137 3 года назад
Please make such videos on php / laravel.
@ankur_gupta
@ankur_gupta Год назад
Arijit singh changed his profession
@AvinashKumar-jf9mx
@AvinashKumar-jf9mx 2 года назад
Anyone can answer... What is difference between javascript events vs node js Loop?
@youtubechannel3163
@youtubechannel3163 Год назад
It stops after 9th iteration because the value if a changes
@yashwantsahu3002-ram
@yashwantsahu3002-ram 3 года назад
thanks man for the great insight !!!
@swapnildanwe56
@swapnildanwe56 3 года назад
Informative
@adityamaurya8092
@adityamaurya8092 3 года назад
Can we create a thread in JavaScript or nodejs like java
@livesamarth
@livesamarth 3 года назад
JS is single threaded man.
@mayankkaul3218
@mayankkaul3218 3 года назад
Not exactly, but you can read about worker threads.
@livesamarth
@livesamarth 3 года назад
@DhonDol ChosaChusiBara Who is speaking to you, you feminist!
@karansingh1352
@karansingh1352 3 года назад
@DhonDol ChosaChusiBara well he was only addressing the Man part of your woMan🤣🤣
@karansingh1352
@karansingh1352 3 года назад
@@livesamarth 😂😂
@rahul.murari
@rahul.murari 3 года назад
Thanks arijeet 👍
@TrainExplore
@TrainExplore 2 года назад
This is not the correct way of picking up candidates, NO. This is absolutely wrong
@arulantony2137
@arulantony2137 3 года назад
main thread once finished pop out from event qu
@Agustin-jo8mv
@Agustin-jo8mv 2 года назад
What would you expect from a Jr web developer? 🤔
@cinnybun739
@cinnybun739 3 года назад
Arijit Singh teaching code. My life is complete.
@amitbajpai6265
@amitbajpai6265 3 года назад
Same bro that's what I was thinking while watching the video
@cinnybun739
@cinnybun739 3 года назад
@@amitbajpai6265 lol
@SachinDolta
@SachinDolta 3 года назад
Ty
@sujit_pasalkar
@sujit_pasalkar 3 года назад
Thank u😁
@EntertainmentTV-xg7xr
@EntertainmentTV-xg7xr 3 года назад
ultimately explained
@mohamadashish535
@mohamadashish535 2 года назад
Arijit Singh bro !!
@satya-lifevlogs
@satya-lifevlogs 3 года назад
Suprised to see arijit Singh here :) ..Sorry buddy. Nice video
@naushad30
@naushad30 3 года назад
Arijit Singh 😎
@inderjeet8659
@inderjeet8659 3 года назад
kinda lame way of hiring ngl.....
@miw879
@miw879 2 года назад
what the hell Coding Blocks why did you delete my explanation I just commented a very easy understanding of event loop?
@vinayakpandey7
@vinayakpandey7 2 года назад
My manager will be fired if i asked this to him. He also dnt knw this I bet.
@rohitrout6450
@rohitrout6450 Год назад
Give some tough questions these were cakewalks. 😑
@ashishmangla221
@ashishmangla221 3 года назад
event loop
@inderjeet8659
@inderjeet8659 3 года назад
If i had a dollar everytime this dude said "uhhh"
@dkg4975
@dkg4975 3 года назад
Are you somehow related to Arijit Singh?
@shubhamkeswani5790
@shubhamkeswani5790 3 года назад
Arnav sir i called you do you remember
@sohailbasha7781
@sohailbasha7781 3 года назад
I though arijit is going to sing a song with lyrics JAVASCRIPT INTERVIEW
@Spider-Man_67
@Spider-Man_67 3 года назад
You look like, Arijit Singh 😁
@piyushpriyadarshi8672
@piyushpriyadarshi8672 3 года назад
arijit singh who code
@vishalthapa1440
@vishalthapa1440 3 года назад
please make next video on interview question of android development or kotlin.
@talariharikumar6826
@talariharikumar6826 2 года назад
..
@abhiraj9990
@abhiraj9990 3 года назад
sesta arijit singh
@josephhernandez8086
@josephhernandez8086 Год назад
all sheeps in the comments. wtf u dont ask trees and graph qn and ask event loop anyway? may be sb knows trees and graph and not event loop?
@vikasjoshi2889
@vikasjoshi2889 3 года назад
whats up with that trashy logo 🤦‍♂️
@CodingBlocksIndia
@CodingBlocksIndia 3 года назад
Brings views. 🙃🙃
@SoraFromIndia
@SoraFromIndia 2 года назад
You make use of 'aaa' filler way too much. To the point that it gets extremely annoying and aaa distracts a person aaa way too much. Usage of fillers is fine when done in aaa moderation. Not after each and every aaa few words aaa. Not trying to ruin your mood or anything aaa, maybe I am annoyed right now aaa but hope you understand aaa. It will help you in your future interviews aaa. Apologies in advance. All the best bro.
@Murtaza0052
@Murtaza0052 3 года назад
Dislike for English language..
Далее
5 Essential JavaScript Interview Questions
20:32
Просмотров 91 тыс.
Tricky JavaScript interview questions and answers
21:01
Moto Trial vs Moto acrobática 🏁
00:29
Просмотров 2,6 млн
Premature Optimization
12:39
Просмотров 802 тыс.
73 Questions with Jet Packinski | Vogue Parody
6:16