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

preview_player
Показать описание
Online JavaScript Interview recorded live with questions on JavaScript and Algorithms .

If you like to be mock interviewed, email me at

For solutions to these interview questions please look below.

Please be my patreons on patreaon

Follow me for technology updates

Help me translate this video.

Solutions:

Рекомендации по теме
Комментарии
Автор

this should be like a tv series like episodes and seasons. So many emotions, struggle, real emotions, techsits patience. Amazing. I would watch it.

JohnDoe-rjkf
Автор

Thanks a lot sir.i have been selected an interview and got good offer with help of your videos.once again trillions of thanks techsith.

VinothKumar
Автор

This a shot code helping to find out the length of digits without converting into String :

const nbr = 3214;
console.log('===> length of a number: ', Math.floor( Math.log10( nbr) ) + 1 );

adelmani
Автор

For the 2nd problem can't you just do this?

function integerLength(nr){
return Math.floor(Math.log10(nr))+1
}

For me this works for any integer between 1 and 9e15

SanderBuruma
Автор

Amazing! this is how I would do. no need to search
function count(N){
let count = 1;
let result = N;
let i = 10;
while(result>10){
result = N/i;
i = i*10;
count++;
}
return count;
}
console.log(count(232));

mkSkeptics
Автор

The very first line of the function should be:
if (number < 10) return 1;
😊

fadimoussa
Автор

I did this and it works


function lengthInteger(num){
let count = 0;
while(num!==0){
let temp = parseInt(num/10);
num = temp;
count +=1;
}
return count
}

sumitghewade
Автор

We could also use parseInt() to round the number,
while(number !=0){
number = parseInt(number / 10)
counter += 1
}
return counter

ajitjadhav
Автор

This series is awesome. Really, really useful.

facundocorradini
Автор

Hi @techsith, thanks for you videos, finally I got an offer!

jiahaoyu
Автор

const x = [1, 2, 3, 4];

const biggest = x.reduce((a, b) => a + b) - Math.max(...x);
const smallest = x.reduce((a, b) => a + b) - Math.min(...x);

aezius
Автор

let num = 12345;
let leng = Math.ceil(Math.log10(num + 1));
console.log(leng);
result length is 5

sunilKumar-uucx
Автор

For Second problem this is my solution
function getLength(x){

let num = x;
let counter =0;
while(num>0){
num = num/10;
if(num >=1)counter++;
else{counter++;return counter;}
}

}

naveenreddydepa
Автор

Hah thought an easier way for the number length problem. Times the number by 0.1 and floor it. If it’s not zero then repeat. Great vids keep up the good work!

cugal
Автор

Length of a number :-
let num=1234;
num=Math.abs(num);
let count=0;
let i=10

count=count+1;
if(num<i){
console.log(count);
break;
}
i=i*10;
}

ankush
Автор

Simple solution is using parseInt
var number = 1234;
var count = 0;
while(number !=0) {
number = number/10;
number = parseInt(number);
count++
}
alert(count);

gaurab
Автор

First one to like before watching it -:)

anuranjansrivastav
Автор

You help me to dive into the working process.
Thanks!

ManOnHorizon
Автор

Sir please make a full mock interview video which includes questions from HTML, CSS, Js, Angular for front end developer role.

SurajAgarwaladad
Автор

let someNum = 1234;
+ 1)));

OR

You can use while(Math.floor(num) > 0) by your approach

NikhilMahirrao