Тёмный

Javascript Mock Interview | online video interview Questions & Answers 

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

Online Technical Mock Interview of one of my viewers. Where I ask JavaScript Fundamental Questions , algorithm questions aand give their answers
#javaScript #interview #questions
For mock interview 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.

Наука

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

 

20 окт 2019

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 64   
@assamaafzal3516
@assamaafzal3516 4 года назад
one basic solution to palindrome problem can be : const isPalindrome = n => { let final = 0; let givenNumber = n; while (givenNumber > 0) { let remainder = givenNumber % 10; givenNumber = parseInt(givenNumber / 10); final = final * 10 + remainder; } return final === n; };
@MK-tz4hg
@MK-tz4hg 3 года назад
this is wrong... it is not palidromic approach.. you are adding final to from backward which is same as n
@desolatedj1
@desolatedj1 4 года назад
Keep zoom while candidate is writing code, its difficult to see
@devdive7293
@devdive7293 4 года назад
I stopped watching at 3:31 exactly because of that reason. I have no idea what is being written 😕
@srinumajji501
@srinumajji501 4 года назад
Thanks for the video Sir🤩
@bawaparampreet24
@bawaparampreet24 4 года назад
My approach for Palindrome: 3) function numDigits(num) { return Math.floor(Math.log10(num)); } function palinCheck(number) { if(Math.floor(number / 10) === 0) { return true; } var num_digits = numDigits(number); var right = Math.floor(number / Math.pow(10, num_digits)); var left = number % 10; if(right !== left) { return false; } var striped = number / 10; // strip the right striped = Math.floor(striped % Math.pow(10, numDigits(striped))); return palinCheck(striped); } console.log(palinCheck(12321));
@MohdAfeef
@MohdAfeef 4 года назад
Please make Angular Interview Question Series thank you techsit
@saurabhchauhan232
@saurabhchauhan232 4 года назад
I am backend developer. wanted to be fullstack developer. I see interview series to get idea and check my knowledge as well. This is really a good series for people like me. Thanks a lot sir. 🙃
@matthewbarnden7312
@matthewbarnden7312 4 года назад
Number.prototype.isPalindrome = function(number = -1, result = []) { if(number === -1) number = this.valueOf() const evaluateResult = result => parseInt(result.join('')) === number if(number > 0, result) return evaluateResult(result) } const number = 101; console.log(number.isPalindrome()) using a couple of techniques based on these interview videos of yours i have been watching. Many thanks learning allot!
@Ath9493
@Ath9493 3 года назад
Prabhu Shriram bless you Hemil 🙏 keep going bro
@nagarjunakanamarlapudi272
@nagarjunakanamarlapudi272 4 года назад
hi sir i loved each and every video of yours :). Can you please explain about JavaScript design patterns also
@joemadhan6047
@joemadhan6047 4 года назад
When I heard the questions in this interview my thoughts automatically route me to techsith videos where he would thought all these stuffs.
@adityashinde3864
@adityashinde3864 4 года назад
Please make data structures and algorithms video series.
@hovhannessardaryan4628
@hovhannessardaryan4628 4 года назад
Please, make a video about Polymorphism in JavaScrpt.
@cvvkshcv
@cvvkshcv 4 года назад
Thanks for the amazing video! const isPalindrome = (num) => { let numTemp = num; let result = 0; while (numTemp > 0) { result = (result * 10) + Math.floor(numTemp % 10); } return (result === num) ? 'Palindrome' : 'Not Palindrome'; }
@MarvinMedeiros52
@MarvinMedeiros52 4 года назад
nice solution, i think you made a mistake inside the while on the `x` variable
@nacerhk9706
@nacerhk9706 4 года назад
Hi .....i tried to use the same "id value" for different element and it is working in HTML ? !!!
@saimanish7634
@saimanish7634 4 года назад
why does it look pixelated?
@wongwanchap
@wongwanchap 4 года назад
How about floating number palindrome, e.g. 1234.4321, which I don't think it will work in base 10, it only work for base 2 or base 2^n.
@viharikolla6203
@viharikolla6203 4 года назад
I have tried a lengthy way: var a=12521; var b=c=a; var lengthOfA=0 var s=0; for(i=0;i
@abhilashatiwari2783
@abhilashatiwari2783 4 года назад
This is really helpful, please do Angular 6+ interview also
@Techsithtube
@Techsithtube 4 года назад
Abhilasha, that is on my list . I will do it soon. Thanks for the suggestion
@Ianstudent
@Ianstudent 4 года назад
The correct answer to the first question is "I don't know. Let's google it and find out in 10 seconds." Like, make sure you rephrase the question back to show understanding about what is being asked, something like "I want to prevent new property definitions, but ensure the obj is still mutable" but why lose sleep over not knowing off the top of your head the exact api call.
@Techsithtube
@Techsithtube 4 года назад
I feel dont know is way better than trying to answer something that you dont know.
@luthermaria1021
@luthermaria1021 4 года назад
May some please explain the first question, please? because it took long and I need to understand
@suryaprakash124
@suryaprakash124 4 года назад
For last one, I will find last digit by moding the given number, and store it in a variable then cut down last digit of the number by dividing with 10. Now I will generate a reverse number(initial value is zero) by multiplying reverse number with 10 and add the extracted last digit to it. I will repeat this till number is greater than zero after cutting down the last digit.. finally I will get reversed number. I will compare with actual number..this is my approch.. pls suggest is this correct approch or not..
@kingofgoodtimes3987
@kingofgoodtimes3987 4 года назад
see my answer in below comment
@user-nt5ch5yg2c
@user-nt5ch5yg2c 4 года назад
`${number}`.split('').reverse().join('') === `${number}`
@pureromanticatheart
@pureromanticatheart 4 года назад
It is correct but in case of 123456789 your solution will still run through the length of the number whereas his solution would terminate at the first iteration.
@psantoshkumar3511
@psantoshkumar3511 4 года назад
Can Object.seal be an alternative solution for preventing new property to be added to object ?
@shishirrao4632
@shishirrao4632 4 года назад
no, it does not allow delete operation
@enricomariatenca4213
@enricomariatenca4213 4 года назад
I did it this way (you can just copy and paste in jsfiddle or similar) function reverseInt(n) { let pal = ""; while (n > 1) { n /= 10; pal += Math.floor((n - Math.floor(n)) * 10); } return parseInt(pal); } let int = 123456; console.log(reverseInt(int));
@Techsithtube
@Techsithtube 4 года назад
That is short and sweet. Thanks for sharing!
@enricomariatenca4213
@enricomariatenca4213 4 года назад
@@Techsithtube Thanks you for your job, I learned a lot through your (and your candidates) way of thinking. Please keep going ;)
@ajinkyawankhade5109
@ajinkyawankhade5109 4 года назад
This does not work for single digit numbers, returns NaN
@anjaliagrawal3650
@anjaliagrawal3650 4 года назад
Not properly visible
@mayankchandravanshi8723
@mayankchandravanshi8723 2 года назад
--- Here is my take --- function isPalindrome(number) { // number -> 121 const stack = []; const originalNumber = number; while (number > 0) { stack.push(number % 10); number = Math.floor(number / 10); } const reversedNum = Number(stack.join("")); return reversedNum === originalNumber; } console.log(isPalindrome(1001));
@MuhammadIshmaell
@MuhammadIshmaell 4 года назад
Here's my solution to the palindrome question. Number.prototype.isPalindrome = function() { let arr = [], quotient = 0, remainder = 0, init = this; while(init > 0) { quotient = Math.floor(init/10); remainder = init%10; arr.push(remainder); init = quotient; } return this === Number(arr.join("")); } const num = 12521; console.log(num.isPalindrome()); // returns true
@vinoddonnennavar
@vinoddonnennavar 3 года назад
Hi Sir, In one of my recent interviews I was asked the below question, let A={a:1,b:2}; let B=A; B.x=20; console.log(A.x) //20 I got the answer correct but couldn't explain why. Can You please explain? Thanks in advance.
@Techsithtube
@Techsithtube 3 года назад
When you do B=A you are setting reference of A to B. in a way they are now pointing to the same object. which means if you change one other gets impacted. that is why adding a new property in B also shows up in A.
@ananyadwivedi5518
@ananyadwivedi5518 3 года назад
This is what we call Shallow Copy right ?
@cuteangel1726
@cuteangel1726 3 года назад
because of shallow copy
@Nikhilkumar-yh7yc
@Nikhilkumar-yh7yc 2 года назад
@@ananyadwivedi5518 Yup
@keshavgupta633
@keshavgupta633 3 года назад
You will never get so much time for such a basic palindrome question. By that time interviewer will ask you to jump to next question.
@masibhai339
@masibhai339 4 года назад
Solution for first question?
@n_fan329
@n_fan329 4 года назад
apply The Object.freeze() method
@masibhai339
@masibhai339 4 года назад
@@n_fan329 can we do it with define property method
@Techsithtube
@Techsithtube 4 года назад
Object.freeze() doesnt work here.
@joemadhan6047
@joemadhan6047 4 года назад
What’s the first question
@joemadhan6047
@joemadhan6047 4 года назад
If you want to update/delete the existing one and don’t want to add a new prop. Then I guess Object.seal would be the best option. @Techsith correct me if I’m wrong
@Gujjar1cool
@Gujjar1cool 4 года назад
let number = 121; let checkPalindrome = function( number ) { let _numString = number.toString(10); let _reverseString = ''; for (let i = _numString.length - 1; i >= 0; i = i - 1) { _reverseString += _numString[i]; } return ( _numString === _reverseString) ? true : false; } console.log( checkPalindrome( number ) );
@Techsithtube
@Techsithtube 4 года назад
Thanks for sharing the solution
@Gujjar1cool
@Gujjar1cool 4 года назад
@@Techsithtube Thanks a lot Sir. Your reply means a lot to me.
@kingofgoodtimes3987
@kingofgoodtimes3987 4 года назад
var a=12521; var b=a; var s=0 var length = 0; for(i = a; i > 1; ++i){ ++length; i = Math.floor(i/10); } for(i=0;i
@n_fan329
@n_fan329 4 года назад
Too much useless talking from the interviewer for no reason 🤦🏻‍♂️
Далее
Tricky JavaScript interview questions and answers
21:01
Tricky JavaScript Interview Questions and Answers
16:35
Tragic Moments 😥 #2
00:30
Просмотров 3,2 млн
Top Tricky JavaScript Interview Questions and Answers
15:42
top 10 JavaScript tricks
17:18
Просмотров 19 тыс.
Javascript Closure tutorial ( Closures Explained )
12:52
Tricky CSS Interview Questions and Answers
13:09
Просмотров 42 тыс.
Top 10 css interview questions and answers
14:46
Просмотров 400 тыс.
Bitwise Operators JavaScript
16:20
Просмотров 14 тыс.
Полезные программы для Windows
0:56