andreyka26_se
606 subscribers
585 photos
66 videos
6 files
295 links
Hey, I'm software engineer at Microsoft, with 7 years of experience. Here we are talking about F(M)AANG big tech interviews: leetcode, system design and corpo life.

YouTube: @andreyka26_se
Instagram: andreyka26_se
TikTok: @andreyka26__
Download Telegram
andreyka26_se
Seems like I got day off starting from now xDDD The thing is that everything is connected to MS account, and if I cannot log in - I cannot work
so it turned out that windows client DNS was broken. It happened to other people as well, and we ended up updating hosts file.

MS....
🤯2
Let's GOOOOOO

Dynamic Programming. I think this was the hardest topic for me back then. I might post a bit more problems related to dynamic programming then.

https://leetcode.com/problems/n-th-tribonacci-number/description/?envType=study-plan-v2&envId=leetcode-75
2
I came to the conclusion, that the best way to solve it is to do 3 step solutions.
Usually it looks like that:

1. brute force + recursion
2. top down: recursion + memoization (save sub problems' responses to map)
3. bottom up: start with sub problems' responses array and solve base cases. Then iterate and calculate the bigger subproblems based on previous (smaller)

Today we gonna solve this Tribonacci number using 3 approaches.
2
andreyka26_se
If you already solved basic fibonacci number before - you would already know the naive recursive solution. This is first step to solve the Dynamic Programming problem.
If you start building the call stack tree - you will see that there are a lot of function call with the same argument.

The time is exponential: every function call we are calling recursive function 3 times. So it is 3^n time somplexity. The space complexity is the height of this tree = O(n).

I think the call stack tree should lead you to the optimization here
1
andreyka26_se
If you start building the call stack tree - you will see that there are a lot of function call with the same argument. The time is exponential: every function call we are calling recursive function 3 times. So it is 3^n time somplexity. The space complexity…
What you have to do is to remember the result once you calculated it. So next time, if you need to do recursive call - you would return the result from the map straight away.
For it we don't have to change the code that much, only add map there
1
But then, what can be done even better, since it is recursive solution, and interviewer for sure will ask you - how you will deal with stack overflow, and is there any iterative solution. In that case - you should start from the below: building the solution from the base case and move up until your N. Then just return the last element in memoization array
1
Media is too big
VIEW IN TELEGRAM
Having fun in office’s music room
👍3🔥1
andreyka26_se
oops... As always, client fckd up https://www.techzine.eu/news/collaboration/129181/the-end-is-nigh-for-skype-microsoft-to-pull-the-plug-in-may/
Once you will hear official commentary from MS, I will tell the story as well as I'm kind of part of this thing :)
1
People, today we are streaming 19:00 UTC (8pm Prague time).
Gonna do couple of LeetCode questions, and implement the rate limiter we have designed before
2😁1
while implementing, we will talk a bit about concurrency. Think we never spoke about this topic before. And yeah, since we are talking about concurrency - we cannot talk about JS, so Rate Limiter will be implemented using my main: .NET.
1
Charging
This media is not supported in your browser
VIEW IN TELEGRAM
🔥1
Now implementing system design solution for rate limiter in .NET
1
Whoever was in the stream once. I would appreciate any feedback especially negative. Maybe you would like to see some other way, cause Im trying to explain pretty deep so 99% of people would understand the concept we are doing. Another thing, maybe topic that we are doing: leetcode and system design is not that important/ exciting? Let me know yeah. But I need to hear from u.
This media is not supported in your browser
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM