Javascript Interview Questions ( Promises ) - Polyfills, Callbacks, Async/await, Output Based, etc
ฝัง
- เผยแพร่เมื่อ 3 ก.ค. 2024
- #JavascriptInterview #Javascript #FrontendInterview
Javascript Interview Questions on Async Javascript including Promises, Callback, async/await etc will be discussed in this video including its in Polyfills, Output Based Questions, promise combinators, callback hell, etc.
➡️ Book an Interview Preparation call with me -
topmate.io/roadsidecoder
🟦 Follow me on Twitter and u will clear your interview 🤓 -
/ piyush_eon
⭐ Support the channel and learn from me One on One -
/ @roadsidecoder
🔗 Blog for the video -
roadsidecoder.hashnode.dev/ja...
🔗 Functions Interview Video -
• Javascript Interview Q...
🔗 Javascript Interview Series -
• Javascript Interview Q...
🔗 Cars24 Interview Experience -
• Frontend Interview Exp...
🔗 Unacademy Interview Experience -
• Frontend Interview Exp...
🔗 Tazorpay Interview Experience -
• Frontend Interview Exp...
🔗 MERN Stack Tutorial with Redux -
• MERN Stack Project Tut...
🔗 React Beginner's Project Tutorials -
• React JS Project Tutor...
-------------------------------------------------------------------------
00:00:00 Intro
00:00:36 What is a Promise?
00:01:36 Synchronous vs Asynchronous Code
00:04:25 Asynchronous Code Examples
00:05:32 Callbacks
00:07:10 Callback Hell
00:09:56 Promises
00:13:48 Promise.resolve and Promise.reject
00:15:10 Rewriting callbacks with promises
00:18:03 Promise Chaining
00:20:08 Promise Combinators
00:20:57 Promise.all()
00:23:01 Promise.race()
00:24:01 Promise.allSettled()
00:24:43 Promise.any()
00:25:41 Async/Await
00:29:10 Get Interview Preparation call with me
00:29:43 Ques 1 - What's the Output?
00:31:38 Ques 2 - What's the Output?
00:33:19 Ques 3 - What's the Output?
00:34:36 Ques 4 - Promise Chaining Output
00:35:54 Ques 5 - Promise Chaining Output 2
00:38:05 Ques 6 - Promise Chaining Output 3
00:40:33 Ques 7 - Implement this Logic
00:42:30 Ques 8 - Rewrite using 'async/await'
00:43:59 Ques 9 - Solve Promise Recursively
00:46:49 Ques 10 - Promise Polyfill
00:59:55 Promise.resolve() and Promise.reject() Polyfill
01:00:54 Promise.all()
01:06:30 Promise.race, allSettled and any Polyfill
01:07:06 Get Interview Preparation call with me
-------------------------------------------------------------------------
Special Thanks to our members -
Srinivas Ayyagari
🔴 Get my Complete Frontend Interview Prep course - roadsidecoder.com/course-details
✨ Complete Javascript Interview Playlist - th-cam.com/play/PLKhlp2qtUcSaCVJEt4ogEFs6I41pNnMU5.html
➡ Book an Interview Preparation call with me ( 20% OFF for limited time ) - topmate.io/roadsidecoder
If this video gets good response, I will make more JS videos, so do share it with others 🔥
Please make video on promise polyfill and include all, race, allSettled, any. i hope you will make video on its all in one.
Criminally underrated channel.
this is just perfect, it really lets you wrestle with the concept until you get it! thanks RoadsideCoder
This is just amazing. One of the best content for interview prep. The number of variations possible in JS is just endless. Thanks for helping us out
Truly amazing bro. Thank you so much . Such clean and easy explanation
Its very clear and easy to understand
I have been waiting for the Own promise implementation
Its very helpful
Thanks.
When we learn anything from roadside coder we sure that we get quality content
fabulous explanations , awsome!
Please make a video on Event loop! All the videos are really helpful! Keep up the good work!
These are the best interview questions and concepts.
Just a wow..brother you are gem ..thanks for this video
Awesome Series 💯
You are amazing, Great Content.
VERY GRATEFUL !!!!!🙏🙏🙏
Your content is amazing 😊 loved it
I can give like for all videos from Roadside coder by closing my eyes because all are quality contents
❤️
Haha.. Most excited 😍🔥
The only video you need for asynchronous javascript, dhanyawad.
Thank you so much!
I've been following your videos, great content. Please do make a series on Software Design patterns it you be very helpful.
Thank You bhaiya....
Very informative 👍
Pure gold content. Thanks for putting these hard efforts
And Thank you for supporting 🙏
Thank you Piyush!! Your videos are helping me learn the basics of Javascript .
Glad to hear that
Hey man this is great, is very likely you will find a bunch of videos explaining these topics but this is by far the cleanest one I've found, great hour of my life was spent watching this, I just suscribed, I will see the rest of your videos for interview questions, thanks for your work.
Thanks a lot man!
So perfect
man you are good thx
Haha.. that meme thumbnail 😂😂🔥🔥
Why to seee this lecture
Lecture=quality
Question=more practice(good)
Explanation =clarity
thank you
More content like this ☺☺
Absolute quality content ❤️
🙏❤️
A very good video. Kindly consider omitting "over-here" from vocabulary. I do understand English might not be the first language. But one day at a time. Cheers xx
Thank you so much for these informative videos.
Thanks, u can check the complete course here - roadsidecoder.com/course-details
superb!
Thanks.
Excelente, as always
Thank you! Cheers!
i learn more things this js videos please make more videos...
Great learning, Thank you
Please do a video on Classes in JS
Really amazed. I will definitely suggest your channel to beginners who want to understand or learn javascript.
Thanks for making the javascript very easy for us😉
Thank you so much brother.
Frm pakistan i have wathced lot of videos about asynchronus js but ur video is providing a Too much Unique and quality knowledge amazing video keep doing helping others Allah bless u more...
Thanks, u can check the complete course here - roadsidecoder.com/course-details
Meme
Manager appreciating me for knowing everything about javascript
Me who watches all of the videos of roadsidecoder
Hahah
Can you make videos related to dsa using JavaScript for the dsa round in frontend interviews - also give some idea about how to get frontend internship opportunity while in college. hoping for your reply :)
That is one of the best explanations that I've seen so far on TH-cam, keep it up 🫡
Nice content, There's one minor error in myPromise implementation, you should update isCalled = true, instead called = true;
Please make video on promise polyfill and include all, race, allSettled, any. i hope you will make video on its all in one.
i can give like of your video before the preload ads start
Very nice video. Please make a video on oops
hi ..thanks for this video nice efforts ..can you plz make a video on prototype and prototype chaining.
@RoadsideCoder I have great idea to make video upon and this will surely gain more people's interest. The idea is the implementation of Reactjs or Hooks in vanilla js.
Thanks me later.😎
great THumbnail
Yes plz event loop
Explain event loop in context of both javascript and nodejs
Thumbnail🔥🔥
Loved the thumbnail. Gonna copy it someday!
Haha sure
Please make a video on how promises handled with micro taskQueue
bro, wo notion bhi share krdo saath saath. bdiya kaam hojayega
Amazing content and presentation skills. Thank you!!! only one question, what kind of Indian doesn't wobble his head?!
Ram Ram bhai Amazing & outstanding Content I have ever seen online but source code kaha milenge ye sare
This truly helped me thnx
Please make a video on Event Loop as well. Your way of teaching is superb. Love from Pakistan 😍❤
I saw your channel content your channel have potential to reach 1M but be consistent please
Thank you. I'll try my best
I try find this Answer more 4 hours
A web developer is creating a function to return a promise. Consider the following JavaScript promise function:
function greeting() { return Promise.resolve("Welcome"); }
How can the developer create an asynchronous function that returns a promise?
return "Welcome"; }
function greeting() { return "Welcome"; }
function greeting() { return resolve("Welcome"); }
await function greeting() { return "Welcome"; }
Sir, Please upload interview questions on event loop
Please make tutorial on caching
Thumbnail man 💪🏿😂
One suggestion be consistent
Please create polyfill for promises chaining also
Bro recently one interviewer ask me to create custom react router. Can u pls create a video and explain it.
Thanks buddy.. Please make video on prototype
Definitely
Just have a doubt at 42:29, when we can directly print string from promiseone by logging in the first .then itself, why are we first returning and then printing it separately?
Cant we do something like this :
promise2.then(res => {
console.log(res) // which will print 'First!'
})
Hello bro. ❤️ I am from Bangladesh. I really like your all vedio based on js.
Your explanation is too much good.
Please make the more vedio on Reactjs interview question
Definetly! Thanks ❤️
Really content is so good, make some practice platform so that after, watching the video anyone can do some practice because without practice people forget everything. And also I need one urgent help if you are available currently I can't spend money but after some time I will give you money
Next video on redux pls with a project (not counter app)
Can you explain promise and promise.all polyfills with more simpler way? It is very though to understand
whenever i start this video to practice after some time started to make my own implementations. is it me or its same for everyons
Hi bro, I was just working on a use case like getting the images w.r.t to the term the user inputs using react and am using the unsplash api for this and doing the api req using Axios. Now the problem is the api req fn is written in another file called api.js and the result is returned into a component. When returning the resultant its going infinitely when logging. I done this using promise. Can you help here bcoz am stuck here.
But while execution this will go in micro task or macro task queue as promise is a micro task please correct me if i am wrong somewhere 😅
can you add these questions in a github repo?
Freshers also will be asked about polyfills? If yes then what kind of, the easier ones like map filter and reduce or tough ones like promise and it's combinators?
Anything can be asked
Piyush polyfill of promise was very interesting. Can we expect a video on prototype and prototypal inheritance. Also I think there is a typing mistake at 54:57 it will be isCalled = true
Thanks man, yes I am working on that video
Yes, please make it vedio on event loop.
Soon!
@@RoadsideCoderdid you created
23:00
My Brain has left the Video on Polyfills part
Hi bro, love your content and the vibe of the video so wanna ask you a question that is is there a internship which is only for frontend developer and how can i apply for it. Looking for you reply
@jhaganb9215 hey did u get internship or job .. if yes then please do connect with me .. waiting for your answer
@@Aptilover no i did not get any internship specifically for frontend. i tried to get but could not even able find any opening for FE . every where it was freshers role only. try open source contribution for frontend project which will help to get FE fresher role even in smaller companies/startups
in allSettled polyfill why u write Promise.all(mappedPromises); ????
polyfills for promise asked for a fresher or experienced?
yes
bhai thoda arram se hum etne tej nahi ha tho thoda aur explain kar deya karo
wow... im 10 months late and still in quarantine
Why is the output of this "First" and not "Promise { 'FIRST' }" .
const firstPromise = new Promise((res,rej)=>{
res("FIRST")
})
const secondPromise = new Promise((res,rej)=>{
res(firstPromise);
})
secondPromise.then((res)=>console.log(res));
Bhai Hindi me video banavo java script or react native ka
Tis is not a valid promise implementation, in the specification states that a promise can be then multiple times, please check you implementation and you will see you can call then only once.
You are confusing Aynchronus with promise. Promise doesn't make a piece of code async.... It's just a way to track the async code.
Moreover if something some object is thenable it doesn't means it's its returning or executing some asynchronous code.
For example in nodejs Promisification is a common pattern where ur can promisify a fuction that receives a call back function. So by promisificaton are not make that function asynchronous
What's the actual reason for undefined ???
const changeAction = (chanelname) => {
setTimeout(() => {
return (`subscribe to ${chanelname}`);
}, 1000);
}
console.log(changeAction(" Roadside Coder "));
console.log('Ending point ')
console.dir(changeAction);
Output
starting point
undefined -----------------------------------------------------------????
Ending point
Sir 1 selfish request
1 Reactjs project with CSS (explain css also)
1 Reactjs project which is capable of showcase in resume to impress recruiter
Please 🙏🏽🙏🏽🙏🏽 sir make 1 project
I've Already made a lot of projects, you can check out my channel
@@RoadsideCoder yaa but that movie app which is awesome project is in react-router-dom V5
That's why request for modern Reactjs project
Javascript is a single threaded .. But we run asynchronous code .. Can u explain this..
Javascript is single threaded so it will only execute one operation at a time. Asynchronous code runs only after all the synchronous code finish executing. I hope you're clear now
Asynchronous functionality is achevied by using web API like set time out etc. These are not part of js
This is not working the polyfill you have written.
console.log("start");
const inbuiltPromise = new Promise((res,rej)=> {
console.log(2);
res(2);
})
inbuiltPromise.then((val)=> {
console.log(val);
})
console.log("end");
main chiz blurr ho gya sir
2 Likes .
Sir Hindi main banaya karo
59:22 line 27-> should not the variable name be "isCalled" ?? you have written "called" then also how is the code running correctly 😂
No, that's different variable 🥲
@@RoadsideCoder but it’s not declared anywhere 😕
It is, man ki akho se dekho
🤪😂 anyway, I checked the related blog, that made it clear 😊 Thanks for making such helpful content!! Keep making them🤟