JavaScript Live Coding Interview (Mock) - Javascript interview questions #javascript #reactjs

JavaScript Live Coding Interview (Mock) - Javascript interview questions #javascript #reactjs

Coder Dost

1 год назад

22,777 Просмотров

Live javascript coding round with a 1 year experienced candidate.


🤯 Crash Courses (Single Video)

Git/Github Crash Course : https://bit.ly/3JSA5VT
TypeScript Crash Course : https://bit.ly/372dZSh
Angular Crash Course : https://bit.ly/3DoGJR1
Vue JS Crash Course : https://bit.ly/3uDujRl
Python Crash Course : https://bit.ly/3Dod7U2
React Router Crash Course : https://bit.ly/36YfO2i


🧑‍🏫 Full Course Playlists

HTML : https://bit.ly/36IMq0h
CSS : https://bit.ly/3LpRQw6
JavaScript : https://bit.ly/3u049tf
BootStrap : https://bit.ly/3NA9nDJ
ES 6 : https://bit.ly/3DvYCh6
DOM Playlist : https://bit.ly/35nMKB7
ReactJS (Redux & Hooks) : https://bit.ly/3iMethN
React with TypeScript : https://bit.ly/3fQjXtF
React Hooks: https://bit.ly/3Vmh7wV
Redux: https://bit.ly/3yAIIkl
NodeJS/ExpressJS : https://bit.ly/35nN6Yt
MongoDB / Mongoose : https://bit.ly/3qPj0EO


💻 Projects Playlists
MERN Stack Complete Ecommerce : https://bit.ly/3ymSs0E
Web Design HTML+CSS - Home Page : https://bit.ly/35nZiIB
Web Design BootStrap - E-Commerce Site : https://bit.ly/3iPhaz7
React/Redux/Firebase - Todo-App : https://bit.ly/3DnekL8


🕹 Mini Projects (Single Video)

React - Tic Tac Toe (Redux / Hooks) : https://bit.ly/3uzLEuy
React - Game of Flag Quiz (Hooks) : https://bit.ly/3LpTC0e
React - Google Translate Clone (Hooks) : https://bit.ly/3Lo9xvZ
React - Chat App using Firebase (Hooks) : https://bit.ly/3wLgymj

Visit our site: https://coderdost.com

🔴 Full Courses List : https://coderdost.com/courses
🔴 Full Projects List : https://coderdost.com/projects

💾 Source Codes at : https://github.com/coderdost

Тэги:

#coderdost #javascript_interview_question #javascript_interview #javascript_live_interview #javascript_coding_interview_questions #coding_round_in_placements #coding_round_questions_for_freshers #react_interview_questions #frontend_interview_questions #backend_interview_questions #javascript_in_urdu #javascript_in_hindi #react_js_in_urdu #react_js_in_hindi
Ссылки и html тэги не поддерживаются


Комментарии:

@tredzVid
@tredzVid - 17.01.2024 10:11

Simple solution is

const a = "This is Javascript Code";
const reversedWords = a.split(' ').map(word => word.split('').reverse().join('')).join(' ');
console.log(reversedWords);

//output - "sihT si tpircsavaJ edoC"

Ответить
@rajkumarhondale2170
@rajkumarhondale2170 - 23.12.2023 13:36

const str = "This is JavaScript Code"
const splitString = str.split(" ");
let holdReversStr = "";
splitString.forEach((splitString) => { for(let i=splitString.length-1;i>=0;i--){ holdReversStr += splitString[i]} holdReversStr += " "} );
console.log(holdReversStr)

Ответить
@user-ld1ub4qq8b
@user-ld1ub4qq8b - 10.11.2023 09:01

let wordArray=word.split(" ")
const reverseWord=wordArray.map(item=>item.split("").reverse().join(""))
console.log(reverseWord.join(" "))

Ответить
@rapper3470
@rapper3470 - 05.11.2023 13:24

const str = "this is javascript code";
let ans = str.split(" ").map((elm)=>elm.split('').reverse().join('')).join(" ");
console.log(ans);

Ответить
@lmntrix4503
@lmntrix4503 - 03.09.2023 06:44

const str = "harshit rajput"
const arr = str.split('')
// console.log(arr)

