Тёмный

JavaScript Mock Interview | Online Interview Questions and Answers (Part 2) 

techsith
Подписаться 147 тыс.
Просмотров 47 тыс.
50% 1

Online Technical Mock Interview of one of my viewers. It's a skype interview Where I ask JavaScript Fundamental Questions and give their answers.
If you like to be mock interviewed, email me at
* info@interviewnest.com
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.
Answers:
1) Find Missing Number
jsfiddle.net/x...

Наука

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

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 174   
@GmoneyMozart
@GmoneyMozart 6 лет назад
I'm convinced the more you pump out content the bigger your channel will get because you've been under-sub'd now for a long time. Keep up the great work!
@Techsithtube
@Techsithtube 6 лет назад
Gmoney, recently my subscribers have gone up but only 10%. Hopefully, I can cross 100k by end of this year.
@eminm6383
@eminm6383 4 года назад
This mock interview series are really useful and unique. Well done techsith. I really don't understand who dislikes this :|
@hatrick3117
@hatrick3117 6 лет назад
I'm so excited about this series! Thanks to you and contributor!
@demian5511
@demian5511 5 лет назад
I tried to write higher order functions like reduce myself. This is what I came up with: function myReduce(arr,cb){ let sum = 0; for(let i = 0; i < arr.length; i++){ sum = cb(sum,arr[i]); } return sum; } Then I call it like this: let sum = myReduce([1,2,3,4,5], (sum, el)=> { return sum + el; }) I also wrote filter and map functions in a similar way. Really helped me boost my overall understanding.
@Techsithtube
@Techsithtube 5 лет назад
That is very important that you tried things and solved problems.
@AmanJainVlogsss
@AmanJainVlogsss 3 года назад
this man sparked my interest in coding....thanks al lot for such interesting content
@devolee8302
@devolee8302 5 лет назад
I can totally relate to the interviewee. It is so easy to get out of practice with logic just working on frame works day to day which is why this video is so awesome..
@Techsithtube
@Techsithtube 5 лет назад
Dev I agree, its hard to be in that seat. :)
@lordknighton
@lordknighton 4 года назад
This is exactly why Im watching because I get out of practice with JS logic from messing with Libraries and frameworks and trying to keep up with all the latest and greatest.
@davidwoosley
@davidwoosley 5 лет назад
Here's a cute trick to find the missing number in the array, and it doesn't even matter if the array is sorted. const arr = [1,2,3,4,6,7]; // 5 is missing const max = arr.length + 1; const reducer = (a,b) => a + b; const total1 = max * (max + 1) / 2; // Math trick! const total2 = arr.reduce(reducer); const missingNumber = total1 - total2; console.log(missingNumber); // Output will be 5
@danielluna7648
@danielluna7648 3 года назад
I love this series. Subscribed especially for these.
@codewithmarwan
@codewithmarwan 4 года назад
This is an absolute quality content.
@arunkaiser
@arunkaiser 5 лет назад
Guy who is giving an Interview is very knowledgeable person
@janakpoojary5473
@janakpoojary5473 3 года назад
for the second question to get the missing number you have to return ary2[i]-1 instead of ary2[i] because if let us say 7 was missing then ary2[i] would be 8. Anyways the difference of sum part was genius!
@ambicabassetty4482
@ambicabassetty4482 5 лет назад
Thank you for all your efforts in making this series and educating us :)
@Techsithtube
@Techsithtube 5 лет назад
Thank you Ambica for watching. Keep on learning! :)
@juliaitbaeva8530
@juliaitbaeva8530 4 года назад
Nice question about owned coins 👍 , i think it's about greedy algorithms
@Techsithtube
@Techsithtube 4 года назад
I think so too
@Mayankkumargeek
@Mayankkumargeek 3 года назад
For 1 number missing from 1...100 I thought the exact thing which @techsith suggested. The total sum of 1..100 and then subtracting it by presently available array and u have the answer. Great My mind is working now. Hopefully will be able to crack by the Coding round at PayTm now!
@dipeshranavlogs
@dipeshranavlogs 4 года назад
For missing number in array, you can just use includes method with a for loop... Its also simple
@javascriptpoint7603
@javascriptpoint7603 3 года назад
But brother , it's complexity will become n2 square.
@saikrishna8899
@saikrishna8899 3 года назад
q3) find the missing number const missingNum = (arr) => { const len = arr.length+1; const sum= (len*(len+1))/2; // using sum of natural numbers formula const arrSum = arr.reduce((s,c)=> s+c,0); return sum-arrSum; }
@shilpidhiman8684
@shilpidhiman8684 3 года назад
Amazing series...please make more videos like these
@Techsithtube
@Techsithtube 3 года назад
I do have many videos like this. there are multiple parts. do check it out by searching on mock interview on my channel
@harrisli8820
@harrisli8820 5 лет назад
const set = [...new Set(arr)]; //You know its 1-100 missing one number, and it works without sorting.// for (let i=1; i
@kivylius
@kivylius 4 года назад
just to note that its quite slow solutions, the new Set is a is 100 loops and the for loop again 1-100 times and the includes is also 1-100 times. quite slow.
@akeelmughal6098
@akeelmughal6098 4 года назад
This was my solution - for (var i = 0; i < arr.length; i++) { if (arr[i] !== (i + 1)) { console.log('Missing number:', i + 1); return; } };
@yevheniikulynych6041
@yevheniikulynych6041 4 года назад
the last task was simple for me, something like: let str = "i love javaScript"; str.split(' ').map(e => e.split('').reverse().join('')).reverse().join(' ');
@Techsithtube
@Techsithtube 4 года назад
Thanks for sharing your solution
@asimgiri4269
@asimgiri4269 4 года назад
const result = input.split("").reverse().join(""); That's it.
@WasimKhan-0801
@WasimKhan-0801 6 лет назад
The finding missing number in array. One possible solution is using indexOf condition in a loop and return value of index if get -1
@kirru4
@kirru4 4 года назад
thanks for this series. it helps every js developer.
@sudhansurana7677
@sudhansurana7677 6 лет назад
i should have visited this beforehand. so much informative.
@razvancarp7999
@razvancarp7999 6 лет назад
Thanks, my friend! You are the best teacher!
@carltonmcfarlane_64
@carltonmcfarlane_64 4 года назад
Trying to prep for my first ever technical interview and this series has been so valuable. Easily the best thing I've watched (in terms of gaining confidence and identifying gaps in my knowledge). Thank you! Would you consider bringing this series (or similar ones) back?
@Techsithtube
@Techsithtube 4 года назад
Glad it was helpful! Best luck with your interviews. Practice , Practice, Practice!
@carltonmcfarlane_64
@carltonmcfarlane_64 4 года назад
@@Techsithtube I passed the tech interview! Thank you again for the help - will definitely recommend these videos and your channel! 👍🏽
@md.salahuddinbhuiyan3224
@md.salahuddinbhuiyan3224 3 года назад
const ary = [1, 4, 7, 3, 6, 2, 5, 9]; const ary2 = ary.sort((a, b) => a - b); let len = ary2.length; let total = (len + 1) * (len + 2) / 2; let aryTotla = ary2.reduce((t, i) => (t + i)); console.log(ary2); console.log(total - aryTotla);
@deepakpai0796
@deepakpai0796 5 лет назад
This series is really very helpful. Thanks .
@Andhere-Ki-Aahat
@Andhere-Ki-Aahat 3 года назад
For missing number taking exor will be the best approach
@lordknighton
@lordknighton 4 года назад
Please keep bringing out content like this! Great work
@aezius2644
@aezius2644 5 лет назад
Question with the array, watched till 10:00. Pretty exiting series; var x = [1,2,3,4,5,7,8,9,10]; var y = x[0] + 1; for (let i = 0; i
@antonvoltchok7794
@antonvoltchok7794 5 лет назад
I’m pretty sure that let or const even if assigned to a function will not get hoisted and the variable of the function will not initially be undefined, instead it will evaluated where is, almost positive all hoisting is avoided with those es6 keywords
@mohitmittal9901
@mohitmittal9901 3 года назад
it ll be in TDZ
@manastripathi2407
@manastripathi2407 4 года назад
find missing number alternative code: // making an array with all the numbers (not necessary if we simply loop with increments while checking let dummyArr = []; for (let i = 0; i < 10; i++) { dummyArr[i] = i + 1; } quesArr = [10, 2, 8, 4, 9, 6, 3, 5, 1]; // missing num is 7 let found; let quesStr = String(quesArr); // convert the question array into a string dummyArr.forEach((item) => { if (!quesStr.includes(String(item))) { found = item; } }); console.log(found);
@utkarshkukreti239
@utkarshkukreti239 4 года назад
I think in the solution to first problem where reduce method was used, there should be an initial value of accumulator to be passed as a second argument to the anonymous arrow function inside of the reduce method. ex: arr.reduce((acc, el) => { acc + el; }, 0);
@ToddDunning
@ToddDunning 3 года назад
20 years in front end and I wouldn't be able to even think of patterns for any of this, or the math operations. Never encountered any of it I guess.
@bapinmalakar3846
@bapinmalakar3846 6 лет назад
mis= arr.length*(arr.length+1)/2 for (item of arr) mis-=item Console.log(mis)
@bapinmalakar3846
@bapinmalakar3846 6 лет назад
Questions was not so much good as part1
@maahasgharali571
@maahasgharali571 2 года назад
Please do more of these videos. Subscribed :)
@ManojSingh-of5ep
@ManojSingh-of5ep 3 года назад
my answer for third question let obj = {} arr.map(item=>{ obj[item]=item; }) let res; for(let i=1;i
@rameshbhattarai8053
@rameshbhattarai8053 4 года назад
let sum =0 const arr = [1, 2, 5, 4,]; let n = arr.length+1; let totalS = n*(n+1)/2; for(var i = 0; i
@ManOnHorizon
@ManOnHorizon 6 лет назад
For real: I clenched my fists while watching this and yelled "Return! You forgot 'return'!" making me look insane & stupid in front of my colleagues. Keep up the good work =)
@Techsithtube
@Techsithtube 6 лет назад
I know its easy to say but when I am on a hot seat, its very difficult to focus. :)
@ManOnHorizon
@ManOnHorizon 6 лет назад
What I meant is I was really worried about the guy (even though I knew that he isn't going to get a job or anything). Both parts are really interesting to watch. You're inventing a new genre of youtube-video =)
@zainsyed9811
@zainsyed9811 6 лет назад
const arr = [1,2,5,4,9,3,7,8,6,10,12]; missingNumber(arr); function missingNumber(arr) { arr.sort(function(a,b){return a - b}); for(var i=0; i< arr.length; i++) { if((arr[i] - i) > 1) { console.log("missing number is " + (i+1)); break; } } }
@Techsithtube
@Techsithtube 6 лет назад
yes that is one of the right solution. I also have few other solution , please look in the description of the video.
@zainsyed9811
@zainsyed9811 6 лет назад
techsith thanks for the awesome videos! Really great stuff
@INSTARAVI
@INSTARAVI 6 лет назад
for problem at 12:00, ary.findIndex((a)=>a == undefined)
@saurabhvaidya4228
@saurabhvaidya4228 6 лет назад
O(n^2)
@itspravas
@itspravas 5 лет назад
there is a small mistake. const len = ary.length + 1; because if a number is missing from the array, then if its added back to the array then the total number of elements will be increased by one hence the length will be increased by one.
@deepaks.m.6709
@deepaks.m.6709 6 лет назад
38:13 _MY_ANSWER_ Another one :D // Function to reverse the given string const reverseString = (str) => { let reverseStr = str.split('').reverse().join(''); // We can also loop to reverse the string return reverseStr; } reverseString('Die hard JS Code'); //RESULT "edoC SJ drah eiD" Note: That Cashier problem is kinda tricky, so i ended up watching your solution for it. LOL :D
@UtuberM
@UtuberM 3 года назад
A one liner using ES6: [... "I love Javascript"].reverse().join('') returns "tpircsavaJ evol I"
@SumitSharma-vc8ci
@SumitSharma-vc8ci 6 лет назад
Yeah happy coz I also applied the same logic that you used to find the missing number. From an array😇
@briannag8682
@briannag8682 3 года назад
Lol my answer is weird but it works . I did let d = array[0] + array[1] + array[2] + array[3] console.log(d) ;
@vijayshankartiwari8711
@vijayshankartiwari8711 5 лет назад
Var array=[1,2,7,6,4,5] For(let i=1;i=
@Techsithtube
@Techsithtube 5 лет назад
That is a good solution
@vijayshankartiwari8711
@vijayshankartiwari8711 5 лет назад
@@Techsithtube thanks man I was just watching your mock interview video.. never thought you would reply.. let me know if you are starting the mock interview series again..
@demian5511
@demian5511 5 лет назад
I think the solution to the last question with str.split.reverse.join is less efficient because it actually runs for loop three times. Better solution in this case is: function reverseStr(str){ let reversed = "" for(let i = str.length-1; i >= 0 ; i--){ reversed += str.charAt(i); } return reversed; } It runs a for loop only once. Correct me if I missed something...
@Techsithtube
@Techsithtube 5 лет назад
Yes that is a better solution?
@MultiChinglish
@MultiChinglish 6 лет назад
Thank you so much for this series!!
@anupal779
@anupal779 3 года назад
For one to hundred array question its pretty simple i think, just calulate the sum from one to hundred and then substract the sum of all the array elements.
@RaghuramanKanchi
@RaghuramanKanchi 6 лет назад
Quite interesting idea... Thanks for this. Why not run the code and show the results for the viewers convenience?
@Techsithtube
@Techsithtube 6 лет назад
My next video i try to do that so that viewers can see the result.
@LeyouHong
@LeyouHong 4 года назад
25:22. leetcode 322, coin change. dp or dfs+memo
@maxwelljann5462
@maxwelljann5462 6 лет назад
function missing(arr){ for(var i = 1; i < arr.length; i++){ if(arr[i] +1 != arr[i+1]){ return arr[i+1]-1; } } }
@simon_situ
@simon_situ 5 лет назад
does this work on an unsorted array?
@balavijay
@balavijay 5 лет назад
@@simon_situ It has to be a Sorted array & series 1,2,3,4....
@cyberprompt
@cyberprompt 5 лет назад
took me a few hours of thinking and rethinking the tiil / change logic but I knew I had to convert everything to pennies first, and know there was enough or not then move onto the next smaller denomination.
@Techsithtube
@Techsithtube 5 лет назад
There are multiple solutions to this problem . you can also use dynamic programming. but converting to pennies also works.
@kumjipark9360
@kumjipark9360 3 года назад
I think the second question should include a constraint that the number values aren't zero.
@mustafakemaltuna
@mustafakemaltuna 4 года назад
07:01 this is not work correctly when you call x(1,0); you need to check argument count with arguments.length property because 0 is falsy value and you can not use AND operator this way to check arguments count.
@durairajrajendiran9725
@durairajrajendiran9725 5 лет назад
Missing number in array my solution let a = [ ], b; //array pushing for(let i = 1; i
@rakeshgowda4056
@rakeshgowda4056 5 лет назад
function missing(arr){ for(var i=1;i
@Techsithtube
@Techsithtube 5 лет назад
That would work! :)
@derrisrasaiyah
@derrisrasaiyah 4 года назад
const ary = [8, 1, 10, 6, 2, 3, 7, 9, 4] //this is unordered array and one number is missing. find that missing number const sortedAry = ary.sort((a, b) => b - a) sortedAry.forEach((value, index, self) => { var diff = self[index - 1] - self[index]; if (diff >= 2) { console.log(value + 1) // 5 } })
@devolee8302
@devolee8302 6 лет назад
Thanks techsith for these amazing series! It really helps to see what I am missing as a developer.
@ivaibhavarya
@ivaibhavarya 4 года назад
@19:20 I could the difference is : Function written within Line 2-4 is a Normal function, not supposed to be instantiated with new Keyword. Function written within Line 6-8 is a Constructor function, supposed to be instantiated with new Keyword. Please correct me If I'm mistaken differentiating that way.
@Prakhar281993
@Prakhar281993 4 года назад
Both are normal functions. First is function declaration which is traditional way of defining function. Second is Function expression. Both works the same way except function declaration gets hoisted whereas function expression does not.
@RakeshKumar-ee7vq
@RakeshKumar-ee7vq 6 лет назад
You really great teacher.
@ManOnHorizon
@ManOnHorizon 6 лет назад
Really exciting! (no sarcasm) Please, keep doing this =)
@ketankulkarni2675
@ketankulkarni2675 6 лет назад
very useful.thank you
@CodeAura
@CodeAura 4 года назад
I was asked the coin problem in my interview too
@theguptamadhur
@theguptamadhur 4 года назад
Nice work
@bhatnagarcapital
@bhatnagarcapital 3 года назад
thank ts
@hamidrezakazemi7746
@hamidrezakazemi7746 6 лет назад
thanks a lot, wait for more. do next one sooner please.
@Techsithtube
@Techsithtube 6 лет назад
I am plan to release more videos. Keep an eye on it by subscribing.
@adityadhawane9437
@adityadhawane9437 3 года назад
For the Missing no. problem at 17:01 , My solution -> console.log(arr.reduce((a,b)=>{ if(a-b!=0) return b-1; }));
@Techsithtube
@Techsithtube 3 года назад
Thanks for sharing!
@LawZist
@LawZist 6 лет назад
MORE OF THIS!!!
@vijaybhorkhade4041
@vijaybhorkhade4041 5 лет назад
function add(a, b) { return a && b ? a + b : function (c) { return a + c; } }; console.log(add(1,2)); //3 console.log(add(1)(2)); //3
@Techsithtube
@Techsithtube 5 лет назад
short and sweet.
@tejasmehta
@tejasmehta 2 года назад
Hey! This is great… but maybe I am missing something? I don’t understand what “c” is referencing to in this.
@srinivasanr6195
@srinivasanr6195 6 лет назад
TechSith Gaint i am pretty much confusion b/w webworkers vs websocket ... can you explain this topic and their difference please
@Techsithtube
@Techsithtube 6 лет назад
very different concepts. WebSockets allows persistent two-way communication over a single connection. Ideal for long-polling such as chat apps. Webworker allows you to simulate multithreading in js so certain processes can run in the background. I do have a tutorial on webworkers if you want to know in details. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-pMK-jcOAYI8.html
@srinivasanr6195
@srinivasanr6195 6 лет назад
Thank you very much ...
@hokhyt
@hokhyt 6 лет назад
techsith thank you for your awesome contents, but can you a video on we services? I'm quite confused,
@trymysolution9831
@trymysolution9831 6 лет назад
can i have a video on WebSockets also please...
@SurajAgarwaladad
@SurajAgarwaladad 6 лет назад
Sir please make a video on type of UI questions that can be asked to a fresher in the interview.
@Techsithtube
@Techsithtube 6 лет назад
Yes very important topic. I will keep this in mind for next video.
@balavijay
@balavijay 5 лет назад
Freshers or experienced some questions I ask is same. In fresher I expect to see candidate try n give a solution, for a experienced must give a optimal answer.
@deepaks.m.6709
@deepaks.m.6709 6 лет назад
8:21 _MY_ANSWER_ :D let arr = []; // Creating an array from 1-100 without a number in middle (here, it is 13) for(var i=100; i>=1; i--) { if(i === 13) {continue;} arr.push(i); } // Function to identify that missing number const showMissingNumber = (arr, limit) => { for(var i=1; i
@Techsithtube
@Techsithtube 6 лет назад
Right solution! I like how you created an array before searching for it. :)
@ManishGupta-ww8tg
@ManishGupta-ww8tg 3 года назад
Still people are asking those questions...hard to find these kind of videos...If he is associated with big brand then he will have at least double subscribers..
@ShaliniSingh-pc3fg
@ShaliniSingh-pc3fg 2 года назад
Hello sir m fresher now can you help me how I crack interview
@ra5898
@ra5898 4 года назад
Sir, I want to information about Webdavelapment, I have learned html5 css3 javascript bootstrap and angular so it required me to learn ajax and jquery kindly tell me I want to prepare to interview.
@viraldimention
@viraldimention 6 лет назад
cool videos. please make more.
@Techsithtube
@Techsithtube 6 лет назад
I am planning to release more such videos. thanks for watching Shivam!
@viraldimention
@viraldimention 6 лет назад
techsith your videos are very helpful. Thanks
@V9D_
@V9D_ 3 года назад
for(let i = 1; i
@user-sp9hp1tj7v
@user-sp9hp1tj7v 6 лет назад
I have a question: in a real interview for a front-end position how many questions about HTML/CSS/frameworks should I expect to be asked? Do front-end interviews usually focus more on JS or on HTML/CSS/frameworks? Could you do a mock interview with some common HTML/CSS/framework questions? Thanks!
@Techsithtube
@Techsithtube 6 лет назад
Usually, in an hour you have abut 7 to 8 questions. depending on two to three exercises .Yes i will create a mock interview video on HTML/CSS/framework. .
@facundocorradini
@facundocorradini 6 лет назад
That depends on the offered position, some offerings are more UI oriented (therefore more HTML and CSS) and some are more development-oriented, so they'll skip through HTML and CSS and go heavy on the javascript side. Framework questions are only expected in framework-related offerings, such as Angular developer, React developer, etc.
@sunjunme
@sunjunme 4 года назад
The coin problem solution in a horrible way :D const til = { penny: 12, nickel: 10, dime: 2, quarter: 12, dollar: 30 } //20.47 const coin_val = [0.01,0.05,0.1,0.25,1.00]; const get_coins = (amount, curr_coins, stage) => { if (amount { for (key in til){ til[key] = til[key] - change[key]; } } let change = get_coins(24.47, {}, 4); update_til(til, change); console.log("Change in minimum number of coins/notes is: ") console.log(change); console.log("Remaining coins/notes in the cash machine: ") console.log(til);
@jamilamini7807
@jamilamini7807 6 лет назад
please start a javascript coding challenge series thanks in advance
@Techsithtube
@Techsithtube 6 лет назад
Coding Challange? How you envision this series to be?
@jamilamini7807
@jamilamini7807 6 лет назад
give us coding challenges level-wise beginner intermediate expert and hints and resources to learn related topics (links to your videos) same as your interview series but more challenges and at the end you solve it the best way possible you know better it is just my opinion i really am confused learning javascript it is driving me crazy
@maelstrom57
@maelstrom57 3 года назад
The interviewee needs to learn how return statements work.
@deepaks.m.6709
@deepaks.m.6709 6 лет назад
Bro do you think, getting a Web Developer job is possible without a degree (but with good skills) in India ?
@Techsithtube
@Techsithtube 6 лет назад
I think its is very much possible. My be your first job might be difficult to get but once you get in. your second or third job should be based on your experience and no the degree.
@siteogra
@siteogra 6 лет назад
Skills and experience first
@anks21593
@anks21593 5 лет назад
at 19:46, is let function exp also hoisted? If var x= func () { } then only it'll be hoisted. Am I correct ?
@Techsithtube
@Techsithtube 5 лет назад
anything defined with let and const keywords are not hoisted.
@mustafakemaltuna
@mustafakemaltuna 4 года назад
15:02 this is completely false sir. array is sorted in descending order and loop index must start from zero and many more wrong things in here.???
@kristineximeno6739
@kristineximeno6739 3 года назад
What!! this is better. I did way better, I spell some words wrong and make some very simple syntax errors, and I was denied. I was thinking wow, people must be super good typer and super good coder who writes code without any errors at all to pass!! idk if this is real, but in reality, this candidate will be denied for sure. He actually says he doesn't know deep clone, and types many things wrong, and on top of it, he can't solve some questions. I solved all the questions, optimized it, and I was denied becuz I wasn't communicating too much with the interviewers. I remember I did talk throughout, maybe a few seconds I was thinking.
@saqibjamil1797
@saqibjamil1797 4 года назад
where are you from sir? Are you current employee at any software house?
@ckvinothkumar
@ckvinothkumar 5 лет назад
@techsith In the 4th question, you told like we can pass function declaration as argument in function expression. I tried but not working. Please explain me if am wrong
@Techsithtube
@Techsithtube 5 лет назад
Is there an error? What is happening when you pass function declaration as argument
@ckvinothkumar
@ckvinothkumar 5 лет назад
@@Techsithtube function x(){ } var y = function(x){ console.log(typeof x) //undifined } y() typeof x is undifiend
@kaushalchrollo
@kaushalchrollo 5 лет назад
@@ckvinothkumar you have to send parameter x in your function call
@n_fan329
@n_fan329 6 лет назад
22:25 can you please explain it more :)
@Techsithtube
@Techsithtube 6 лет назад
lol .. basically if you pass some thing to a function it becomes a variable inside. And function expression are functions stored in a variable. :)
@MJ-th2du
@MJ-th2du 6 лет назад
Hey TS , I have a request for a new tutorial how can i contact you ?
@Techsithtube
@Techsithtube 6 лет назад
you can contact me on my email techlover2000@gmail.com
@ambicabassetty4482
@ambicabassetty4482 5 лет назад
My solution for : Finding missing number from an array(Sorted or Unsorted does not matter) const findMissingNumberInArray = arr => { const newArray = [...Array(arr.length+1).keys()].slice(); let missing = 0; newArray.forEach(el => { missing = arr.includes(el) ? missing : el // .indeOf(el) > -1 also works. }); return missing; } complexity : memory : its taking new memory . Algo : O(n) for loop + O(1) for find ==> O(n) ?? is it right here?
@ankitarathi5985
@ankitarathi5985 5 лет назад
Ambica Bassetty this is heavy code it use more memory
@satish8299
@satish8299 5 лет назад
You got this white nuts in your hands, well done. You know i am so happy. And at the end he did understand the interview was fake? The reverse letters you felt in the trap, and the integer divsion with the remainder He did had to know. Also he should arrange the meta deta he had to itterate. I found the first 1 difficult, returning a function expression and using numb1 and the second value in numb3. You know in the Netherlands the jobs at the goverment Central Burea for statistics does have an innovation lab and at that department only white creative people work. At least they are creative i admit, but it is sad programmers like me with lot of experience dont get a job because we look crazy or if you dont share the ideas of the most of the conservative people that work at a company. There is always a certain culture at a company where you dont fit in, but that should not result into not hiring the person.
@Techsithtube
@Techsithtube 5 лет назад
I completely agree, its unfortunate that people with lots of experience doesnt really get what they deserve.
@nafeesahmed4942
@nafeesahmed4942 6 лет назад
function createLogFunction(val) { return function() { console.log(val); }; } const functions3 = []; for (var i = 0; i < 3; i++) { functions3.push(createLogFunction(i)); console.log(functions3) } functions3.forEach(f => f()); I was asked this question, what will be output. could you please tell me what is the point in this question.
@Techsithtube
@Techsithtube 6 лет назад
point of this example is to confuse you. :) And, its also about a concept called thunk. its fancy work for differing a task by returning a function that holds a closure.
@pramodmudgilvlogs
@pramodmudgilvlogs 6 лет назад
Bro, waiting for yours response for my query at your twitter & facebook page.
@lifeofsidharth
@lifeofsidharth 2 года назад
const sortedArray1 = array1.sort((a,b) => a-b); console.log(sortedArray1); // gives sorted array1 let len = array1.length; console.log("Length of array1 is: "+len); // printing length const sum = sortedArray1.reduce((a,c) => (a+c)); // reducing the array1 into its sum of elements console.log(sum); // printing sum const seriesSum = (len+1) * (len+2)/2; // sum of all elements including the missing one also let missingNumber =(seriesSum - sum); // getting missing element console.log("Missing number is: "+missingNumber); // printing missing numb. sortedArray1.splice(missingNumber-1,0,missingNumber); // inserting to its correct position console.log(sortedArray1); // finally printing it
@NaveenRawat51
@NaveenRawat51 6 лет назад
you are the best :-)
@sridharbelide
@sridharbelide 6 лет назад
What is that online video editor you are using?
@Techsithtube
@Techsithtube 6 лет назад
I m using camtesia. its a desktop editor not online.
@MylesGmail
@MylesGmail 5 лет назад
I love these videos, thx!!!!!
Далее
Top Tricky JavaScript Interview Questions and Answers
15:42
Офицер, я всё объясню
01:00
Просмотров 2 млн
Tricky JavaScript Interview Questions and Answers
16:35
Live Mock Technical Interview - JavaScript
1:03:31
Просмотров 127 тыс.
Answering tricky JavaScript interview questions
35:16