Тёмный

JavaScript Mock Interview | Online Interview | Questions and Answers 

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

Online Front End Phone Interview recorded live with questions on JavaScript , Algorithms and Problem Solving with suggestions. interview practice. Practice javaScript
#Mock #JavaScript #Interview
If you like to be mock interviewed, email me at
* techlover2000@gmail.com
*My Udemy Courses
www.udemy.com/js-masterclass/
www.udemy.com/course/react-ho...
Follow me for technology updates
* / techsith
* / techsith
* / techsith1
* / 13677140
* / patelhemil
Help me translate this video.
* ru-vid.com_cs_...
Note: use translate.google.com/ to translate this video to your language. Let me know once you do that so i can give you credit. Thank you in advance.

Наука

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

 

29 сен 2019

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 65   
@sandeepreddy1866
@sandeepreddy1866 4 года назад
Good questions. Thank you for uploading.
@nanasarathi
@nanasarathi 4 года назад
Awesome as usual...
@srinumajji501
@srinumajji501 4 года назад
Thanks for the video
@sundargp9463
@sundargp9463 4 года назад
My answer for the first question const addMemberAge = ({ age, kids = [] }) => [age] .concat(...kids.map(addMemberAge)) .reduce((accumulator, currentValue) => accumulator + currentValue);
@Techsithtube
@Techsithtube 4 года назад
Sundar, I like how creative you are . short and sweet solution .
@sundargp9463
@sundargp9463 4 года назад
thank you @techsith
@michaelrooze278
@michaelrooze278 2 года назад
@@sundargp9463 Nice solution....I dont think you need the spread operator on kids since you gave it the default value of an empty array.
@michaelrooze278
@michaelrooze278 2 года назад
Im trying to understand why this does not work when you change the nested "kids" to something else
@ickimadrasi8965
@ickimadrasi8965 4 года назад
Can you recommend a good GIT and GIThub course
@maheshsingh6787
@maheshsingh6787 4 года назад
No offense to the interviewee, but I really wouldn't really start an answer to TechSith's questions with "it's a very simple question" :) Anyways, a potential recursive answer to the first question: (should be able to handle ages as keys or within nested arrays, objects etc ) function getSum(obj, sum = 0) { if(Array.isArray(obj)) { for(let ele of obj) { sum = getSum(ele, sum) } } else if(typeof obj === 'object') { for(let key in obj) { if(typeof obj[key] !== 'object') { if(key === 'age') { sum = sum + obj[key] } } else { sum = getSum(obj[key], sum) } } } return sum }
@hari9321
@hari9321 4 года назад
Can you make a video on career path in IT field... Thankyou for all your react and javascript videos , with best and simple way of explaining things.
@Techsithtube
@Techsithtube 4 года назад
hkv , Are you trying to follow a specific path in IT field?
@ozzyfromspace
@ozzyfromspace 2 года назад
A "neater" recursive solution to question 1: function addKidAge(kids) { let kidTotalAge = 0; for(const kid of kids) { kidTotalAge += kid.age; if(kid?.kids?.length > 0) { kidTotalAge += addKidAge(kid.kids); } } return kidTotalAge; } To run it, just do addKidAge([profile]) Notice that the profile object is inside an array :)
@Techsithtube
@Techsithtube 2 года назад
Thanks for sharing!
@patrickren7395
@patrickren7395 4 года назад
The first problem is just flat a tree. Using recursion is the first thing that pops into my head. However you can run away from the problem by using JSON.stringify, then all there left to do is analyse the json string, kind of like cheating
@Techsithtube
@Techsithtube 4 года назад
Patrick, I think that is a valid answer. :)
@michaelrooze278
@michaelrooze278 2 года назад
can you post your solution please?
@mayow6767
@mayow6767 4 года назад
Can you direct me to video tutorial you're explaining these concepts deeply ? Thank you
@Techsithtube
@Techsithtube 4 года назад
Abhirahamn, these are basic javaScript and problem solving questions , I have some playlist to learn JavaScript . feel free to check it out. here is the link ru-vid.com/group/PL7pEw9n3GkoVYU-ZKBrDnxIiiUn0YP-uO
@vadivelraja2344
@vadivelraja2344 4 года назад
Hi, I have asked to write code for write in ballots using JavaScript in my interview
@ChaoticBlackout
@ChaoticBlackout 3 года назад
This SHOULD be a bulletproof solution to the first problem! Accounts for when some ages don't exist const addAllAges = (profile) => { if (!Object.keys(profile).length) return 0; let totalAge = profile.age || 0; for (let kid of profile.kids) { if (kid.age === undefined) continue; if (kid.kids !== undefined) { totalAge += addAllAges(kid); } else { totalAge += kid.age; } } return totalAge; }
@vikasraju2380
@vikasraju2380 4 года назад
function totalAge({age,kids=[]}){ return kids.reduce((sum,kid)=> sum + totalAge(kid),age ) } console.log(totalAge(profile)); //Use reduce
@Techsithtube
@Techsithtube 4 года назад
Vikas, this is simple and clean . bravo.
@vikasraju2380
@vikasraju2380 4 года назад
@@Techsithtube Thank You Sir
@MohdAfeef
@MohdAfeef 4 года назад
asked me api has currency , value store value ony db by api request should not repeat for currency he told me solution 1/1 , 2/2 diagonal matrix solution for this problem
@ansreenath
@ansreenath 4 года назад
Hi Techsith, Thank you for Javscript and NodeJS videos. It would be great if you can please make a video on 'How to Monitor Log files Monitoring log files using some metrics exporter + Prometheus + Grafana'? Thanks a lot.
@Thankful_n_Grateful
@Thankful_n_Grateful 4 года назад
I'm just starting out in coding with Javascript... But regardless of coding language being used, I think it might be more efficient to write stubs & pseudo code first, explaining what your doing and why verbally as you stub it out... Once psuedo code makes sense, then write corresponding code for each stub... If one just jumps in and starts coding, even if one gets it correct first time, there's very lil interaction with interviewer.... Just a thought... I've always been of mindset that if one cannot explain it, then they don't really understand it... Plus during an interview psuedo coding & stubbing it as you explain gives interviewer an idea of your thought process and opportunity to explain as you're writing pseudo code why ( your rationale ) for implementing something a particular way... I'm not a professional programmer. I'm working on becoming one... Thanks for sharing video
@Techsithtube
@Techsithtube 4 года назад
I think that is the right way to approach . Think , plan, discuss and code. good luck!
@MohdAfeef
@MohdAfeef 4 года назад
hi techsit interviewer asked prime no program n no asked me optmize for loop for n=3000 for(i=0;i
@aravindanil930
@aravindanil930 4 года назад
If you are finding whether 3000 is prime number, I think you have to compute only factors up to sqrt(3000) to check this. If I am getting the question wrong, please feel free to correct me
@vikrantgupta7896
@vikrantgupta7896 3 года назад
2 yr exp solved all of them within 5mins, no google
@Techsithtube
@Techsithtube 3 года назад
Vikrant. that is great.
@maelstrom57
@maelstrom57 2 года назад
It only took me 367 tries but I finally solved the first problem. (Feel free to suggest improvements.) function addUpAges(profile) { let total = 0; function addUp(profile) { total += profile.age || 0; if (!profile.kids) return; return profile.kids.forEach(addUp); } addUp(profile); return total; }
@ManojSingh-of5ep
@ManojSingh-of5ep 3 года назад
my answer for 2nd problem: function que(){ let first = Math.floor(Math.random() * Math.floor(10)); let sec = Math.floor(Math.random() * Math.floor(10-first)); console.log(`${first}+${sec}`); } for(let i=0;i
@Chessmasteroo
@Chessmasteroo 4 года назад
The first problem can be solved with one line. Easy JSON.stringify(profile).match(/\d+/gi).reduce((a, c) => {return a + parseInt(c)}, 0)
@aubame-bloodclut-zette6745
@aubame-bloodclut-zette6745 3 года назад
json stringify is so slow, i dont think this is a good solution
@herp_derpingson
@herp_derpingson 3 года назад
This is really brittle. Dont use this.
@assamaafzal3516
@assamaafzal3516 4 года назад
last problem solution : const generateRandomNumber = (max, min = 1) => { return Math.floor(Math.random() * (max - min) + min); }; const generateProblems = (max, n) => { for (let i = 0; i < n; i++) { const firstRandomNumber = generateRandomNumber(max); console.log( `${firstRandomNumber} + ${generateRandomNumber( max - firstRandomNumber )} = ` ); } };
@orz5516
@orz5516 4 года назад
my simple solution for the second problem. can i use a function that accepts 2 arguments? function game(num, num2){ for(var i =0; i
@Techsithtube
@Techsithtube 4 года назад
Thanks for sharing your solution . Thanks
@bawaparampreet24
@bawaparampreet24 4 года назад
function sum(root) { return root.age + (root.kids || []).reduce((s, k) => s + sum(k), 0); }
@ansreenath
@ansreenath 4 года назад
Hi Techsith, It would be great if you can please show us how to read an email in outlook using Microsoft Graph API. Thanks in advance.
@Techsithtube
@Techsithtube 4 года назад
Thanks for sharing, I will add to the list of video that i need to create.
@mdshoaibAlamgcetts
@mdshoaibAlamgcetts 4 года назад
Hi sir , an interviewer asked me to find largest number can be form by concatinating the numbers . Eg Let arr =[ 90,95,9]; so after concat largest number would be like "99590" . Could you please suggest me solve this in easiest way .
@Techsithtube
@Techsithtube 4 года назад
here is the best solution www.geeksforgeeks.org/arrange-given-numbers-form-biggest-number-set-2/
@tausifkovadiya1810
@tausifkovadiya1810 2 года назад
const findLargest = arr.sort((a, b) => ('" + b + a) - ("" + a + b)).join(""); concatinating string with 2 numbers and sort by descending, later join all numbers of arr.
@SatyamSinghDeveloper
@SatyamSinghDeveloper 4 года назад
Sir, please use a good mic, your sound creates echo effects soo much.
@Techsithtube
@Techsithtube 4 года назад
Satyam, this was recorded as a meeting which is very difficult to handle audio wise as the network issue and the audio equipment of the other party. Thanks for pointing it out.
@vinayakshahdeo7578
@vinayakshahdeo7578 4 года назад
Hello sir I am a new coder in Javascript my level is beginner can I get a mock interview as I want to move to Javascript frameworks.
@Geomaverick124
@Geomaverick124 4 года назад
email him at techlover2000@gmail.com
@vinayakshahdeo7578
@vinayakshahdeo7578 4 года назад
@@Geomaverick124 thanks
@MohdAfeef
@MohdAfeef 4 года назад
what is is viewencapsulation
@Techsithtube
@Techsithtube 4 года назад
where you able to pass the interview?
@MohdAfeef
@MohdAfeef 4 года назад
@@Techsithtube yup, thanks techsit most of question belongs to your videos ,i clear basic
@MohdAfeef
@MohdAfeef 4 года назад
@@Techsithtube I do front end and back end coding, please make Angular 8 Interview Question Thank you
@satish8299
@satish8299 4 года назад
This Indian guy was baad, does he work for a University ?
@herp_derpingson
@herp_derpingson 3 года назад
10/10
@pppluronwrj
@pppluronwrj 4 года назад
too slow
@GodsDevil5thF
@GodsDevil5thF 4 года назад
I think he is over complicating the problems. In a interview you wanna start with the simplest solution and then work up from it. My solutions : problem 1: const ageTotal = profile.age + profile.kids[0].age + profile.kids[0].kids[0].age + profile.kids[0].kids[1].age; console.log(ageTotal); Problem 2: function simpleMathProblem() { let number1 = Math.floor(Math.random() * 10); let number2 = Math.floor(Math.random() * 10); if (number1 + number2
@Techsithtube
@Techsithtube 4 года назад
That is exactly right, you want to show your interviewer that you can think in steps. first simple solution and then expand on it.
Далее
Tricky JavaScript interview questions and answers
21:01
top 10 JavaScript tricks
17:18
Просмотров 19 тыс.
Answering tricky JavaScript interview questions
35:16
Tricky JavaScript Interview Questions and Answers
16:35