function h(arr){
let l =0;
let r=0;
let n = 0;
for(;r<arr.length;r++){
if(arr[r+1]===' ' || r===arr.length-1){
n = r+1
while(l<r){
let temp = arr[l]
arr[l] = arr[r]
arr[r] = temp
r--
l++
}
if(r===arr.length-1){
break;
}
l = n+1;
r = n;
}

}
return arr.join('')
}

console.log(h(arr))

Ответить
@pawansinghrawat7886
@pawansinghrawat7886 - 02.09.2023 22:13

ques1:
const str="This is JavaScript"

String.prototype.reverse=function(){
const newStr=str.split('').reverse().join('').split(' ').reverse().join(' ');

console.log(newStr)
}
str.reverse()

Ответить
@multiverse915
@multiverse915 - 31.08.2023 13:16

Sir i have a question are these mock interviews for the companies which prefer dsa students or the development companies

Ответить
@rohitroy3198
@rohitroy3198 - 13.08.2023 09:55

let text = "Hello everyone";

let arr2 = text.split(' ')
console.log(arr2)
let arr3 = arr2[0].toString().split('').reverse().join("")
let arr4 = arr2[1].toString().split('').reverse().join("")
console.log(arr3)
console.log(arr4)

const finalaray = arr3.concat(" "+arr4)

console.log(finalaray)


break everything into pieces first, then reverse it and join... easy to think easy to approach.

Ответить
@mr.editor7445
@mr.editor7445 - 11.08.2023 12:36

Great Content. Love from Pakistan

Ответить
@shivpuje555
@shivpuje555 - 08.08.2023 13:47

I have create word by word Reverse function without loop ;

var a = 'this is javascript code';

function reverseWord(a){
var b = a.split('');
b.reverse();
b = b.join('');
b = b.split(' ').reverse().join(' ');
console.log(b);
return b
}
reverseWord(a);

Ответить
@user-dr7it1qd6v
@user-dr7it1qd6v - 04.08.2023 17:06

it will work !
console.log(str.split("").reverse().join("").split(" ").reverse().join(" "))

Ответить
@divyabalajee
@divyabalajee - 17.07.2023 14:54

const maxWordCount=(str)=>{
const word = str.split(' ')

const maxArr = word.map((e)=>e.split('').length)
const output = Math.max(...maxArr)
return output
}

console.log(maxWordCount("this is javascript code"))

Ответить
@santoshalimkar2444
@santoshalimkar2444 - 30.06.2023 14:38

const message = "The rain in SPAIN stays mainly in the plain"

const result=message.toLocaleLowerCase().split(" ").join("")
console.log(result)

const maxcount=(result)=>{
const maxchar=[];
for(let i=0;i<result.length;i++)
{
const char=result.filter((val,ind)=> val === result[i]).length
maxchar.push(char)
}

return Math.max.apply(null, maxchar);

}

console.log(maxcount(result.split("")))

Ответить
@jaspreetsingh-5259
@jaspreetsingh-5259 - 27.06.2023 20:06

const str='This is a javascript code and you have to find mac char';
const strArr=str.split(' ');
let arr=[]
for (let i in strArr){
arr.push(strArr[i].split(''));
}
let counter={};
charArr=arr.flat();
charArr.forEach(item=>{
if(counter[item]){
counter[item]+=1;
}
else{
counter[item]=1;
}
})
console.log(counter)

Ответить
@jaspreetsingh-5259
@jaspreetsingh-5259 - 27.06.2023 19:39

const str="This is a Javascript code";

const strArr=str.split(' ');
let newStr="";
for(let i in strArr){
newStr+=strArr[i].split('').reverse().join('') + " "
}
console.log(newStr)

Ответить
@gaurabgb
@gaurabgb - 26.06.2023 11:42

const ReverseString = (str) => {
const s = str.split(" ");
let dats = [];
for (let i = 0; i < s.length; i++) {
let dat = s[i].split("");
dats.push(dat.reverse().join(""));
}
const rev = dats.join(" ");
return rev;
};

Ответить
@codewithrohit839
@codewithrohit839 - 22.06.2023 10:00

This is more simple😅


let num = "this is a string"

a = num.split("")


let b = a.reverse()
let c = b.toString();
console.log(c)

Ответить
@codewithrohit839
@codewithrohit839 - 22.06.2023 09:52

I will solve question first with my method and approach then will be come to see how interviewer solve the question

Ответить
@FreeTrial0315
@FreeTrial0315 - 18.06.2023 07:19

After solving the many dsa question this question look likes the 1+1

