Тёмный

JavaScript LIVE Coding Interview Round (Mock) 

Coder Dost
Подписаться 80 тыс.
Просмотров 40 тыс.
50% 1

In this video, we have a candidate, a fresher, who tries to solve a live coding problem in a javascript interview
#reactjs #javascript #interview #leetcode
🤯 Crash Courses (Single Video)
Git/Github Crash Course : bit.ly/3JSA5VT
TypeScript Crash Course : bit.ly/372dZSh
Angular Crash Course : bit.ly/3DoGJR1
Vue JS Crash Course : bit.ly/3uDujRl
Python Crash Course : bit.ly/3Dod7U2
React Router Crash Course : bit.ly/36YfO2i
🧑‍🏫 Full Course Playlists
HTML : bit.ly/36IMq0h
CSS : bit.ly/3LpRQw6
JavaScript : bit.ly/3u049tf
BootStrap : bit.ly/3NA9nDJ
ES 6 : bit.ly/3DvYCh6
DOM Playlist : bit.ly/35nMKB7
ReactJS (Redux & Hooks) : bit.ly/3iMethN
React with TypeScript : bit.ly/3fQjXtF
React Hooks: bit.ly/3Vmh7wV
Redux: bit.ly/3yAIIkl
NodeJS/ExpressJS : bit.ly/35nN6Yt
MongoDB / Mongoose : bit.ly/3qPj0EO
💻 Projects Playlists
MERN Stack Complete Ecommerce : bit.ly/3ymSs0E
Web Design HTML+CSS - Home Page : bit.ly/35nZiIB
Web Design BootStrap - E-Commerce Site : bit.ly/3iPhaz7
React/Redux/Firebase - Todo-App : bit.ly/3DnekL8
🕹 Mini Projects (Single Video)
React - Tic Tac Toe (Redux / Hooks) : bit.ly/3uzLEuy
React - Game of Flag Quiz (Hooks) : bit.ly/3LpTC0e
React - Google Translate Clone (Hooks) : bit.ly/3Lo9xvZ
React - Chat App using Firebase (Hooks) : bit.ly/3wLgymj
Visit our site: coderdost.com
🔴 Full Courses List : coderdost.com/...
🔴 Full Projects List : coderdost.com/...
💾 Source Codes at : github.com/cod...

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

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 180   
@varandeepsahota1314
@varandeepsahota1314 Год назад
Binary search is POSSIBLE here. We can determine which element should be present at ith index using simpe A.P formula and if correct element present, move right else move left side. Thanks for this content.
@Its_Abhi_Thakur
@Its_Abhi_Thakur Год назад
let arr = [5, 7, 9, 11, 15, 17]; let missing = 0; for (let i = 0; i < arr.length; i++) { let el = arr[i]; let next_el = arr[i + 1]; if (next_el - el !== 2) { missing = el + 2; break; } } console.log(missing);
@coderdost
@coderdost Год назад
good and simple
@Its_Abhi_Thakur
@Its_Abhi_Thakur Год назад
@@coderdost thank you 😇
@ahmadraiyan165
@ahmadraiyan165 5 дней назад
let arr=[5,7,9,11,15,17] let arr2=[] for (let i = 0; i < arr.length; i++) { if ((arr[i]-arr[i-1])!==2&&(arr[i]-arr[i-1])==4) { arr2.push(arr[i-1]+2) } } console.log(arr2);
@karthikhs2530
@karthikhs2530 Год назад
const input= [5,7,9,11,15,17] input.filter((e,i)=>{return(input[i+1]-input[i])>2}) .map((e)=>e+2) .filter((e,i)=>i
@YourSecularBro
@YourSecularBro Год назад
my code works with any case: const input = [1,2,3,4,5,6,7,9]; function checkMate(arr) { let diff = arr[1] - arr[0]; let i = 0; let j = arr.length-1; let ans; while (i < j) { if(arr[i] + diff === arr[i+1]) { i++; } else { ans = arr[i] + diff; console.log(ans); break; } } } checkMate(input);
@MehulJadavIndia
@MehulJadavIndia Год назад
const input = [5, 7, 9, 11, 13, 15, 17, 21]; for (i = 0; i
@itechinnovations2200
@itechinnovations2200 Год назад
Map all the values inside array then go for a loop that iterates within the req range then for each odd no check it is present in map or not if not then print and break
@yesuraju-tf1yp
@yesuraju-tf1yp Год назад
function missOdd(arr){ let first=0, last=arr.length-1, mid = 0 ,first_element = arr[0]; if(first_element+2*last == arr[last] ) return "no element is missed"; while(first
@YouTubeflixyt
@YouTubeflixyt Год назад
Great quality content keep it up❤️
@Rohit-zs7kn
@Rohit-zs7kn Год назад
const arr = [5, 7, 9, 11, 13, 15, 17, 21]; let index = 0; for (let oddNum = arr[0]; oddNum
@khanapeena2191
@khanapeena2191 3 месяца назад
in your code for loop should iterate till array.length-1
@Rubyd777
@Rubyd777 11 месяцев назад
I guess using some mathematics can be helpful. But i would use it only if array was large and we need to solve it in minimum time complexity else i would use sorting approach 1) Find max and min at once from array 2)find sum of odd numbers from 1 to nth term(let x) 3)find total sum of elemnts given in array (let y) 4)find total sum of odd number from min to max that we found above(let z) 5)lastly: (x-y)-(x-z) This can be simplified but you compolsary need x to find y and z Please correct if i am wrong. I just ried my approach
@addep-kardy
@addep-kardy 9 месяцев назад
This does work fine! const inp = [5,7,9,11,15,17]; const outp = []; for(let i=0; i < inp.length; i++){ if(inp[i]+2 != inp[i+1]){ outp.push(inp[i]+2); } } console.log(outp);
@syedwaseem3793
@syedwaseem3793 21 день назад
function findMissingOddNumber(numbers) { // Loop through the array of numbers for (let i = 0; i < numbers.length - 1; i++) { // Check if the next number is not exactly 2 more than the current number if (numbers[i + 1] - numbers[i] !== 2) { // If not, the missing number is between these two numbers return numbers[i] + 2; } } // Return null if no number is missing return null; } const input = [5, 7, 9, 11, 15, 17]; const missingNumber = findMissingOddNumber(input); console.log(missingNumber); // Output: 13
@unboxtheboxed-ox3cp
@unboxtheboxed-ox3cp Год назад
function oddcalc(arr){ for(let i=0;i2){ missing = (arr[i]+arr[i+1])/2; return missing; } } } let val =oddcalc([5, 7, 9, 11, 13, 15, 19]); console.log(val)
@yournanban3812
@yournanban3812 3 месяца назад
const input = [5,7,9,11, 15,17]; let missingNum = ""; for(let i= 0 ; i < input.length; i++){ if (input[i] + 2 != input[i+1]){ missingNum = input[i]+2; break; } } console.log(missingNum) //output missing odd number is 13
@WalkingtotheTruth
@WalkingtotheTruth Год назад
Binary Search is possible here is the answer: function findMissingOddNumber (arr) { let left = 0 let right = arr.length - 1 let startingNumber = arr[0] let ans = -1 while (left
@suryateja9881
@suryateja9881 Год назад
My solution for Sum 1: let input = [21,23,25,27,31,33,35,37,39,41,45,47,49,53]; for (let i=input[0];i
@vin2368
@vin2368 Год назад
const Arr3 = [6,9,12,18,24,30] const n = 3 function getMissingOddNumbers(arr){ let output=[]; for(let i = 0;i
@ApurvaKashyap-kj6qz
@ApurvaKashyap-kj6qz Год назад
Because binary search is applicable where we r given a target number to search in an array .. which is not in this case .
@AashMusic1
@AashMusic1 Год назад
const lst = [5, 7, 9, 11, 15, 17]; let res = [] for (let i =0 ; i < lst.length; i++){ let current = lst[i] let nextOdd = current + 2 if(lst[i+1]===nextOdd){ continue; }else{ res.push(nextOdd); break; } } console.log(res)
@mohammedrayyan3029
@mohammedrayyan3029 3 месяца назад
const input7 = [5, 7, 9, 11, 15, 17, 21, 25]; const output7 = 13; function missingNumber(input7) { let index; for (index = 0; index < input7.length; index++) { if (input7[index] > output7) { break; } } input7.splice(index, 0, output7); return input7; } console.log(missingNumber(input7), "missing");
@mohaimin95
@mohaimin95 Год назад
function missingOdd(arr) { for(let i = 1; i < arr.length; i++) { const last = arr[i - 1]; const current = arr[i]; if(current - last > 2) { return last + 2; } } }
@happylaughy2777
@happylaughy2777 Год назад
const arr= [3,5,7,9,13] let odd=arr[0]; for(let i=0;i
@MrHimanshuji1729
@MrHimanshuji1729 Год назад
const input = [1,5,7,9,11,15,17,21,25]; let inputFirst = input[0]; let inputEnd = input.at(-1); let missDigit = []; for(let i = inputFirst; i
@abnow1998
@abnow1998 11 месяцев назад
It is in AP(Arithmetic Progression) Just check Common Difference. Formula: a+(n-1)*d a is first number, d is common diff
@an.ma007
@an.ma007 Год назад
const arr=[5,7,9,11, 15,17] function findMiss(arr){ for(let i=0; i
@bathininaveen5198
@bathininaveen5198 9 месяцев назад
function findMissingOdd(arr){ for(let i =0;i 2) return arr[i] + 2; } return "No element is Missing!" }
@AkashSingh-xf6bd
@AkashSingh-xf6bd Год назад
let input =[5,7,11,13,15,17]; let out = 13 function s(input){ for(let i= 0; i
@GurpreetSingh-gogsy
@GurpreetSingh-gogsy Год назад
const input = [5,7,9,11,15,19]; for(let i=1;i
@abdulbasith650
@abdulbasith650 7 месяцев назад
let arr = [1,3,5,7,9,13] function misodd(arr){ let misnum; for(let i=0;i
@tonmaysardar3331
@tonmaysardar3331 Год назад
const input=[1,3,5,7,11,13,15,17] let b; for (let i=1;i
@shazaibahmad7807
@shazaibahmad7807 7 месяцев назад
Bro simple is that one if condition if(arr[I+1]-arr[I]===4) { return are[I+1]+2; } else{ return; }
@rajatgour9686
@rajatgour9686 8 месяцев назад
ok so let assume given arry is sorted const input = [5,7,9,11,15,17] let output = null for(let start = input[0]+2;start
@nitishgupta8393
@nitishgupta8393 Год назад
Q1: const missingOdd =(arr)=> { for(let i=0; i
@user-pj9ny2vt2l
@user-pj9ny2vt2l 11 месяцев назад
easy first sort then extract min and max after than loop range from min to max than extrat odd number list that number not in arr that is missing after first missing get break the array
@Doglapan64
@Doglapan64 Год назад
for (let i=0; i
@akash_gupta_2090
@akash_gupta_2090 Год назад
Missing odd numbers function missingFirstOddNumbers(arr) { const len = arr.length; let missingNumber = null; for (let i = 0; i < len; i++) { let _curr = arr[i]; let next = arr[i + 1]; if (next - _curr != 2) { missingNumber = _curr + 2; break; } } return missingNumber; }
@enthusiatic_coder6801
@enthusiatic_coder6801 Год назад
const input = [5, 7, 9, 11, 13, 17, 19, 21]; const compare = (a, b) => { return a - b; }; for (let i = 0; i < input.length; i++) { // console.log(input[i]); if (input[i] - input[i + 1] !== -2) { console.log('The missing number is', input[i] + 2); input.push(input[i] + 2); input.sort(compare); break; } } console.log(input);
@FarhanKhan-ox4iy
@FarhanKhan-ox4iy 11 месяцев назад
I see in the comments no one has used two pointers for this. With that we can achieve linear time complexity. Use start and end. Run while loop until end >= start. start++ and end--
@ankursharma1822
@ankursharma1822 9 месяцев назад
let arr = [5,7,9,11,15,17]; for(value of arr){ let a = value +2; if(!arr.includes(a)){ console.log(a); break } }
@prathamlashkari4230
@prathamlashkari4230 Год назад
let input = [5, 7, 9, 11,15, 17]; for (let i = 0; i < input.length; i++) { let diff = input[i + 1]-input[i]; if (diff !== 2){ console.log(input[i]+2); break; } }
@niju7489
@niju7489 Год назад
//AP addition formula s= n/2(frst +last) let len = input.length ; return (input[0] +input[len-1])(len+1)/2 - input.reduce((a,c)=>a+c);
@rahulkr7349
@rahulkr7349 Год назад
the question was simple. not that hard but the interview makes your heartbeat sound like a banging drum.
@coderdost
@coderdost Год назад
Yeah its the pressure which acts..
@harshjoshi6496
@harshjoshi6496 Год назад
@coderdost Binary search is possible here, Solution: (Explanation at last) const input = [5, 7, 9, 11, 15, 17,19, 21]; first = 0 last = input.length-1 mid = (first+last)/2 while (first
@coderdost
@coderdost Год назад
nice exaplanation
@tejasshinde2011
@tejasshinde2011 Год назад
let temp =input[0]; for (let i = 0; i < input.length && input.includes(temp + 2); i++, temp += 2); console.log(temp + 2);
@sanvijha
@sanvijha Год назад
We can not apply binary search for this problem as we have to evaluate key from the array itself.
@AbdurRahimKhan-gz1jo
@AbdurRahimKhan-gz1jo Год назад
Hey, @coderdost please do more videos like this...
@40fps143
@40fps143 Год назад
for last question i thought of this -- console.log(input.map((el) => el *n))
@chiraglegend2670
@chiraglegend2670 Год назад
function nextOdd(input){ for(let i=0 ; i < input.length ; i++){ let val = input[i]+2 if(val != input[i+1]){ return val } } }
@maazhasan-mi8le
@maazhasan-mi8le Год назад
input.forEach((element,index)=>{ if (element + 2 !== input[index + 1] && input.length > index + 1) { console.log('missing number is ', element + 2) } } )
@namangaur5329
@namangaur5329 Год назад
Binary search is not helpful in this case bcz in binary search we find a given number within array. But here the number itself not determined. So first we need to find the number and then we can use the bs to find the appropriate position for the number. I'm hoping that the answer is correct..😅 But this type of content is really helpful for us ... Thank u sir for making such type of content❣️
@coderdost
@coderdost Год назад
True story
@WalkingtotheTruth
@WalkingtotheTruth Год назад
Binary Search is possible here is the answer: function findMissingOddNumber (arr) { let left = 0 let right = arr.length - 1 let startingNumber = arr[0] let ans = -1 while (left
@WalkingtotheTruth
@WalkingtotheTruth Год назад
@@pawansinghrawat7886 const mid = Math.floor((left + right) / 2) this is the mid,we are traversing logn times not whole array,you can run this code and anlysis yourself, thank you.
@notyournormaldev1419
@notyournormaldev1419 11 месяцев назад
yes it is possible, i am the one in this video@@WalkingtotheTruth
@MilindP
@MilindP Год назад
const input = [5,7,9,11,15,17] let count = input[0]; input.map(e=>{e===count?count +=2:count}) console.log(count)
@aparnas1613
@aparnas1613 Год назад
Best simple code
@MilindP
@MilindP Год назад
@@aparnas1613 🙂
@coderdost
@coderdost Год назад
Good logic. only thing use forEach in place of map. Map should only be used when array output is expected. Since map builds a new array, calling it without using the returned array is an anti-pattern. Reference : [developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map]
@kiranm5419
@kiranm5419 Год назад
const input = [3,5,7,9,11,15,17]; for(let i=0;i
@ankitarya7492
@ankitarya7492 8 месяцев назад
let arr = [1, 5, 7, 9, 11,13]; let j = arr[0]; for (let i = 0; i < arr.length; i++) { if (arr[i] !== j) { console.log(j) break } j+= 2 } KeepItSimple
@arbazhussain6751
@arbazhussain6751 Год назад
Sir, I have tried to solve this question. Is it correct? // find the first missing ODD number let input = [5,7,9,11,15,17]; for(let i = input[0]; i < input[input.length-1]; i++){ if(i % 2 !== 0){ if(!input.includes(i)){ console.log(i); break; } } }
@coderdost
@coderdost Год назад
Even though it works. But there are some unnecessary iterations like "i" is 5,6,7,8,9 etc.. these values are not all needed like 6, 8 , 10 etc. You can optimize this solution to a more simpler method.
@rajatraj3160
@rajatraj3160 Год назад
sort the array use map and return the element which which has remainder 1. Or u can use sort along with map
@coderdost
@coderdost Год назад
@@rajatraj3160 array is already sorted.. so its even simpler now. and we can't evaluate using remainder, as here all numbers are ODD only. problem is to find out 1 missing number from sequence.
@AbhishekKumar-xw1cm
@AbhishekKumar-xw1cm Год назад
see this let input = [5,7,9,11,15,17] let n = 2 const findMissing = (input,n) => { for(let i =0 ; i < input.length ;i++){ if(input[i]+n !== input[i+1]){ return input[i]+n } } } console.log(findMissing(input,n))
@nevilmistry740
@nevilmistry740 Год назад
const arr = [3,5,7,9,11,13,17,19] //op -> 13 const arrLength = arr.length; let checker = 3 console.log(check(arr,arrLength,checker)) function check(arr,arrLength,checker){ for(i=0;i
@nevilmistry740
@nevilmistry740 Год назад
2 nd answer const arr = [5,7,9,11,13,17,19] const arrLength = arr.length; let checker = 3 console.log(check(arr,arrLength,checker)) function check(arr,arrLength,checker){ for(i=1;i
@nevilmistry740
@nevilmistry740 Год назад
just remove console😅😅😅
@adnaan28
@adnaan28 Год назад
const data = [5, 7, 11, 15, 17] for(let i =data[0]; i
@FreeTrial0315
@FreeTrial0315 11 месяцев назад
const arr =[5,7,9,11,15,17,19,23]; const data = new Set(arr) for(i=5; i
@sannisinha58
@sannisinha58 Год назад
It's very helpful... please continue😊
@sefumies
@sefumies 23 дня назад
const missingNumber = input.reduce((ac,c,i,a) => i == 0 ? a : ((c - a[i-1])> 2) ? a[i-1] + 2 : ac ,null)
@coffee0919
@coffee0919 Год назад
function findOdd(arr) { for (let i = 0; i < arr.length; i++) { if (arr[i] + 2 !== arr[i + 1]) { return arr[i] + 2; } } return -1; } Is that work?
@laylahashmi4234
@laylahashmi4234 Год назад
function missingOddNum(arr) { let completeArr = [arr[0]]; for (let i = 0; i < arr.length; i++) { let value = completeArr[i] + 2; completeArr.push(value) } return completeArr.filter((num) => !arr.includes(num)) }
@nageshswamii3770
@nageshswamii3770 Год назад
const input = [5, 7, 9, 11, 15, 17]; function missingOddNumbers(arr) { let min = Math.min(...arr); let max = Math.max(...arr); let oddNumbers = []; for (let i = min; i !arr.includes(x)); return res } console.log(missingOddNumbers(input));
@AvadheshVerma24
@AvadheshVerma24 Год назад
for (let i = 0; i < arr.length; i++) { let c = arr[i]; let next = c + 2; if (!arr.includes(next)) { console.log(next); break; } }
@darklord9500
@darklord9500 Год назад
function findMissingNumber(arr) { let missingNumber = null; for (let i = 0; i < arr.length; i++) { if (arr[i] !== arr[0] + i * 2) { missingNumber = arr[0] + i * 2; break; } } return missingNumber; }
@mitesh5189
@mitesh5189 Год назад
const b = [5,7,11,13,17] function missOdd(arr) { let i = arr[0]; let a =0 while(true){ if(arr[a]===i){ i +=2; a++; } else{ console.log(i); break; } } } missOdd(b);
@coderdost
@coderdost Год назад
simple and effective. using 'a' as index and 'i' as element is only distracting part.
@uditkhandelwal6330
@uditkhandelwal6330 3 месяца назад
USING BINARY SEARCH -> const input1 = [5, 7, 11, 13, 15, 17, 19]; const input2 = [19, 17, 13, 11, 9, 7, 5]; const findMissingOddNumber = (arr) => { let l = 0; let r = arr.length - 1; let d; if(arr[l]
@teentexh
@teentexh Год назад
let array=[5,7,9,11,15,17]; let value=array[0]; for(let a of array){ if(a===value){ value+=2 ; }else{ console.log(value); break; } }
@devpatidar84
@devpatidar84 Год назад
what I had done for(let i=0; i< input.length; i++){ if(input[i+1] - input [i] > 2){ console.log(input[i] + 2) } } is it right ?
@coderdost
@coderdost Год назад
yes. replacing 2 by "n" can make it more dynamic to and useful fo any kind Arithmetic progression
@nikhilnikki9627
@nikhilnikki9627 Год назад
IS THIS CORRECT WAY: const input=[5,7,9,11,15,17] let first =input[0] for (let i of input){ if (i ===first){ let next = first+2 first=next } else{ console.log(first) } }
@coderdost
@coderdost Год назад
yes, but I think you can remove "first" and use only 1 variable "next" let next =input[0] for (let i of input){ if (i ===next){ let next = next+2 } else{ console.log(next) } }
@amazondeals7284
@amazondeals7284 Год назад
Solution 1: const input = [5,7,9,11,15,17] const findMissing =(arr)=>{ let temp = arr[0] for(let i= 0; i< arr.length; i++){ if(temp !== arr[i]){ return temp; } temp += 2 } } console.log(findMissing(input))
@amazondeals7284
@amazondeals7284 Год назад
To change my algorithm to multiple of three, I have to increase the temp to 3.
@shivagyawali2590
@shivagyawali2590 Год назад
const input = [5, 7, 9, 11, 15, 17]; const missingOdd = input.reduce((prev, curr, index) => { if (index === 0) return curr; const nextVal = prev + 2; if (nextVal !== curr) return nextVal; return prev; }); console.log(missingOdd);
@coderdost
@coderdost Год назад
try with this : [5, 7, 11, 13, 15, 17];
@rahil516
@rahil516 Год назад
First view ; Sir your videos are very helpful appreciated
@jsview5315
@jsview5315 Год назад
Hi sir I am fresher Frontend dev i have completed projects and portfolio too and have little bit DSA knowledge but Machine coding and this type question se daar lgta hai so job ki tention aa rahi hai . Please suggest anything
@coderdost
@coderdost Год назад
Everyone fears such questions as they are matter of practice. So just keep doing such questions more and more. And in real round they will feel simpler. Without practice it will be hard
@jsview5315
@jsview5315 Год назад
@@coderdost Thanks for the reply sir your content is awesome.
@584_tyit_rohitghadge9
@584_tyit_rohitghadge9 27 дней назад
let arr=[1,3,9,11,15,17]; let emp=[]; let missingvalue=(arr)=>{ let min=Math.min(...arr); let max=Math.max(...arr); for(let i=min;i
@Doglapan64
@Doglapan64 Год назад
@coderDost Please let us know how to break forEach loop ? without using try-catch
@sumitkumar-in2si
@sumitkumar-in2si Год назад
Is this correct? let input=[5,7,9,11,15,17]; for(let i=0;i
@coderdost
@coderdost Год назад
Yes
@shailenderjaiswal1685
@shailenderjaiswal1685 Год назад
sir please 🙏 make react interviews also
@coderdost
@coderdost Год назад
Have you seen all old ones react interviews??
@DhirajkaReview26
@DhirajkaReview26 Год назад
Sir one question currently i am cdac student they teaches so many concepts rapidly and some topics I don't understand so can u tell me about is that our interview is which base and how should I have to prepare for interview the level Interview they can u tell me about that ??
@coderdost
@coderdost Год назад
for long term only your knowledge matter, how many projects you have worked on. What you can make. preparing for interview is only a short term things for placements. Interviews are mostly based on popular tricky questions. Just go on internet and check the question related to JS or React. Same 50 questions are asked mostly We made a playlist of popular question in JS and React here : REACT Interview Shorts : bit.ly/3VfIrMi JAVASCRIPT Interview Shorts: bit.ly/3XhHRQ1
@DhirajkaReview26
@DhirajkaReview26 Год назад
@@coderdost thanks sir , i saved those playlist and sir one more thing as knowledge perspective my explanation and understanding is good but sometimes I can't write because of syntax is that ok ? As i herad from student interview just how much i understand and even if writte normal code they say is ok for them to hire , like now they start adv java as seen jdbc code to connect i don't they will write that whole code in 1 hour interview can tell me about those things , i have your adv java one video also for reference 🤓 can explain this point how much interview can ask like 5 min code on notepad ?
@coderdost
@coderdost Год назад
@@DhirajkaReview26 Most of them look for approach rather than exact code. So your code or Pseudocode should explain the steps. They look if you can think of logic, why this logic, what are limitation of that logic, are their any bounds in which that logic will work, are there performance issue with that logic,... They try to change some part of that question also - to check if you can now think of different logic also, to check if you have not mugged up from somewhere. If they have to check syntax and code prefection they will always ask to code on some machine.
@DhirajkaReview26
@DhirajkaReview26 Год назад
@@coderdost thank u so much to clear my questions, getting proper suggestions and knowledge From u it's so much for me , thanks lot 🙏
@a.spragadeeshbalaji2917
@a.spragadeeshbalaji2917 7 месяцев назад
//FIND THE MISSING ODD NUMBER WITHIN THE RANGE SPECIFIED IN THE ARRAY const input = [5,7,9,11,15,17]; for(let i=input[0]; i
@lalitsinghnegi1562
@lalitsinghnegi1562 Год назад
aaj meri joining thi or m MERN stack profile ke liye gya tha or saalo ne python ( flask ) ka project de dia ... pehle se bna hua tha ab usme new functionalities dd krni h or mujhe python aati h nhi .. ab m kya kru
@coderdost
@coderdost Год назад
I think learn python because JS and python are almost same. and flask is much easier like express ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1K3zzooJIJM.html
@lalitsinghnegi1562
@lalitsinghnegi1562 Год назад
@coderdost aap shi keh rhe h but agr wo pehle ye baat bta dete ya post m mentioned kr dete to m join hi nhi krta .. but ab bna hua project h to mere kch samjh m aa nhi rha h .. smjh nhi aara kya kru
@coderdost
@coderdost Год назад
There are some hard realities of tech sector...they hire for some profile but give work in some other...specially to freshers.. Its hard to judge many companies..
@lalitsinghnegi1562
@lalitsinghnegi1562 Год назад
@coderdost yes bro .. i think i should quit ...
@coderdost
@coderdost Год назад
In sab facts ko batane k liye ek alag channel banane ka socha h ... soon will plan.. code wale channel pe to mix nhi krenge
@AbhishekSharma-fg1ho
@AbhishekSharma-fg1ho Год назад
its front end dev interview?? and which type of qus asking in front end dev
@coderdost
@coderdost Год назад
its only coding round for javascript (front-end). which is not compulsory in all companies Some other interview playlists: REACT Interview Shorts : bit.ly/3VfIrMi JAVASCRIPT Interview Shorts: bit.ly/3XhHRQ1 More REACT video Interviews - bit.ly/3QAjAln
@rajulorencemurmu3838
@rajulorencemurmu3838 Год назад
My approach is:- Since they all are odd then what we can do is create an array and store all odd elements in that array like 5 to 17 then we can compare them both using loops if the first element of new array does not match to the first element of previous array then we print that.
@coderdost
@coderdost Год назад
but creating another array is extra effort. it will increase the space complexity. you can use same logic on original array and check if next element is not the next Odd number ( previous + 2)
@zimbasardhara3450
@zimbasardhara3450 Год назад
let data =[1,3,5,7,9,11,15,17,19,21] let data2=[]; for(let i=0;i
@DeepakGupta-yk2ep
@DeepakGupta-yk2ep Год назад
Sir please make more Javascript interview videos
@coderdost
@coderdost Год назад
Yes 👍🏻
@nileshnilu7902
@nileshnilu7902 Год назад
Make more video like this very her.
@gojo55x
@gojo55x Год назад
Can you please tell me sir how much experience he has.....
@coderdost
@coderdost Год назад
Fresher
@ankurpandey3152
@ankurpandey3152 Год назад
Wow nice interview
@pritamkeshri8389
@pritamkeshri8389 Год назад
// ===========Missing odd Number const arr5 = [5, 7, 9, 11, 15, 17]; const arr5output = 13; function findOddNumber(input) { let output; for (let i = 0; i < input.length; i++) { let current = input[i]; let future = input[i + 1]; if (future && future - current !== 2) { output = current + 2; } } return output; } console.log(findOddNumber(arr5));
@payalkothari4862
@payalkothari4862 Год назад
let missingNumber; for (let i = input[0]; i
@PIYUSH-lz1zq
@PIYUSH-lz1zq Год назад
Bro , coding rounds ks ek alag se playlist bana do !!!
@coderdost
@coderdost Год назад
Will do
@PIYUSH-lz1zq
@PIYUSH-lz1zq Год назад
@@coderdost u uploaded only 2 video on js coding round ??
@coderdost
@coderdost Год назад
@@PIYUSH-lz1zq 3 videos. all in react interview playlist right now.. will move to separate one
@nazirrizwan
@nazirrizwan Год назад
Sir how apply and what procedure to all about this interview
@coderdost
@coderdost Год назад
There is a form which was put on community tab. Or directly book slot via emailing us. Email is in about us section. Business email section
@AkashSingh-xf6bd
@AkashSingh-xf6bd Год назад
Coder Dost, Hi I did not get you "n" concept in last can you explain me
@coderdost
@coderdost Год назад
like here N was 2. as each next number was +2. So just asked if we can code for any AP series like 3,6,9 - where N=3 and so on.
@AkashSingh-xf6bd
@AkashSingh-xf6bd Год назад
@@coderdost okay, now I get this
@vision_lc
@vision_lc Год назад
I make this question sir with not cheating sir
@CryptoAirdropnow
@CryptoAirdropnow Год назад
is there any way to give a mock interview with you
@coderdost
@coderdost Год назад
you can email. at email given on about page.
@immdipu
@immdipu Год назад
function missingOdd(array){ let firstDigit = array[0]; let missingDigit = null; while(missingDigit === null){ if(firstDigit % 2 !== 0){ if(!array.includes(firstDigit)){ missingDigit = firstDigit; return missingDigit; } } firstDigit++; }
@coderdost
@coderdost Год назад
Why we will need to check -> firstDigit %2, as all are odd only. and will have mod as 1.
@immdipu
@immdipu Год назад
@@coderdost all are not odd. firstDigit will increase by one each time the while loop runs. so it means the first time while loop runs firstDigit will be 5 and second time the while loop run the value of firstDigit will increase by one i.e 6 . 6 is not a odd number so that why we need firstDigit%2
@coderdost
@coderdost Год назад
@@immdipu OK, I think you can optimize by reducing the iteration and skipping the even increments totally
@shailenderjaiswal1685
@shailenderjaiswal1685 Год назад
why can we not use binary search here sir
@coderdost
@coderdost Год назад
binary search works when you know what to search for.. and divide the search space into half... and so on. Here we don't know where the missing number will occur. so dividing will not help us Optimize. both the left and right half of the divided part will be searched again.. If anyone has a better approach, can comment.
@shailenderjaiswal1685
@shailenderjaiswal1685 Год назад
@@coderdost understood sir👍
@aryankhandelwal15
@aryankhandelwal15 Год назад
Sir, pls raise the qus diff
@coderdost
@coderdost Год назад
Need candidates who want to have more difficult questions.
@montugohain48
@montugohain48 Год назад
Great video ,really helpful, I also tried is to solve and came up with this one.. class ArithmeticProgression { arr = []; constructor(a, n, num) { for (let i = 0; i < num; i++) { this.arr.push(a + n * i); } } AP_generator() { return this.arr; } AP_sum() { return this.arr.reduce((acc, cur) => acc + cur); } } const input = [5, 7, 9, 11, 15, 17]; const CompleteAP = new ArithmeticProgression( input[0], input[1] - input[0], ++input.length ); const givenTotal = input.reduce((acc, cur) => acc + cur); const ans = CompleteAP.AP_sum() - givenTotal; console.log(ans);
@coderdost
@coderdost Год назад
Answer might be right. But its a complicated approach also uses a lot of operations of summing whole array twice etc. both space and time complexity becomes high
Далее
React JS interview 2023 Live Coding Round (Mock)
18:33
Просмотров 295 тыс.
10 JavaScript Interview Questions You HAVE TO KNOW
13:41
Senior Angular Developer Interview (theory)
41:57
Просмотров 19 тыс.
React JS Live Code Interview Round  (Mock)
18:27
Просмотров 30 тыс.