Тёмный
Devtools Tech
Devtools Tech
Devtools Tech
Подписаться
Devtools Tech is a RU-vid channel which was started as a collaborative effort among like-minded engineers to provide high-quality programming tutorials for free. We firmly believe in knowledge sharing and easy access to quality content for everyone. Hence, this channel is an effort to give back to the community and a step towards our belief -- "We rise by lifting others".

Interview questions: devtools.tech/resources/all?ref=dtyt-ql
Interview resources: devtools.tech/resources/all?ref=dtyt-rl

Not sure of your interview preparation? Needs a partner? Practice Interview session with us:
topmate.io/yomeshgupta

Yomesh Gupta
Portfolio: yomeshgupta.com
LinkedIn: www.linkedin.com/in/yomeshgupta/
Twitter: twitter.com/yomeshgupta
How to code like Senior Engineers!?
25:26
4 месяца назад
Комментарии
@SomeOne-bq7gt
@SomeOne-bq7gt 17 часов назад
Hi bro, i want to have some mock interviews conducted by you. But the price is high in topmate. You asked to reach out if facing any financial issues there but don't know how to reach out to you. please suggest some way bro
@DevtoolsTech
@DevtoolsTech 11 часов назад
Hi, please drop a mail to team.devtools@gmail.com with all your details and explaining your issue. Thanks!
@somith16
@somith16 2 дня назад
bhauya woh trello borad ke solution video kab upload kar rahe ho
@DevtoolsTech
@DevtoolsTech 2 дня назад
Abhi pata nahi. Record karna padega.
@somith16
@somith16 2 дня назад
@@DevtoolsTech ok bhaiya
@4318A.M.vishal
@4318A.M.vishal 3 дня назад
if i'm not wrong for the company based filter you've used the filtering based on if the name that you've selected in input is present in the title of the question as a substring or not right?
@DevtoolsTech
@DevtoolsTech 3 дня назад
No, it doesn't check the title of the question. I am tagging individual questions against their respective companies. If you enter a search term then it will check the question title.
@4318A.M.vishal
@4318A.M.vishal 3 дня назад
Yeah that’s what I’m also asking. The title you’re referring to is the title of the question right which also says “Atlassian front end interview question” so my question is after a companies name in the company select input field are you filtering the data based on that the word atlassian is present in the question’s title or not. If not then how are you filtering and also why not to filter it like I said does it cause any performance issues?
@DevtoolsTech
@DevtoolsTech 3 дня назад
Like I said if earlier filtering was just search term based where system used to filter on the question title. Now, it filters on an array in the question data which contains the companies. I don't want to search on title as a question might be tagged with multiple companies so can't mention all in the title. There are indexes on the title field in the db so it is performant but not scalable.
@4318A.M.vishal
@4318A.M.vishal 3 дня назад
@@DevtoolsTech oh ok now I understand you have a separate column attached to it which says which company that question as been asked.
@DevtoolsTech
@DevtoolsTech 3 дня назад
Yes. A separate field/column in questions table.
@SachinYadav-yx1rc
@SachinYadav-yx1rc 3 дня назад
Helpful Video thank you ❤
@eyerahulk
@eyerahulk 5 дней назад
Hello Bhaiya, recently I gave an interview - the interviewer asked to create a normal counter app but the updates should happen with useEffect. I am not able to figure out the correct way for this. can you please guide? I gave the normal approach for handling clicks on plus and minus btns.
@DevtoolsTech
@DevtoolsTech 5 дней назад
Hello, I think he wanted you to use setInterval in the useEffect that updates the counter every second and clear the timer on component unmount.
@eyerahulk
@eyerahulk 5 дней назад
@@DevtoolsTech Yeah could be, I got blank at that point :( , Thank you!
@DevtoolsTech
@DevtoolsTech 5 дней назад
Happens! Better luck next time. 🙌🏼
@vishwanathveerni5007
@vishwanathveerni5007 4 дня назад
Hey there, which company was it? 🤔
@sssrikanthhh
@sssrikanthhh 5 дней назад
@chiragmakdiya3841
@chiragmakdiya3841 10 дней назад
Thanks Yomesh always love to watch you stuff, great learning
@DevtoolsTech
@DevtoolsTech 10 дней назад
Great to hear that! 🙌🏼
@manojpathak2500
@manojpathak2500 10 дней назад
const countNumbers = (arr) => { return arr.reduce((totalCount, el) => { if (typeof el === 'number') totalCount++; else if (Array.isArray(el)) totalCount += countNumbers(el); return totalCount; }, 0); };
@akash-kumar737
@akash-kumar737 11 дней назад
Thanks Yomesh, every week we all egarly wait for your question. Solved it on own, it was not that hard but helpful for me to recall js syntax. 💚
@DevtoolsTech
@DevtoolsTech 11 дней назад
Glad to hear that! Many more to come. 🚀🙌🏼
@manojpathak2500
@manojpathak2500 12 дней назад
Thanks for the video ❤ We can also use groupBy to solve this problem: const calculateAwards = (winners) => { const prizes = []; const groupByYear = groupBy(winners, "year"); const groupByCategory = map(groupByYear, (winners) => groupBy(winners, "category")); const groupByTeam = map(groupByCategory, (categoriesObj) => map(categoriesObj, (winners) => groupBy(winners, "team"))); forEach(groupByTeam, (categoriesOb, year) => { forEach(categoriesOb, (teamsObj, category) => { const categoryWinners = reduce(teamsObj, (categoryWinners, winners) => { const share = 1 / (winners.length * Object.keys(teamsObj).length); categoryWinners.push(...winners.map(({ name }) => ({ name, share }))); }, []); prizes.push({ category, year, winners: categoryWinners }); }); }); return prizes; };
@prashantindurkar1457
@prashantindurkar1457 12 дней назад
Thanks nice explanation
@DevtoolsTech
@DevtoolsTech 12 дней назад
Thank you! 🙌🏼
@shubhamthaker9380
@shubhamthaker9380 12 дней назад
when will i be able to do all of this on my own 🥺
@DevtoolsTech
@DevtoolsTech 12 дней назад
Soon with practice! Try all the questions I am sharing. Also, where are you struggling?
@shubhamthaker9380
@shubhamthaker9380 8 дней назад
@@DevtoolsTech i can think of the logic ki aaise aaise kar sakte hai and when i try to implement it just gets stuck at some point , syntatical knowledge isint syncing up with logical part. I hope i am making some sense
@eyerahulk
@eyerahulk 12 дней назад
Bhaiya konsa chair hai?
@DevtoolsTech
@DevtoolsTech 12 дней назад
Green Soul Monster Ultimate (T) Gaming Chair www.greensoul.online/products/monster-ultimate-t-gaming-chair
@akash-kumar737
@akash-kumar737 12 дней назад
Thanks man ❤. You are unstoppable 😊
@DevtoolsTech
@DevtoolsTech 12 дней назад
More coming soon! Like, share, and subscribe :D
@DevtoolsTech
@DevtoolsTech 12 дней назад
Question link: devtools.tech/questions/s/how-to-implement-a-prize-calculator-javascript-interview-question---qid---0rDhVLnqTFqzycgfAGPq Suggest Questions: forms.gle/oEi6LgxGZjAr3ynK6 Practice with us: topmate.io/yomeshgupta Sponsor us: topmate.io/yomeshgupta/748345
@sssrikanthhh
@sssrikanthhh 12 дней назад
Thanks for this video❤
@DevtoolsTech
@DevtoolsTech 12 дней назад
More coming soon! Like, share, and subscribe :D
@SubratKG000
@SubratKG000 12 дней назад
❤ Geniune guy
@prabhatkashyap8333
@prabhatkashyap8333 14 дней назад
when we practice should we practice in vanilla js or with some framework like react??
@DevtoolsTech
@DevtoolsTech 14 дней назад
You should practice in both. Some questions in frameworks and some in vanilla.
@prabhatkashyap8333
@prabhatkashyap8333 11 дней назад
@@DevtoolsTech and if we are preparing for senior frontend then, how much time should be given to 1 question to get it solved?
@DevtoolsTech
@DevtoolsTech 11 дней назад
Totally depends upon the question's complexity level. Usually a machine coding round interview lasts 60 mins max. You should always try to finish a question 10 mins prior to the allocated time so that you can a buffer for questions, enhancements, or any unexpected issues.
@prabhatkashyap8333
@prabhatkashyap8333 11 дней назад
@@DevtoolsTech ok cool thanks
@mohitarora2190
@mohitarora2190 15 дней назад
Hi is there any more parts to it ? I cant find it ?
@DevtoolsTech
@DevtoolsTech 14 дней назад
Yes, it is an incompelete series. But other parts are here ru-vid.com/group/PL4ruoTJ8LTT9_vAAZuwQLAnJyKXoMo2Zt&si=KvYMx_jbff8QvjbC
@mohitarora2190
@mohitarora2190 14 дней назад
@@DevtoolsTech Hi i want the next parts. Any plan making next parts ? or do u have the complete code for it ?
@DevtoolsTech
@DevtoolsTech 14 дней назад
I will make other parts soon. It is in my roadmap.
@mohitarora2190
@mohitarora2190 14 дней назад
@@DevtoolsTech They just need to be uploaded ?Are they recorded ? If they are going to take time, can u share any resource which i can follow to ocmplete it
@DevtoolsTech
@DevtoolsTech 14 дней назад
@mohitarora2190 I am yet to record. Sorry, I don't have resource around it. You can try reading the source code of the official library on GitHub if you want.
@AbhishekJain1992
@AbhishekJain1992 16 дней назад
No need for new state for loading, set size is good enough.
@AbhishekJain1992
@AbhishekJain1992 16 дней назад
Please don't teach wrong things. React does the delegation itself.
@DevtoolsTech
@DevtoolsTech 16 дней назад
Please share a valid resource or documentation to backup your claim.
@AbhishekJain1992
@AbhishekJain1992 16 дней назад
@@DevtoolsTech you can read about it in official document on react synthetic events.a
@AbhishekJain1992
@AbhishekJain1992 16 дней назад
@@DevtoolsTech ChatGPT - In React, event delegation is automatically handled to some extent through a mechanism called Synthetic Events. React doesn't attach event listeners directly to child DOM nodes. Instead, it attaches them to the root node (usually at the document level or the component's root). This is part of React's event handling optimization. Gemini - While React doesn't explicitly mention "event delegation" in its documentation, it does implement it under the hood. Here's what you need to know: How React handles event delegation: Root Container: In React 17 and later, event listeners are attached to the root DOM container where your React app is rendered. This means that a single event listener at the root handles events for all your React components. Event Bubbling: React leverages event bubbling, where events triggered on a child element propagate up the DOM tree until they reach the root. This allows React to capture events on any component within your application. Synthetic Events: React uses synthetic events, which are cross-browser wrappers around native DOM events. This ensures consistent event behavior across different browsers.
@DevtoolsTech
@DevtoolsTech 16 дней назад
Thanks for sharing. I will read about it. Could you please your LinkedIn so that others folks can connect and learn from your knowledge too. Thanks!
@suhailriyaz6612
@suhailriyaz6612 18 дней назад
let arr = [] let getState = [] const statesArr = (n)=>{ return Array(n).fill(0) } const handleClick = (index)=>{ arr.push(index) getState[index] = 1 if(arr.length === getState.length){ setTimeout(() => { deSelect() }, 2000); } console.log('select:',getState) } const deSelect = () =>{ i = 0; while(i<getState.length){ getState[arr[i]] = 0 console.log('deSelect:',getState) i+=1 } arr = [] } function main(){ getState = statesArr(8) console.log(getState) let input = [3,1,5,2,4,0,7,6] input.forEach(element => { handleClick(element) }); } main()
@DevtoolsTech
@DevtoolsTech 18 дней назад
This doesn't solve the question mentioned in the video. There is no event handler. You are setting the indexes to true in a sequence and then deselecting them. It is a partial solution.
@suhailriyaz6612
@suhailriyaz6612 18 дней назад
@@DevtoolsTech ok sir
@meghabathla7167
@meghabathla7167 21 день назад
That is a good explanation, though the question link has no utilis file. While showing the utilis file it was partially seen becs' the browser was open on another side.
@DevtoolsTech
@DevtoolsTech 21 день назад
Question link has a utils file. Go to the question link then check the Files section in the left sidebar. I solve questions on the platform so that I have same setup as everyone else. Please check.
@meghabathla7167
@meghabathla7167 21 день назад
@@DevtoolsTech thanks for sharing
@sarazamani4914
@sarazamani4914 22 дня назад
Thanks a lot 🙏
@yendasateesh6245
@yendasateesh6245 24 дня назад
Excellent content . Got a lot of knowledge
@DevtoolsTech
@DevtoolsTech 24 дня назад
Thank you! 🙌🏼
@snehalyelkar
@snehalyelkar 25 дней назад
In the handleClick method of the Box component, is it a quirk that the DEFAULT_BG_COLOR can be one of the possible grid bgColors, and by explicitly returning it, we won't handle its match?
@DevtoolsTech
@DevtoolsTech 25 дней назад
Yes, that is correct! Good catch! Two things to handle in that functiom We can add a check if isRevealed is true then explicit return as an early escape. We can update our getRandomColors method to handle blacklisted colors. You can also do some custom logic in the component if we don't want blacklisted colors change.
@sumanthprabhu11
@sumanthprabhu11 26 дней назад
Can u show us the code in the getRandomColor function.
@yomeshgupta
@yomeshgupta 25 дней назад
If you go to the question link in the description then the code is present in utils.js
@sumanthprabhu11
@sumanthprabhu11 25 дней назад
​@yomeshgupta My mistake.Actually, I was viewing in mobile, so I noticed it was mentioned to view it in the desktop for code editor
@yomeshgupta
@yomeshgupta 25 дней назад
@@sumanthprabhu11 no worries!
@somnathsahoo5547
@somnathsahoo5547 26 дней назад
Great problem sir❤
@DevtoolsTech
@DevtoolsTech 26 дней назад
Thank you sir!
@somnathsahoo5547
@somnathsahoo5547 23 дня назад
Sir can you guide me?
@somnathsahoo5547
@somnathsahoo5547 23 дня назад
Please 🙏
@DevtoolsTech
@DevtoolsTech 23 дня назад
Guide how?
@DevtoolsTech
@DevtoolsTech 26 дней назад
Question link: devtools.tech/questions/s/how-to-build-color-memory-game-in-react-js-frontend-coding-challenge---qid---1wFNDiwjxcKwrHL65SN5 Practice with us: devtools.tech/questions/s/how-to-build-color-memory-game-in-react-js-frontend-coding-challenge---qid---1wFNDiwjxcKwrHL65SN5 Updates: 1. We can improve the handle click logic by adding `isRevealed` to the condition. 2. We can add a `disabled` property to the button with the value isRevealed. <button ... disabled={isRevealed} />
@jaidhingra2811
@jaidhingra2811 25 дней назад
Yes, using some flag makes it easier to handle. We can make something like this: { id: 1, bg: '#ffff', isRevealed: false } for each box state. By this we can prevent handleClick from clicking the box again as you mentioned in above comment and easily manage other things in handleClick. I just stuck while shuffling part because I don't know any algo by which I can achieve this in O(N). So, on google search I found algo named 'Fisher-Yates shuffle' Thanks for this great question
@yomeshgupta
@yomeshgupta 25 дней назад
@@jaidhingra2811Lodash shuffe uses the same algorithm for shuffling!
@vjunloc1
@vjunloc1 27 дней назад
Bro kabhi smile bhi kar dia kar, Itna serious lagta hai, darr lagta kahi screen se nikal kar pitai na kar de
@DevtoolsTech
@DevtoolsTech 27 дней назад
Hahah bro I agree but kya kare thoda recording time pe serious sa ho jata hai. 😅
@yashpreetbathla4653
@yashpreetbathla4653 Месяц назад
Great content, thanks Yomesh!
@saquibakhter5801
@saquibakhter5801 Месяц назад
Hey yomesh, Thanks for sharing the solution, I have two doubts: 1. What if I use call instead of bind, what is the purpose of bind here. 2. What will happen if iteratee is an async function.
@DevtoolsTech
@DevtoolsTech Месяц назад
It won't work if we use call as it will invoke the function right away. We want to pass the function which should be invoked later with specific arguments. Callbacks are async too. However, promise handling is the second part of the problem. We need to modify the solution to accomodate that.
@JenilCalcuttawala
@JenilCalcuttawala Месяц назад
eslint-plugin-import should help in sorting the imports, configure the editor to run on save. we do this at our company.
@DevtoolsTech
@DevtoolsTech Месяц назад
Thanks for the suggestion!
@karthikm.1804
@karthikm.1804 Месяц назад
What is the salary range for frontend developer at uber
@DevtoolsTech
@DevtoolsTech Месяц назад
Depends upon many factors like experience, skills, profile, and more but it is good
@karthikm.1804
@karthikm.1804 Месяц назад
@@DevtoolsTech how much one can expect with 1-2 years of experience?
@ShubhamKedia-h5n
@ShubhamKedia-h5n Месяц назад
function getUserById(id, cb){ const time = Math.floor(Math.random() * 100) + 200; setTimeout(() => { cb('User' + id); }, time) } function mapLimit(inputs, limit, iterativeFn, callback){ const n = inputs.length; const outputs = Array(n); let successCount = 0; let currIndex = 0; const successCb = (index) => (output) => { successCount++; outputs[index] = output; if(currIndex < n){ iterativeFn(inputs[currIndex], successCb(currIndex)); currIndex++ } if(successCount === n){ callback(outputs) } } for(let i = 0; i < Math.min(limit, n); i++){ iterativeFn(inputs[currIndex], successCb(currIndex)) currIndex++ } } mapLimit([1,2,3,4,5], 2, getUserById, (result) => { console.log(result, "output") }) // What is thought on this solution?
@DhruvDhar-r3l
@DhruvDhar-r3l Месяц назад
i was under the impression that multiply had to be added to the prototype of the returned array only and not on the entire Array.prototype function tuple(input) { const outputArr = [] let stack = [] for(const ch of input) { if(ch === '(' || ch === ',' || ch === ' ') continue else if(ch === ')') { outputArr.push(stack) stack = [] } else { stack.push(+ch) } } //ADD multiply to the prototype of the returned array outputArr.multiply = multiply return outputArr }
@DevtoolsTech
@DevtoolsTech Месяц назад
It works both ways. You can add it to tuple too. There are edge cases that you need to take if you add it to tuple.
@DhruvDhar-r3l
@DhruvDhar-r3l Месяц назад
i was under the impression that `multiply()` had to be added on the prototype of `tuple()`'s result only..... function multiply(position) { let res = this[0][position-1] for(let i=1; i<this.length; i++) { res *= this[i][position-1] } return res } function tuple(input) { const outputArr = [] let stack = [] for(const ch of input) { if(ch === '(' || ch === ',' || ch === ' ') continue else if(ch === ')') { outputArr.push(stack) stack = [] } else { stack.push(+ch) } } // ADD multiply to the returned arr// outputArr.multiply = multiply return outputArr }
@saithulasiramr7167
@saithulasiramr7167 Месяц назад
lets say if ttl needs to be set for each feature flag? and add ff to cache in lazy manner rather than eager loading? Any thought on this
@DevtoolsTech
@DevtoolsTech Месяц назад
You can add ttl to each feature flag. Can use something like a Map for it. Why would you to want add it in lazy manner? What is the use-case?
@vaibhavmishra738
@vaibhavmishra738 Месяц назад
This solution seems wrong. Suppose you have a 3rd id with a very long request time. so 1 and 2 goes into postCompletionCallback . 1st timeout is completed and iterateeFn is called with 3 having long request time meanwhile 2nd timeout is completed and iterateeFn is called with 4 which has a short request time so obviosuly that will be completed first and User4 will be pushed which will call iterateeFn with 5 and its timeout will complete faster than 3rd timeout pushing User5 into outputs and at last after 3rd timeout is completed User3 will be pushed therefore making the solution wrong. If you want to confirm this , make random time multiplied by 1000 not by 100.
@DevtoolsTech
@DevtoolsTech Месяц назад
Currently, as per the question requirements, the wait time of each job is more than the preceding one. Hence, the solution will work. The solution is based on the specific requirements and details the interviewer provided. However, in the real world, the jobs can take unexpected amount of time. It is a follow up question to the current one. It won't be that straightforward to implement. It would require a combination of mix of tracking and promise based solution.
@samK12_18
@samK12_18 Месяц назад
I never understood useCallback & React Memo this crystal clear before. You've explained it so well probably i will remember it for lifetime now.
@DevtoolsTech
@DevtoolsTech Месяц назад
Glad to hear that. Thank you! Means a lot. 💜
@loveleetjoshi6027
@loveleetjoshi6027 Месяц назад
Can you please provide template you're using for reference.
@sujalgupta6100
@sujalgupta6100 Месяц назад
I understood the example, but want a clarification on somethings So, there are three things main Call stack (where synchronous code runs), CallBackQueue(MacrotaskQueue), and microtaskQueue. I want to understand the order that is being followed first all the sync code => done , call stack is now empty, during this time macro and micro queues have got some tasks in them if any. then what is the next order? all microtask then -> one oldest macrotask-> then all microtasks-> and so on. OR one oldest macrotask => then all microtasks => one oldest macrotask => and so on. I have spent so much hours on this, also read the mdn docs
@DevtoolsTech
@DevtoolsTech Месяц назад
Hi, first async then microtask queue then macrotask queue. It if first is first out in both the queues. So, when microtask queue is processed then it will execute the functions in the order of insertion. I hope it helps!
@SAMEERKHAN-nd7ti
@SAMEERKHAN-nd7ti Месяц назад
Thank you so much for your efforts bro!
@syncmaster320
@syncmaster320 Месяц назад
Hey! I do agree with the other comment and felt like something was missing or rush. Another thing I noticed is that the question is hinting at using async methods (likely Promise.SettleAll) but what you've implemented is very synchronous
@DevtoolsTech
@DevtoolsTech Месяц назад
Thanks for the feedback. I will keep it in mind. Question can be both sync and async. It depends upon what interviewer wants to see. As part of the solution prep, you can ask the interview what exactly they want. It can solved as a follow up question.
@sujalgupta6100
@sujalgupta6100 Месяц назад
So, when I was learning about Promise.all polyfill, I ended up implementing it two ways one using async/await (which I think is wrong, because async/await came after promises) and other using Promises in javascript in the async/await implementation I ended up coming on a conclusion that the equivalent of resolve in Promises is return in async/await
@DevtoolsTech
@DevtoolsTech Месяц назад
Okay. You can say that when you return a value then in async await then that value is final. However, not exactly equivalent to resolve in promise as if you have code after resolve that will be executed if you aren't doing return resolve(yourvalue).
@sujalgupta6100
@sujalgupta6100 Месяц назад
@@DevtoolsTech yes understood
@sujalgupta6100
@sujalgupta6100 Месяц назад
For example1 : When you say callback acts as argument fro WrappedPromise. Do we mean that, if from the first `then` you get a value and it will be passed to next `then` which will automatically wrap it inside a promise, and maybe also resolve itself and give it to the console.log? or the first then will return a promise of that value? The only thing I understand is that `then` will work for both promises and simple values
@DevtoolsTech
@DevtoolsTech Месяц назад
Every then method returns a promise. The callback's output will be the value with which then's wrapped promise will be resolved.
@MASTERISHABH
@MASTERISHABH Месяц назад
This video felt rushed. Question and the approaches were never discussed thoroughly before jumping into the solution. The solution however obvious it might be to you, from the 3rd person, the complete 11 mins were a waste of time to us.
@DevtoolsTech
@DevtoolsTech Месяц назад
Thanks for the feedback. I will keep it in mind!
@DhruvaPise
@DhruvaPise Месяц назад
We use aws code commit to maintain our code , is it possible to do same there
@DevtoolsTech
@DevtoolsTech Месяц назад
Not sure. I haven't used it. Please check the documentation for it.
@shylesscast
@shylesscast Месяц назад
Thank you for joining me & Sharing valuable insights. Hoping to shoot a long form content whenever I'm in Delhi .
@DevtoolsTech
@DevtoolsTech Месяц назад
Sure thing! Thanks for giving me a chance to share my thoughts! 🚀
@shylesscast
@shylesscast Месяц назад
Thank you so much for joining me ! 🙏🏻