Ответить
@nibhasingh8882
@nibhasingh8882 - 04.06.2023 11:35

Hello sir.... Kya interview me jinki langwadge english hogi vhi interview de skta hai..?

Ответить
@theway_up
@theway_up - 03.06.2023 18:32

const str = "This is Javascript Code!";

function reverseString(str) {
const splittedStr = str.split(' ');

let reversedStr = "";
for(let elem of splittedStr) {
reversedStr += elem.split('').reverse().join('') + ' ';
}
return reversedStr;
}

console.log(reverseString(str));

Ответить
@suryateja9881
@suryateja9881 - 03.06.2023 14:19

My answer to the Sum 1:
let string = "This is JavaScript Mock Interview";
let newS = "";
let stringBreak = string.split(" ");
for(let i of stringBreak){
var chars = i.split('');
var reversedChars = chars.reverse();
var reversedString = reversedChars.join('');
newS += " " + reversedString;
}
console.log(newS)

Ответить
@pavankumarmantha
@pavankumarmantha - 02.06.2023 16:14

the code for this could as simple as this
output = []
input_arr.map((item, index) =>{
output.push(item.split('').reverse().join(''));
});
console.log(output.join(" "));

Ответить
@nizamph2022
@nizamph2022 - 31.05.2023 08:26

in the last problem you should have removed the empty string from the array. Otherwise, it would always give empty string has the largest count

Ответить
@AkashSingh-xf6bd
@AkashSingh-xf6bd - 30.05.2023 12:12

yes, we can using prototype

Ответить
@AkashSingh-xf6bd
@AkashSingh-xf6bd - 30.05.2023 12:02

reverse function is apply on the array only, not string or number

Ответить
@AkashSingh-xf6bd
@AkashSingh-xf6bd - 30.05.2023 11:50

const str = "this is javascript code"

function isReverse(str){
let newStr = str.split(" ");
let result = []
for(let i =0;i<newStr.length; i++){
let innerStr = newStr[i].split('')
let tempResult = []
for(let j = innerStr.length-1; j >=0;j--){
tempResult.push(innerStr[j])
}
result.push(tempResult.join(''))
}
return result.join(' ')
}
const res = isReverse(str)
console.log(res)

Ответить
@himanshuarora9567
@himanshuarora9567 - 29.05.2023 11:40

Please add some difficult questions for person having more than 4+ years of experience.

Ответить
@do_u_dsa
@do_u_dsa - 23.05.2023 22:46

Sir, great content, inspirational

Ответить
@GargiArtGallery
@GargiArtGallery - 13.05.2023 12:24

str.split(" ").map((i) => i.split("").reverse().join("")).join(" "); For the First Question : Reversing String Word wise not whole at once

Ответить
@shaikmahaboobjani3655
@shaikmahaboobjani3655 - 27.04.2023 17:43

great content sir thank u for making this type of videos

Ответить
@shaikmahaboobjani3655
@shaikmahaboobjani3655 - 27.04.2023 17:43

let str="mabujani"
let res=[]
for(let i=0; i<str.length; i++)
{
if(res[str[i]])
{
res[str[i]]++
}
else
{
res[str[i]]=1
}
}

let max=""
let times=0
for(let char in res)
{
if(res[char]>times)
{
times=res[char]
max=char
}
}

console.log(times,max)

Ответить
@nitishgupta8393
@nitishgupta8393 - 26.04.2023 14:10

2nd:

const maxChar = (str) => {
let arr = str.split("");
let count = 0;
let res = "";

arr.forEach((ch) => {
let innercount = 0;
arr.forEach((el) => {
if (el == ch) {
innercount += 1;
}
});
if (innercount > count) {
count = innercount;
res = ch;
}
});
return res;
};

Ответить
@nitishgupta8393
@nitishgupta8393 - 26.04.2023 13:12

1st :
const rev = (str)=> {
let lineRev = inp.split(" ").reverse()
return lineRev.map(word=> word.split('').reverse().join("")).toString()
}

Ответить
@harshvardhan2143
@harshvardhan2143 - 20.04.2023 12:39

//reverse the string

function reverseString(str){
let tempAr=str.split(" ");
let finalAr=[];
tempAr.forEach(val=>{
let stringAr=val.split("");
let string='';
stringAr.forEach(val=>{
string=val+string;
})
finalAr.push(string);
})
return finalAr.join(" ");
}

reverseString("This is JavaScript Code")



