JavaScript LIVE Coding Interview Round (Mock)

  Рет қаралды 38,297

Coder Dost

Coder Dost

Жыл бұрын

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/courses
🔴 Full Projects List : coderdost.com/projects
💾 Source Codes at : github.com/coderdost

Пікірлер: 177
@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 😇
@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.
@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
@user-oe3ld5kw6d
@user-oe3ld5kw6d 6 ай бұрын
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);
@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);
@Insightsusa
@Insightsusa Жыл бұрын
Great quality content keep it up❤️
@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
@khanapeena2191
@khanapeena2191 Ай бұрын
in your code for loop should iterate till array.length-1
@Rohit-zs7kn
@Rohit-zs7kn Жыл бұрын
const arr = [5, 7, 9, 11, 13, 15, 17, 21]; let index = 0; for (let oddNum = arr[0]; oddNum
@sannisinha58
@sannisinha58 Жыл бұрын
It's very helpful... please continue😊
@mohammedrayyan3029
@mohammedrayyan3029 Ай бұрын
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");
@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
@yournanban3812
@yournanban3812 Ай бұрын
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
@vin2368
@vin2368 Жыл бұрын
const Arr3 = [6,9,12,18,24,30] const n = 3 function getMissingOddNumbers(arr){ let output=[]; for(let i = 0;i
@bathininaveen5198
@bathininaveen5198 7 ай бұрын
function findMissingOdd(arr){ for(let i =0;i 2) return arr[i] + 2; } return "No element is Missing!" }
@an.ma007
@an.ma007 10 ай бұрын
const arr=[5,7,9,11, 15,17] function findMiss(arr){ for(let i=0; i
@AbdurRahimKhan-gz1jo
@AbdurRahimKhan-gz1jo Жыл бұрын
Hey, @coderdost please do more videos like this...
@tonmaysardar3331
@tonmaysardar3331 Жыл бұрын
const input=[1,3,5,7,11,13,15,17] let b; for (let i=1;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 .
@happylaughy2777
@happylaughy2777 10 ай бұрын
const arr= [3,5,7,9,13] let odd=arr[0]; for(let i=0;i
@akkburf5450
@akkburf5450 Жыл бұрын
let arr = [5,7,9,11,15,17] function missNumber(arr){ for(let i =0 ; i < arr.length ; i++ ){ if(!(arr[i] + 2 === arr[i + 1])) return arr[i] + 2 } } console.log(missNumber(arr))
@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)
@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
@WalkingtotheTruth
@WalkingtotheTruth 11 ай бұрын
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
@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
@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 11 ай бұрын
const input = [5,7,9,11,15,19]; for(let i=1;i
@nitishgupta8393
@nitishgupta8393 Жыл бұрын
Q1: const missingOdd =(arr)=> { for(let i=0; i
@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
@abdulbasith650
@abdulbasith650 4 ай бұрын
let arr = [1,3,5,7,9,13] function misodd(arr){ let misnum; for(let i=0;i
@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.
@Doglapan64
@Doglapan64 10 ай бұрын
for (let i=0; i
@Rubyd777
@Rubyd777 8 ай бұрын
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
@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; } }
@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);
@ankursharma1822
@ankursharma1822 6 ай бұрын
let arr = [5,7,9,11,15,17]; for(value of arr){ let a = value +2; if(!arr.includes(a)){ console.log(a); break } }
@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 } } }
@kiranm5419
@kiranm5419 Жыл бұрын
const input = [3,5,7,9,11,15,17]; for(let i=0;i
@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) } } )
@40fps143
@40fps143 Жыл бұрын
for last question i thought of this -- console.log(input.map((el) => el *n))
@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; }
@abnow1998
@abnow1998 8 ай бұрын
It is in AP(Arithmetic Progression) Just check Common Difference. Formula: a+(n-1)*d a is first number, d is common diff
@niju7489
@niju7489 10 ай бұрын
//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);
@rajatgour9686
@rajatgour9686 6 ай бұрын
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
@mohaimin95
@mohaimin95 11 ай бұрын
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; } } }
@shazaibahmad7807
@shazaibahmad7807 4 ай бұрын
Bro simple is that one if condition if(arr[I+1]-arr[I]===4) { return are[I+1]+2; } else{ return; }
@FarhanKhan-ox4iy
@FarhanKhan-ox4iy 9 ай бұрын
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--
@rahil516
@rahil516 Жыл бұрын
First view ; Sir your videos are very helpful appreciated
@adnaan28
@adnaan28 10 ай бұрын
const data = [5, 7, 11, 15, 17] for(let i =data[0]; i
@nileshnilu7902
@nileshnilu7902 Жыл бұрын
Make more video like this very her.
@ankurpandey3152
@ankurpandey3152 Жыл бұрын
Wow nice interview
@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));
@FreeTrial0315
@FreeTrial0315 9 ай бұрын
const arr =[5,7,9,11,15,17,19,23]; const data = new Set(arr) for(i=5; i
@user-pj9ny2vt2l
@user-pj9ny2vt2l 8 ай бұрын
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
@ankitarya7492
@ankitarya7492 6 ай бұрын
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
@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; }
@Doglapan64
@Doglapan64 10 ай бұрын
@coderDost Please let us know how to break forEach loop ? without using try-catch
@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; } }
@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..
@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
@laylahashmi4234
@laylahashmi4234 9 ай бұрын
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)) }
@uditkhandelwal6330
@uditkhandelwal6330 22 күн бұрын
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]
@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
@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?
@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]
@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😅😅😅
@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];
@bala7965
@bala7965 Жыл бұрын
@@coderdost const missingOdd=[5,7,11,13, 15, 17];; let start=Math.min(...missingOdd); let end=Math.max(...missingOdd); let output=[]; for(let i=start;i
@AbhishekSharma-fg1ho
@AbhishekSharma-fg1ho 11 ай бұрын
its front end dev interview?? and which type of qus asking in front end dev
@coderdost
@coderdost 11 ай бұрын
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
@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.
@unboxtheboxed-ox3cp
@unboxtheboxed-ox3cp 10 ай бұрын
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)
@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; } }
@amazondeals7284
@amazondeals7284 10 ай бұрын
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 10 ай бұрын
To change my algorithm to multiple of three, I have to increase the temp to 3.
@DeepakGupta-yk2ep
@DeepakGupta-yk2ep Жыл бұрын
Sir please make more Javascript interview videos
@coderdost
@coderdost Жыл бұрын
Yes 👍🏻
@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))
@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 kzfaq.info/get/bejne/Z7Fjrd2g1LCteoE.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
@payalkothari4862
@payalkothari4862 11 ай бұрын
let missingNumber; for (let i = input[0]; i
@FLIMFLASH26
@FLIMFLASH26 Жыл бұрын
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
@FLIMFLASH26
@FLIMFLASH26 Жыл бұрын
@@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 Жыл бұрын
@@FLIMFLASH26 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.
@FLIMFLASH26
@FLIMFLASH26 Жыл бұрын
@@coderdost thank u so much to clear my questions, getting proper suggestions and knowledge From u it's so much for me , thanks lot 🙏
@zimbasardhara3450
@zimbasardhara3450 Жыл бұрын
let data =[1,3,5,7,9,11,15,17,19,21] let data2=[]; for(let i=0;i
@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
@sumitkumar-in2si
@sumitkumar-in2si Жыл бұрын
Is this correct? let input=[5,7,9,11,15,17]; for(let i=0;i
@coderdost
@coderdost Жыл бұрын
Yes
@a.spragadeeshbalaji2917
@a.spragadeeshbalaji2917 5 ай бұрын
//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
@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
@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
@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 11 ай бұрын
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 11 ай бұрын
@@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 8 ай бұрын
yes it is possible, i am the one in this video@@WalkingtotheTruth
@gojo55x
@gojo55x Жыл бұрын
Can you please tell me sir how much experience he has.....
@coderdost
@coderdost Жыл бұрын
Fresher
@CryptoAirdropnow
@CryptoAirdropnow Жыл бұрын
is there any way to give a mock interview with you
@coderdost
@coderdost Жыл бұрын
you can email. at email given on about page.
@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👍
@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));
@aryankhandelwal15
@aryankhandelwal15 Жыл бұрын
Sir, pls raise the qus diff
@coderdost
@coderdost Жыл бұрын
Need candidates who want to have more difficult questions.
@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) } }
@shailenderjaiswal1685
@shailenderjaiswal1685 Жыл бұрын
sir please 🙏 make react interviews also
@coderdost
@coderdost Жыл бұрын
Have you seen all old ones react interviews??
@kiranm5419
@kiranm5419 Жыл бұрын
const input = [5,7,9,11,15,17]; const a = []; const b = []; for(let i=0;i
@jaspreetsingh-5259
@jaspreetsingh-5259 Жыл бұрын
const arr=[5,7,9,11,15,17]; for (let i=arr[0];i
@yashvantsharma7679
@yashvantsharma7679 Жыл бұрын
Sir plz reactjs developer 1.5 year experience interviews question share kijiye... Plz
@coderdost
@coderdost Жыл бұрын
There is 1 experienced person interview also in this series
@coderdost
@coderdost Жыл бұрын
More will come after that
@yashvantsharma7679
@yashvantsharma7679 Жыл бұрын
@@coderdost ok thankyou
@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)
@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.
@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
The day of the sea 🌊 🤣❤️ #demariki
00:22
Demariki
Рет қаралды 82 МЛН
THEY WANTED TO TAKE ALL HIS GOODIES 🍫🥤🍟😂
00:17
OKUNJATA
Рет қаралды 3 МЛН
MEGA BOXES ARE BACK!!!
08:53
Brawl Stars
Рет қаралды 32 МЛН
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 2,3 МЛН
Javascript LIVE Coding Interview (Mock) #javascript #reactjs
31:22
React JS interview 2023 Live Coding Round (Mock)
18:33
Coder Dost
Рет қаралды 286 М.
10 JavaScript Interview Questions You HAVE TO KNOW
13:41
James Q Quick
Рет қаралды 45 М.
How I Passed The Google Coding Interviews
18:50
Chris Jereza
Рет қаралды 19 М.
Solving a practical intermediate react interview challenge
13:28
Web Dev Cody
Рет қаралды 90 М.
APPLE совершила РЕВОЛЮЦИЮ!
0:39
ÉЖИ АКСЁНОВ
Рет қаралды 3,9 МЛН
Main filter..
0:15
CikoYt
Рет қаралды 11 МЛН
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 50 МЛН
Lid hologram 3d
0:32
LEDG
Рет қаралды 7 МЛН
сюрприз
1:00
Capex0
Рет қаралды 1,7 МЛН