Tricky JavaScript Interview Questions and Answers

  Рет қаралды 457,491

techsith

techsith

Күн бұрын

Hard JavaScript Interview Questions and their possible answers ( cracking difficult coding interview questions )
For more interview questions checkout
*www.fullstack....
Please be my patreons on patreaon
* / techsith
Follow me for technology updates
* / techsith
* / techsith1
Help me translate this video.
* www.youtube.com...
Note: use translate.goog... to translate this video to your language. Let me know once you do that so i can give you credit. Thank you in advance.

Пікірлер: 491
@TheRaghavboyz
@TheRaghavboyz 6 жыл бұрын
oh god, i wish i never sit in front of you in a js interview.
@PradeepKumar-ku5pe
@PradeepKumar-ku5pe 6 жыл бұрын
@ThuatNham Hey can you please share secrets to crack interview
@Tryston
@Tryston 6 жыл бұрын
They aren't very good secrets if its in a youtube video!
@sarthaknegi847
@sarthaknegi847 6 жыл бұрын
lol
@GhanshyamDobariya90
@GhanshyamDobariya90 5 жыл бұрын
You must wish, if you want to learn more 😁
@talkohavy
@talkohavy 5 жыл бұрын
I feel sorry for companies who ask these silly questions. This is the worst test possible to know if someone is an amazing programmer, a good programmer, a so so programmer, and someone who's really bad at programming that has no self awareness to how bad they really are. seriously, if it were me going through the interview, I would withdraw my application form, greet the interviewee in front of me and say "Thanks, but no thanks".
@thedeveloper4207
@thedeveloper4207 6 жыл бұрын
If you want to crack these questions then just ask the interviewer where he has used such scenarios. You'll be instantly selected
5 жыл бұрын
I'll add it to my *How to look smart in an interview* trello card, thanks!
@pa9351
@pa9351 5 жыл бұрын
The point is not to use it, the point is that as a senior you should be aware of the dangers of using tricky codes like this and stop others for doing something like 5 < 6 < 7 even if it works
@anthonya606
@anthonya606 4 жыл бұрын
I been denied on the last round of interview with CTO because of this answer. Everything was great until he decided to gave me a logical puzzle "You need to measure exactly 6 liters of water. But you only have a 4-liter and a 9-liter bucket. How can you do this?" I asked him "How often you guys are measuring water here with buckets" and been rejected right away...
@weblogic7723
@weblogic7723 4 жыл бұрын
@@anthonya606 Better off not working for them. Too egoistic if they cant even take a simple joke.
@Daniel_WR_Hart
@Daniel_WR_Hart 4 жыл бұрын
@@anthonya606 The thing being measured is irrelevant, they just wanted to test your problem solving skills. Although if you clarified that you were joking and still willing to try but they didn't want to hear it, then yea fuck 'em.
@nasriddinbekbektemirov5796
@nasriddinbekbektemirov5796 3 жыл бұрын
Honestly, I am happy that I found your tutorials. Now I am feeling a little bit comfy so I can prepare for the interview without worries
@omkaryadav7445
@omkaryadav7445 3 жыл бұрын
Same here buddy
@vikrantsingh47
@vikrantsingh47 5 жыл бұрын
this was really helpful. i am using javascript for many years but never knew of so many features like freeze and seal
@fida
@fida 5 жыл бұрын
you proved that .. those are really useless
@BobbyBundlez
@BobbyBundlez 4 жыл бұрын
@@fidaLMFAO yeah they sound really dangerous tbh... why would i ever wanna make something completely immutable
@ChristopherCricketWallace
@ChristopherCricketWallace 6 жыл бұрын
These are all code puzzles (not challenges) that an interviewer would use in hopes of eliminating a candidate that they've already decided they don't want but have to appear to give them a fair chance. I would not want to work with a team that codes like that. And I sure wouldn't use their application. It would have a billion bugs.
@Techsithtube
@Techsithtube 6 жыл бұрын
At my previous job, I have seen people making really silly mistakes and I realized that they never learned java Script fundamentals rather they jumped to a framework and paid the price.
@Gowaduv
@Gowaduv 6 жыл бұрын
techsith Object.freeze is not JS fundamentals, it's minitiae that should be looked up to solve a specific problem.
@AP-ny3zg
@AP-ny3zg 6 жыл бұрын
Hey @Christopher If we remove DS and Algorithm then what should be a challenges in JavaScript.
@Carl-yu6uw
@Carl-yu6uw 5 жыл бұрын
Completely agree. For instance, whilst it can be useful to immediately know intricacies of performing stupid actions in dynamically / weakly typed languages it is far better not to code yourself into them, as one will evetually catch you out! Just because the language allows something, it doesn't necessarily make it sensible to do/ use. And I would also not wish ship code that will be a maintenance nightmare.
@darrallshamarwilliams7560
@darrallshamarwilliams7560 5 жыл бұрын
Can u help me prepare for a java interview next week bro?
@charles-y2z6c
@charles-y2z6c 5 жыл бұрын
Thank you, many times on an interview it becomes obvious the interviewer watched these videos too.
@sidneysouthfield844
@sidneysouthfield844 4 жыл бұрын
8:43 - me at my homie house.
@i5artube
@i5artube 6 жыл бұрын
After this one, I had to subscribe.
@Techsithtube
@Techsithtube 6 жыл бұрын
Thanks for subscribing!
@shripriyaprabhakar7922
@shripriyaprabhakar7922 5 жыл бұрын
Me too!
@andylinkOFFICIAL
@andylinkOFFICIAL 5 жыл бұрын
I wouldn't ask these types of questions in an interview. If anyone wrote code that is so ambiguous, I would question their motives
@cancanjaker1620
@cancanjaker1620 4 жыл бұрын
True. These are questions for interviews. Not really what you will encounter in a code base, because it is really testing the edge cases of JS.
@Daniel_WR_Hart
@Daniel_WR_Hart 4 жыл бұрын
@@cancanjaker1620 I find that it helps to know these quirks so that you can figure out where/how a bug happened when you do something weird like numVariable + stringVariable by accident
@cancanjaker1620
@cancanjaker1620 4 жыл бұрын
@@Daniel_WR_Hart but when writing in an actual code base, you will know the type of variables you are getting and the code written should already handle the cases properly. Also if you consider unit testing, these types of variable quirky bugs are the most easiest to weed out without having to learn about JS "weirdness". As much as I like JS and all these interesting edge cases, code writing do not require developers to answer these from memory. Good code is clear and leave little room for these fun but hair-pulling quirks.
@Daniel_WR_Hart
@Daniel_WR_Hart 4 жыл бұрын
@@cancanjaker1620 But that's not necessarily the case if you're a noob working with a team of noobs and nobody knows what unit testing is. Lately I've been working hard to get gud so that won't be an issue anymore. Also, when working on my own personal projects, whenever I need to convert a string into a number I prefer string - 0; over parseFloat(string); since it's more concise and I already know at a glance what - 0 would be used for.
@cancanjaker1620
@cancanjaker1620 4 жыл бұрын
@@Daniel_WR_Hart a noob should be learning coding best practices and writing tests instead of getting smart with using quirky language behavior. Which is why most of these interview questions are for "feel good" and ego stroking. They don't indicate a good coder or a team player. With regards to using - 0, it is concise, but the intention of the code is murky, whereas parseFloat is immediately clear to everyone even a non-JS coder. Which means you save JS coder from have to spend time thinking of what - 0 will do, and also save confusion for new coder who move over from another language.
@daviddeleon3411
@daviddeleon3411 4 жыл бұрын
2:20 first I just did this let nums = [1, 2, 2, 3]; nums= [1, 2, 3]
@Rockstervivek
@Rockstervivek 5 жыл бұрын
Hello. Can i say something ? You are the best teacher of JS in the whole WEB :)
@someshnukala9126
@someshnukala9126 4 жыл бұрын
Yes True. He is outstanding really
@justadev____7232
@justadev____7232 Жыл бұрын
Object.freeze ---> Prevent any write operations in that object. Object.seal ---> Able to edit existing data in the object, but not able to add anything new
@utsavkumar4381
@utsavkumar4381 6 жыл бұрын
Thanks Sir for the videos you make. About removing duplicates, if anyone does not want to use ES6, here is how it should be done in ES5. var a = [1,2,2,3,4]; a.filter(function(value, index) { return (a.indexOf(value) == index) });
@Techsithtube
@Techsithtube 6 жыл бұрын
here i have a tutorial on how to remove duplicates multiple ways. kzbin.info/www/bejne/mqezqpWmnNBoj5Y
@thillabanyai
@thillabanyai 2 жыл бұрын
yes but he says you only have 1 line of code to solved it, and cannot use loops
@owaisali995
@owaisali995 2 жыл бұрын
and the problem with filters is it will take a lot of time to run, I mean running time is far more than SET that's why we should never use filter
@utsavkumar4381
@utsavkumar4381 2 жыл бұрын
@@owaisali995 i was not aware of this, can you explain a little more, or perhaps can share some material on this. Thanks in advance
@DriveandThrive
@DriveandThrive 2 жыл бұрын
Walk into interview. Get asked these silly questions which aren't applicable to the real world. Walk right back out.
@TheRealAbrahamLincoln
@TheRealAbrahamLincoln 2 жыл бұрын
Agreed. Half of all interviewers just want to show that they know more by researching obscure topics to put you on the spot.
@nosajghoul
@nosajghoul 6 жыл бұрын
@7:00 thats pretty interesting, and depends on the direction of associativity. < and > (I hope those show up, less than and greater than) have left-to-right associativity. = (equals sign) has right-to-left associativity, which is why we can do a = b = 4 developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence
@ankush3707
@ankush3707 3 жыл бұрын
its like difference between these two .. console.log('1'+1+1)..and console.log(1+1+'1');
@goshmain982
@goshmain982 5 жыл бұрын
I realized I know nothing about JavaScript xD
@Techsithtube
@Techsithtube 5 жыл бұрын
I think motivation comes from that realization. :)
@alexviola1745
@alexviola1745 4 жыл бұрын
RT
@MP-mh1tu
@MP-mh1tu 3 жыл бұрын
This man is capable of explaining things well in a simple way, the way few people do. Thank you, sir.
@Techsithtube
@Techsithtube 3 жыл бұрын
I appreciate that!
@ChristopherCricketWallace
@ChristopherCricketWallace 6 жыл бұрын
OMG WTF. This video is a long list ways NOT to write JavaScript EVER. If I had a team member who committed opaque, confusing code that used restricted words in silly contexts I would REJECT all of it and have a long sit down with them about best practices.
@colegaud
@colegaud 5 жыл бұрын
I think you missed the point of the video. It is explaining interview questions regarding various Javascript concepts. He never said this is how you should be writing your code.
@34_Conflict
@34_Conflict 2 жыл бұрын
Amber Heard made this man become a programmer.
@webylancers5607
@webylancers5607 2 жыл бұрын
JazakAllah Aameen 🙏 🤲 😍
@priyanshubhardwaj2158
@priyanshubhardwaj2158 3 жыл бұрын
This vid was meant to subs both your channels. Thanks a ton!
@Techsithtube
@Techsithtube 3 жыл бұрын
Thanks for watching!
@davidsimoes6248
@davidsimoes6248 2 жыл бұрын
Great class and very well explained. Please keep this channel because I´m sure It has been helped a lot of developers which try learning more each single day like me. Thanks
@BcomingHIM
@BcomingHIM 3 жыл бұрын
turs out javascript can add arrays as well with the + operator😂...I dont think there are many people who can answer all the tricky questions about JS
@EdgarGarcia-jo5qp
@EdgarGarcia-jo5qp 4 жыл бұрын
For 3:00 question, I think in this solution that works for the input provided: var nums = [1,2,2,3]; nums.splice(2,1); console.log(nums); I know it looks a bit silly but, hey, I got the answer. Obviously, if there is more than one duplicate, then the Set works fine.
@sanchit5764
@sanchit5764 3 жыл бұрын
good for interview practice in Javascript Frontend
@Techsithtube
@Techsithtube 3 жыл бұрын
Thanks for watching!
@mechmaverick
@mechmaverick 3 жыл бұрын
i subbed at spreadOperator .(GJ) :)
@Techsithtube
@Techsithtube 3 жыл бұрын
Thanks for watching!
@sureshmg6786
@sureshmg6786 4 жыл бұрын
Day by day am becoming a pro developer watching your videos :)
@FatsFalafel
@FatsFalafel 4 жыл бұрын
If an employee asked me some of these questions in manner of practical application I probably wouldn't want the job.
@Techsithtube
@Techsithtube 4 жыл бұрын
Bailar, Seldom but people do ask these kinds of silly questions. But yeas if someone asked me such questions, I would not work there.
@mehmetedex
@mehmetedex 4 жыл бұрын
I programmed in all languages listed below and avoid coding in js because it disgust me to deal with it. Never had similar feelings towards none of those languages. edit: every new update I check js's changelog for a hope, but nope js's legacy weird parts continues to live ordered by time spend dart swift matlab python c / c++ c# php bash java kotlin go sql rust lua typescript ruby vbscript prolog action script assembly perl R fortran f# obj-c
@philllearn5993
@philllearn5993 3 жыл бұрын
You are amazing and all, BUT, why are you saying METHOR, and not METHOD? It ends with a D, not with R... It drives me crazy 😅
@j03Biz
@j03Biz 5 жыл бұрын
This seems more of a what you "don't know about javascript" rather than what you "do know about javascript", and if we use ("don't know" === "do know") the answer will always be false because we learn things differently than a computer does about programming.
@kwoowoo828
@kwoowoo828 4 жыл бұрын
I always wonder what is the mindset of interviewer who ask difficult and tricky questions in interview. Is it to show to the interviewee that I (the interviewer) am better than you? That you are joining a "Great" company that will "teach" and "educate" you? These tricky question is a show of my superior intelligence to establish my position of authority? Most of the time, it is exactly this mindset (I have personally have sat among numerous panel of interviewers and being plugged in to their personality knows what is motivating their action). Then the question is why are you employing people who is inferior to you? What are you trying to achieve for the company? Does knowing all the obscure stuffs that majority of interviewee don't know make that one interviewee more superior? Does those obscure stuffs used frequently and critical to the success of the company? Imho, the mindset and attitude of the people you employ is more important that what he knows at the point of interview. Knowledge can be picked up and skill set can be honed. Mindset and attitude however is difficult to mold and tend to persist throughout a person's life. If you employ someone like the interviewer who is fond of asking tricky and difficult question, even though he knows ALOT, your company will never grow beyond the capability of that one interviewer's level because he is not comfortable to admit people who are more capable than him. I personally have lived through all these and I tell you that one interviewer is the biggest stumbling block to the company's growth in capability because no one can be better than him. Those who can successfully answer his tricky and difficult question are rejected while those who cannot, are admitted.
@avr9066
@avr9066 6 жыл бұрын
Nice one. Thank you for uploading
@subhasism1890
@subhasism1890 6 жыл бұрын
Sir please make a tutorials on complete nodejs like multar, body parser, jwt, files handling etc
@Techsithtube
@Techsithtube 6 жыл бұрын
Sure . I have a plan for node tutorials.
@codelucky
@codelucky 5 жыл бұрын
@@Techsithtube Have you made one? And yeah I just subd you.
@sudhakard1910
@sudhakard1910 3 жыл бұрын
Just wanted to know for suppose the candidate not come across these type of scenarios, would be really dis-qualify him, because that guy might be knowing something which we don't know.
@samyethio
@samyethio 5 жыл бұрын
would I be wrong if I said, " nums.splice(2, 1);" for the 2nd question? you said not to use some methods, I do know which one you meant. this is one line so it should give us the desired result.
@Techsithtube
@Techsithtube 5 жыл бұрын
you can use splice. what I mean, trying out new things that you dont know may not know in an interview is a danger.
@vidyashevale2904
@vidyashevale2904 5 жыл бұрын
Very important tutorial for fresher as well as experience person
@sibashishpadhy1569
@sibashishpadhy1569 Жыл бұрын
I have no words to thank you sir.... it's really really very helpful and your explanation is great🙏🙏🙏
@anupal779
@anupal779 2 жыл бұрын
Q2--Remove duplicate from array Ans:- arr2 = [...new Set(arr)];
@bronzekoala9141
@bronzekoala9141 3 жыл бұрын
6:23 Gosh JS is just a beautiful language isn't it.... ...
@sampa6722
@sampa6722 3 жыл бұрын
best explanations in most of the tutorials
@Techsithtube
@Techsithtube 3 жыл бұрын
Thanks for watching!
@rishabhchopra883
@rishabhchopra883 2 жыл бұрын
Great video. Each question taught me a concept I barely knew. Thanks for this gem !!!
@Techsithtube
@Techsithtube 2 жыл бұрын
Glad it was helpful!
@TheEricapiano
@TheEricapiano 5 жыл бұрын
Thank you for saying hi girls :)
@AleksandarIvanov69
@AleksandarIvanov69 4 жыл бұрын
Guys is colloquial for people, so basically he said "people and girls". Weird to say, but factually accurate.
@bronzekoala9141
@bronzekoala9141 3 жыл бұрын
@@AleksandarIvanov69 Now that's some next level Neckbeard and fedora comment right there :D
@AleksandarIvanov69
@AleksandarIvanov69 3 жыл бұрын
@@bronzekoala9141 which is slang in millenial for "i am clueless, but i feel the strong need to be passive aggressive, cause my dad didn't love me" :D
@bronzekoala9141
@bronzekoala9141 3 жыл бұрын
@@AleksandarIvanov69 I think you confused millenial with Generation Z there but I get the Idea Sir.
@lohithayalavarthi7362
@lohithayalavarthi7362 5 жыл бұрын
Hi Its great thanks for teaching too instead of only giving the answers, You are letting us think, Great thanks for the videos. And if you have video on spread operator do let me know I was asked this in one of my Interview I have an obj ={ name :" likitha",age : 30 } if you want to change the name property alone to be modified ,you can use spread operator { name: "lohitha" ,...obj} ->this is the answer anyways -> {name : "likitha"} ,but I had no idea of how spread can work in different ways how do they come up with this , I know the spread operator but I am not aware of this option ..,Please do let me know..
@Techsithtube
@Techsithtube 5 жыл бұрын
I have a tutorial on applications of spread operator. THere I explain a lot about it. Please check it out.
@lohithayalavarthi7362
@lohithayalavarthi7362 5 жыл бұрын
@@Techsithtube sure
@prathibhad8021
@prathibhad8021 4 жыл бұрын
Hi, can you please provide the JavaScript videos . I am a beginner in JavaScript
@game-x4005
@game-x4005 3 жыл бұрын
Hello and welcome to 'sexy' (techsith) tutorial. This might be the reason
@sudhakard1910
@sudhakard1910 3 жыл бұрын
Questions are good to crack and debate with someone, but tell me the concepts of selecting a person. On what basis we should select or reject them.
@zes3813
@zes3813 3 жыл бұрын
no such thing as trickyx or interviewx or rightx etc or not, cepu, do, say any no matter what and any s perfect, idts
@scubemovies
@scubemovies 4 жыл бұрын
Wav. Subscribed
@codebite983
@codebite983 2 жыл бұрын
you are too good at explaining . how do you do this ! i understand even if it not understandable..........
@ayoubdouch6975
@ayoubdouch6975 11 ай бұрын
The job interview cant be hard . Techsith: hey 😊 Me: 😭😭😭
@dayanandsingh8456
@dayanandsingh8456 2 жыл бұрын
Hi sir .. can you take my interview on JavaScript and reactjs..
@roastedchicken7254
@roastedchicken7254 3 жыл бұрын
I was asked the output of this in an interview: var arr = [1,2,3,4] for(var i=0;i { console.log("Index is: ", i) }) } - Notice the time interval isn't passed in the setTimeout function. Output turned out to be 4 times "Index is 4" . Can anyone help me understand this.
@Techsithtube
@Techsithtube 3 жыл бұрын
Because variables defined by var keywords have function scope it doesnt respect blocks scope. for loop creates a block scope and that is why its the same variable gets updated so you get 4 every time because of the closure.
@LucianoClassicalGuitar
@LucianoClassicalGuitar Жыл бұрын
for the second question can't you just do: delete nums[2]; ???
@mitesh5189
@mitesh5189 Жыл бұрын
for this specific instance you can do it but in real development you won`t able to see whats input and all that.
@shivangchaturvedi237
@shivangchaturvedi237 3 жыл бұрын
Bravo! :P
@chaitanyamc
@chaitanyamc 4 жыл бұрын
That's why I prefer Kyle Simpson books
@MobiusCoin
@MobiusCoin 4 жыл бұрын
I hate that first question. It's just dumb trivia. This isn't what the job is about.
@haul_network
@haul_network 3 жыл бұрын
time 11:45 can't we declare profile as const, instead using freeze?
@aanchalsharma8362
@aanchalsharma8362 3 жыл бұрын
I wonder if questions like these are a good way to judge someone's knowledge, I mean how would anyone know what Math.max() will return (unless he/she has tried doing this with every available method) and why does it matter? :D
@Techsithtube
@Techsithtube 3 жыл бұрын
Aanchal, as a javaScript developer you need to know most of the methods that allows you to help with functionality.
@MrB_eastt
@MrB_eastt 5 жыл бұрын
Thank you so much for the video... helped me a lot.
@zhenwang7380
@zhenwang7380 5 жыл бұрын
14:00 based on the mdn doc, Object.defineProperty's writable defaults to false already developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty#Description.
@rahulkum2025
@rahulkum2025 4 жыл бұрын
After seeing one thing I m sure that javascript is a baseless language
@abhi8644
@abhi8644 4 жыл бұрын
Wish to sit infront of you and u can ask as many js question u cn. Ready to face to sir.
@shouvikdutta2825
@shouvikdutta2825 5 жыл бұрын
You write retur not return.
@Techsithtube
@Techsithtube 5 жыл бұрын
Shouvik, I am getting old ... sorry for that.
@Vivekkanoje1989
@Vivekkanoje1989 5 жыл бұрын
I known about "IIFE" but i was unable to think use it here. Sometimes it goes this way i could not think likewise so can you please suggest me, how can i improve myself ?
@Techsithtube
@Techsithtube 5 жыл бұрын
vivek , I have a tutorial on IIFE that explains it in much more details. Please check it out. that might help
@sayyadmukhim1407
@sayyadmukhim1407 Жыл бұрын
let obj = { name: 'Patel' } __proto__:obj; obj.name='Patel1'; console.log(obj);
@prasanthpalani4758
@prasanthpalani4758 5 жыл бұрын
Hi. Thanks for doing such a great job. One small doubt, i have tried to call the below method in JavaScript stackblitz, it returns null. Math.max(). I don't know why and How?
@Techsithtube
@Techsithtube 5 жыл бұрын
that is strange. it should give you -infinite , perhaps its doing some sanitization. have you tried on other platforms?
@kamleshkumar-vm8cj
@kamleshkumar-vm8cj 3 жыл бұрын
Focus on better explanations instead of spoken speech..
@zhenwang7380
@zhenwang7380 5 жыл бұрын
6:16 is the {} outside the self-invoked function really needed? I tried without the {} and still, v is not defined. Nothing different from having {}. @techsith thanks
@Techsithtube
@Techsithtube 5 жыл бұрын
You can write either way actually. IIFE has multiple formats.
@afaque.
@afaque. 4 жыл бұрын
I felt stupid but I am going to subscribe anyway
@xiaogangyang1045
@xiaogangyang1045 5 жыл бұрын
I would have to say, these are all basic and common questions during Chinese Internet Company interviews. The suggestion is that you need to read the book Professional Javascript.
@rubenverster250
@rubenverster250 5 жыл бұрын
xuexue
@vikasshelake6321
@vikasshelake6321 4 жыл бұрын
excellent video
@leonkane7892
@leonkane7892 5 жыл бұрын
Isn't 4:03 the rest operator? It takes multiple elements and forms an array.
@oleksandrkovalov1543
@oleksandrkovalov1543 4 жыл бұрын
nope.. there is no such thing as 'rest operator' , there is a 'rest parameter'. visually it looks similar to 'spread' operator, which is in fact an operator..
@charuhas1602
@charuhas1602 3 жыл бұрын
Thanks Sir for this video ... it really help us
@saroshahmed7097
@saroshahmed7097 3 жыл бұрын
Give your 2nd KZbin channel link??
@mparikshit
@mparikshit 4 жыл бұрын
For Q2 - is it new Set(Array)?
@Techsithtube
@Techsithtube 4 жыл бұрын
Yes, That is right. however new Set(Array) would give back a Set so we need to convert it back to the array.
@mparikshit
@mparikshit 4 жыл бұрын
techsith thank you. I’m trying to pause and answer the questions. Was able to go through only 2 questions only.
@journiqeducacao91
@journiqeducacao91 2 жыл бұрын
I've been watching u for a while now, and your didactics (and thumbnails) are the best. Subscribed!
@philsitumorang
@philsitumorang 2 жыл бұрын
Thank you so much for these tricky things! Reallly useful.
@DavidFregoli
@DavidFregoli 3 жыл бұрын
I hope no recruiter ever watches this video, this is a horrible way to select for a hire. If someone asks me stuff like this I'd laugh at his face and leave.
@Techsithtube
@Techsithtube 3 жыл бұрын
I agree with that. Unfortunately some people ask this kind of silly question so they can feel superior.
@subhasism1890
@subhasism1890 6 жыл бұрын
Great video sir.. Please keep posting such contents
@akashpotdar6841
@akashpotdar6841 5 жыл бұрын
Amazing content..! Question: Whats the difference between object.freeze and const?
@Techsithtube
@Techsithtube 5 жыл бұрын
const wont let you replace the entire value of the object. with Object.freeze you can not change value of object properties. good question
@nreyntje
@nreyntje 2 жыл бұрын
Your second answer is wrong!! At least I think so. Set does not keep order! No? So you would get a random order.
@nreyntje
@nreyntje 2 жыл бұрын
I do like your video, gave you a thumbs up :)
@achalchoudhary9864
@achalchoudhary9864 4 жыл бұрын
Hello sir, Have you created videos in nodejs?
@eyesxavdalyan3230
@eyesxavdalyan3230 3 жыл бұрын
Bro, wtffffff why programmer have a light ide
@venkatraja443
@venkatraja443 6 жыл бұрын
var hero={ name:'John Doe', getSecretIdentity:function(){ return this.name; } } stoleSecretIdentity=hero.getSecretIdentity; console.log(stoleSecretIdentity()); console.log(hero.getSecretIdentity()); I want the same output of hero.getSecretIdentity() to stoleSecretIdentity(). How to fix this? this is my interview question? I tried a lot . but i can't find out the result please help me
@Techsithtube
@Techsithtube 6 жыл бұрын
You need to bind the method back to hero. here is the code. let hero = { name: 'John Doe', getSecretIdentity: function() { return this.name; } } let boundStolenSecretIdentity = hero.getSecretIdentity.bind(hero); console.log(boundStolenSecretIdentity());
@venkatraja443
@venkatraja443 6 жыл бұрын
What is symbol in datatype?
@fazahmed4028
@fazahmed4028 4 жыл бұрын
I always try to get Why part of the answer. It makes me better developer and good at what I do at work. Its shame most people watch these tutorials for jobs! not become better.
@NuncNuncNuncNunc
@NuncNuncNuncNunc 4 жыл бұрын
Thank heaven's for Typescript. There was only one of these I got without thinking
@Techsithtube
@Techsithtube 4 жыл бұрын
Yes TypeScript is a blessing.
@subham-raj
@subham-raj 5 жыл бұрын
The second question would still take O(n) Time and space complexity, not using forloop doesn't mean that you improved it.
@SurendraGurjar2014
@SurendraGurjar2014 4 жыл бұрын
helpful
@sm4573
@sm4573 4 жыл бұрын
thank you... if you teach JavaScript let me know.Thanks.
@arcosd63
@arcosd63 2 жыл бұрын
Great video! You're a very good instructor and easy to understand as well.
@veersrivastav
@veersrivastav 4 жыл бұрын
Pinged you on Facebook. Let's connect.
@HIghtowerSever
@HIghtowerSever 4 жыл бұрын
Soon, very soon you'll see the SILVER BUTTON!
@Techsithtube
@Techsithtube 4 жыл бұрын
Adel, Silver Button is one month away, ;) Thanks for watching.
@mdshoaibAlamgcetts
@mdshoaibAlamgcetts 5 жыл бұрын
An interviewer asked me to write a pseudo code for algo. I need a play song from playlist in random way in such a way that below condition 1. none of song repeat. 2. once all the song played then repeat again random process. can someone please suggest what would be the optimal solution for this approach?
@Techsithtube
@Techsithtube 5 жыл бұрын
very good question. basically you create an array with songs let songs = ['a', 'b','c','d'] then you create another array for the random songs. let rand = []; pick random number between 0 - 3 since you have 4 songs. move that index from songs to rand so now your songs have three entries. again pick from 0-2 and move that song at that index from songs to rand. and keep doing it until all the songs are moved. then play all the songs from rand which will in the random order, once you are done move them back to songs and empty the rand and then repete the process.
@mdshoaibAlamgcetts
@mdshoaibAlamgcetts 5 жыл бұрын
@@Techsithtube thank you so much sir . This is very solution .
@sirens003
@sirens003 6 жыл бұрын
// Keep in kind that Object.freeze(object) method is a "Shallow Freeze"! let obj = { name: 'Rango', address: { street: '33 eastbound', city: 'Toronto' } } Object.freeze(obj); obj.address.city = 'Montreal'; console.log(obj); // You will see the 'city' has been changed to 'Montreal'. // As, Object.freeze() method is a "Shallow Freeze" which will only protect upto one level deep. Hence, deeply nested Objects within that can still be modified.
@Techsithtube
@Techsithtube 6 жыл бұрын
Yep. Good solution.
@nid274
@nid274 2 жыл бұрын
this is exactly why JS is wildly wierd 😇😇
@Mr_Pandita
@Mr_Pandita 5 жыл бұрын
You don't know anything about what to do with your life? Well, I've got a video on that. :|
@Vivekkanoje1989
@Vivekkanoje1989 5 жыл бұрын
The unique values in new array can be achieved by Set object and spread operator as following, const numbers = [1,2,2,3]; let uniqueNumArr = [... new Set(numbers)]; console.log("Unique Array : ", uniqueNumArr);
@Techsithtube
@Techsithtube 5 жыл бұрын
Yep that is the shortest way of doing it. :)
@DamianNAudio
@DamianNAudio 4 жыл бұрын
Reason behind "arguments" not working with arrow functions is that they take the scope of a parent block :3 so it actually shows parent function's arguments
@MahmudYuldashev
@MahmudYuldashev 4 жыл бұрын
Your thumbnail in video gives away your image- you are Jimmy, Jimmy, Haja, Hajaa.....
@Techsithtube
@Techsithtube 4 жыл бұрын
:) No one explained it like that before.
@MahmudYuldashev
@MahmudYuldashev 4 жыл бұрын
@@Techsithtube can I call you Jimmy?
Tricky JavaScript interview questions and answers
21:01
techsith
Рет қаралды 133 М.
Top 100 JavaScript Interview Questions and Answers
3:00:42
Interview Happy
Рет қаралды 306 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 261 МЛН
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 119 МЛН
Do you choose Inside Out 2 or The Amazing World of Gumball? 🤔
00:19
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 56 МЛН
Async Await JavaScript ES7
26:39
techsith
Рет қаралды 120 М.
Angular Interview Questions and Answers - Dominate Your Next Interview
49:13
Monsterlessons Academy
Рет қаралды 26 М.
Top Tricky JavaScript Interview Questions and Answers
15:42
techsith
Рет қаралды 82 М.
Beginner React.js Coding Interview (ft. Clément Mihailescu)
36:31
Ben Awad
Рет қаралды 2,1 МЛН
Mock Technical Interview - Javascript Developer Entry Level
1:36:22
Tech with Nader
Рет қаралды 501 М.
Top 100 React JS Interview Questions and Answers - HINDI
3:59:13
Interview Happy
Рет қаралды 93 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 261 МЛН