// find max occuring char

function findMaxOccuringChar(str){
let tempStrAr=str.split("");
let object={};

tempStrAr.forEach(val=>{
if(object.hasOwnProperty(val))
object[val]++;
else
object[val]=1;
})
let maxChar=tempStrAr[0];
for(let i in object){
if(i!==" "&& object[i]>object[maxChar]){
maxChar=i;
}
}
return maxChar;

}

findMaxOccuringChar("This is JavaScript Code and you to find max char");

Ответить
@Solo_playz
@Solo_playz - 19.04.2023 14:54

Easiest way 😉

let str = "Chutteee";
let strArr = str.split('');

let charCount = {}

strArr.forEach(char =>{
if(char !== ""){
if(Object.keys(charCount).includes(char)){
charCount[char]+=1
}
else{
charCount[char] = 1
}
}
});

let maxChar = {key:null,value:0};

Object.keys(charCount).forEach(k => {
if(charCount[k] > maxChar.value){
maxChar.value = charCount[k]
maxChar.key = k
}
});

console.log(maxChar);
Output : {key: 'e', value: 3}

Ответить
@jyzibzaidi6600
@jyzibzaidi6600 - 17.04.2023 15:19

come-up with single line approach


let result = str.split('').reverse().join('').split(' ').reverse().join(" ")
console.log(result)

Ответить
@aparnas1613
@aparnas1613 - 16.04.2023 21:35

Great

Ответить
@AmitGupta-lx2ze
@AmitGupta-lx2ze - 10.04.2023 19:10

let str = "NodeJS is a javascript runtime";

const reverseWord = (str) => {
let arrStr = str.split(" ");

console.log(arrStr);
let newArrStr = arrStr.map((item) => {
return item.split("").reverse().join("");
});
return newArrStr.join(" ");
}

let res = reverseWord(str);

console.log(res);

Ответить
@akash_gupta_2090
@akash_gupta_2090 - 08.04.2023 21:56

let myStr = "This is javascript code and you to find max char";
let calculate = {};
function maxOccurring(str) {
for (let item of str) {
calculate[item] = (calculate[item] || 0) + 1;
}
let max = 0;
let finalResults;

for (let data in calculate) {
if (calculate[data] > max) {
max = calculate[data];
finalResults = {
[data]: max,
};
}
}
return finalResults;
}

console.log(maxOccurring(myStr.replaceAll(" ", "")));

Ответить
@akash_gupta_2090
@akash_gupta_2090 - 08.04.2023 21:43

var reverseWords = function (s) {
let res = "";
let word = "";
for (let c of s) {
if (c === " ") {
res += word + c;
word = "";
} else {
word = c + word;
}
}
return res + word;
};

Ответить
@jhs003
@jhs003 - 27.03.2023 10:26

Aapne jo code likha hai Ryan Dahl bhi dar jaye yaar mere se bada coder kon hai ye...Why you are making simple things complicated .. Here is the short,readable,understandable code const str = "I am the father of Javascript programming"
const splitText = str.split(' ')

const reversedSplit = splitText.map((word) => {
return word.split('').reverse().join('')
})

const finalreverse =reversedSplit.join(" ")
console.log(finalreverse)

Ответить
@PIYUSH-lz1zq
@PIYUSH-lz1zq - 17.02.2023 22:20

js coding round ka playlist ka link dedo !!

Ответить
@Akshay-if5im
@Akshay-if5im - 14.02.2023 13:00

Can't we apply the split method first and then print the array in reverse order

Ответить
@Ayushkumar-il7jy
@Ayushkumar-il7jy - 04.02.2023 04:38

let arr= str.split(' ')
let out= new Array();
for(let i=0;i<arr.length;i++){
out[i]=arr[i].split('').reverse().join('');
}
console.log(out.join(' '));

Ответить
@nageshswamii3770
@nageshswamii3770 - 03.02.2023 18:12

function reverseString(str) {
let revArray = [];
let strlength = str.split(' ');
for (let i = 0; i < strlength.length; i++) {
let a = strlength[i].split("").reverse().join("");
revArray.push(a)
}
return revArray.join(" ")
}

console.log(reverseString("This is javascript code"))

Ответить
@anilraj9877
@anilraj9877 - 02.02.2023 08:05

yes, we can do that, first we have to make our function to reverse the string, the add the function to String.prototype, after this we can get that function in any where in the code.

Ответить