Thinking Recursively | Microsoft Interview Question | Software Engineer UI/Frontend

preview_player
Показать описание
Thinking Recursively is very important if you're a Software Engineer. Be it Microsoft Interview, or even while in day to day job, Recursion plays a very important role in Software Engineer's life. In this video, I'll solve a Microsoft Interview Question, just like how candidates do in the interview. Will also tell you how to create a mental model of solution and think while approaching such questions.

It's not necessary that you solve the question in the first attempt. Most of the time we have to think step by step and gradually come up to the final solution.

Also, help me with the following for the next videos:
1. Continue using whiteboard just like interviews to solve problems
2. Use a code editor and type code while explaining

If this video was helpful, give it a thumbs up and subscribe to my channel for more such videos. 🔔

If you want me to cover any specific topic, then comment down below. I would be happy to help you.

If you find my videos helpful,
then please support this channel by buying a coffee,

Cheers,
Akshay Saini

Would love to Stay Connected with you ❤️

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

I've discussed all the 4 rounds I faced in detail along with the questions asked in each round.

akshaymarch
Автор

I had a situation where i had to return a simple object by filtering through a nested object and build a treeview. Thinking recursively solved my problem :-).
Great explanation Akshay )!

TanmayKamath
Автор

when you explain, every step unfolds so clearly. If I try the same, hell breaks loose!

timepass
Автор

I had learned this recursion in my University syllabus, but they haven't explained how much it can bhi usefull in real application problems.

Thank You Very Much 😊

mangeshgupta
Автор

I learn a lot from your videos. Thanks for making such contents.

sandeepsahoo
Автор

Your video is increasing the thinking level when I see any JS problem. Thank you 😊

adeshgangwar
Автор

Thank you for specifically walking through how user would interact with the function. That was super helpful in solidifying my understanding of the code.

kelseydavidson
Автор

thankyou so much from the bottom of my heart for such a wonderful explanation, Sir.!

AdnanAli-cphk
Автор

Recursion! This was a much needed video. Thanks Akshay.

abhijeetyadav
Автор

Thank you so much Akshay for making this video. I was able to recall this immediately when today I was solving an interview problem related to this but slightly modified. and finally i solved it. Thanks a lot. :D

suryapratap
Автор

Great task to practice recursion. Thanks for your work!

testingtesting
Автор

Hello Akshay,

Thanks for the solution. I faced this question while interviewing at Bloomberg. I did it in a very long way.
The interviewer asked me to refactor my code and give a solution, but as you mentioned we should dry run our code, and then we should implement.

My Solution:
function isNonPrimitive(obj) {
return ['[object Object]', '[object Array]'].includes(

)
}

function iterateObj(obj, str) {
if (!isNonPrimitive(obj)) console.log(str + ' -> ' + obj)
else if (Array.isArray(obj)) {
obj.forEach((val, index) => {
if === '[object Object]') {
for (let arr of Object.entries(val)) {
if (!isNonPrimitive(arr[1])) {
-> ${arr[1]}`)
} else {
if (str) {
str = `${str}[${index}].${arr[0]}`
} else {
str = arr[0]
}
iterateObj(arr[1], str)
let lastIndex = str.lastIndexOf('.' + arr[0])
str = str.substring(0, lastIndex)
}
}
} else {
console.log(`${str}[${index}] -> ${val}`)
}
})
} else {
for (let arr of Object.entries(obj)) {
if (str) {
str = str + '.' + arr[0]
} else {
str = arr[0]
}
iterateObj(arr[1], str)
let lastIndex = str.lastIndexOf('.' + arr[0])
str = str.substring(0, lastIndex)
}
}
}

MohitKumar-nhqb
Автор

Very informative and good explanation with suitable example . This is a common scenario in most of the front-end applications . Flattening the object improves the efficiency while searching by avoiding looping through the object multiple times . Will definitely try to apply this next time .

VijayKumar-zxbm
Автор

while watching your videos, I recall the days in Oracle while solving a similar kind of recursive problem to generate a tree structure in UI. Enjoyed every bits & pieces of the video. Great Video, KEEP IT UP.

BawalRider
Автор

Vinoth love >> Akshay:
30:23 better example taxanomy like you said electronic under refegerator, mobile, motor, fans,
then refegerator under recurservelly, samsung, LG, BoSS, and some other list .

super bro i clear... love you

vinothkumarv
Автор

Thanks Akshay ! I can't explain how much this video helped me in my works. Thank you for sharing this video. Its a great explanation!

rumelabasuroy
Автор

Super awesome.
Recursion concept is haunting me from start of my career.
You made it very easy.

Gauravguptakumar
Автор

Thank you so much for a crisp explanation! It helps a lot and gave me a idea of 'How to think Recursively' !

kanz
Автор

Marvellous explanation for Recursive approach. God may filled the joy in your life

imranshaikh
Автор

Thanks, this will solve a lot many problems. This will come handy when we will break the data that we are getting from API

VikasKumar-zwko