andreyka26_se
1.13K subscribers
1.23K photos
158 videos
9 files
700 links
Hey, I'm software engineer at Microsoft, with 8+ 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
How much I spend a month (corpo only, not personal)
So yea, I am spending on average 1k usd. Which seems crazy to me tbh. I never even thought about it, as for personal development I have 20$/month sub.

But here we go, I know one guy, ic1/jun position. He is spending 10k USD A MONTH.

Like wtf is that😁😁😁 what is he even doing, I have seen PRs
I think this is the point when some companies might rethink tokenomics

Because due to this 10k spending - you spend even more tokens to understand and review this - you spend even more money on cicd for that, as number pf PRs dramatically increased. And then you spend even more tokens for oncall after this code.
🤯6👍3❤1
Daily 376th day streak

Bullshit problem tbh, took me much more time to understand description than actually code it up.

Just follow blindly and formally the description, you don't need to understand the problem and build the mental model for it.

No pattern.

https://leetcode.com/problems/distribute-elements-into-two-arrays-i/description/?envType=daily-question&envId=2026-08-20

#daily #easy #nopattern
❤3
andreyka26_se
Hopefully somebody is interested. This is what is going on in the kernel for blocking socket.read() -> blue line Blocking -> means the thread in usermode that called it goes to sleep up until there is ready response in socket buffer. Then interrupt (push…
Now, how your nodejs/python/c# ASYNC AWAIT WORKS???

Under the hood, on the kernel level it is done via epoll. Epoll is specific kernel construct that can watch MULTIPLE blocking calls, e.g. multiple socket FDs and their .read() or .accept().

Before in blocking example, thread got blocked during .read(). It means it will wake up only when wait_queue of socket itself will be triggered by interrupt.

In THIS example, we are blocking the thread only on epoll_wait(). For that we have specific epoll wait_queue, that is interrupted by ANY FDs that were registered to epoll.

Now, how registration works? Whenever you create socket fd -> you are adding this fd to epoll red-black tree and connecting epoll callback with socket wait_queue. You can do that with MULTIPLE SOCKETS, thus waking epoll on earliest update.

It is pretty much JS event loop approach.
Now socket wait_queue gets interrupt and triggers epoll wait_queue and code gets update. Then we read socket buffer

#kernel #network
❤4👍2
andreyka26_se
We found the root cause. I mean one senior in US (blindly or not) did a fix and it helped. However it shouldn’t. Then I investigated why it helped? And it took me 4 hours of checking how rust runtime and thread pool works internally, what kernel does with…
So before we deep dive into that bug, lets recall again.

Blocking .read -> puts the task to sockets file descriptor wait_queue -> later on interrupt from NIC wakes this task by going to this wait_queue and call .wakeup()/marking task runnable.

Non-blocking .read with epoll - does not block, if the receve_queue (read buffer) in socket descriptor is empty it will return EAGAIN instead of blocking the thread. The blocking part is on epoll_wait -> that parks the task in epoll waiting queue (not socket fd waiting queue). And gets woken up by socket wait_queue task being calling epoll callback that wakes up epoll wait_queue task.

This way, epoll can “react” to any interrupt on any socket fds, not just single one (it has many of them), while blocking .read() will wait for this specific socket wakeup only.
🔥3❤1
andreyka26_se
We found the root cause. I mean one senior in US (blindly or not) did a fix and it helped. However it shouldn’t. Then I investigated why it helped? And it took me 4 hours of checking how rust runtime and thread pool works internally, what kernel does with…
The root cause was essentially the following: tokio runtime (shortly: rust multi threading async/await) was expecting socket calls to be non-blocking (via epoll). But socket was blocking one (by default), so every new connection put thread to sleep for duration while it waits for blocking .read().

Single runtime had , lets say 10 threads. So once we have 10 threads, 99% of the tome they are sleeping, then wake up for few ms, process result of blocking read and go sleep again.

No free threads to handle new connections.
❤3
andreyka26_se
Now I am switching to another level of bullying people about async/await😁
No offence to JS folks, it is just joke, I am JS dev to some extent as well.
And it will be the same question about async state machine for dot net, and event loop in python.

But probably not that many people went SO deep about async await. But you are the ones who know now.

I hope some of you would destroy interviewer that will ask about async await. Share such stories here please.🙏
❤4
This media is not supported in your browser
VIEW IN TELEGRAM
🔥19
A bit of night Dublin
🔥13❤2
Daily 377th day streak

I'm not sure what to say. Hard problem. There is math, and one approach that I have never seen in my life. Probably "one time" pattern => thus useless.

I would not recommend this problem tbh.

https://leetcode.com/problems/kth-smallest-amount-with-single-denomination-combination/description/?envType=daily-question&envId=2026-08-21

#daily #hard #pattern
❤3
Today is new video about the gym/health (will be shorts video). Dont do it there, but prepare your health/gym routines, under the comment section of the video. I will be very interested to learn, as I think I am very bad at keep eyes on my health
😁6❤4
Daily 378th day streak

Easy problem, just do what is said, 1 min coding.

No pattern though, skippable.

https://leetcode.com/problems/check-divisibility-by-digit-sum-and-product/description/?envType=daily-question&envId=2026-08-22

#daily #easy #nopattern
🔥1
Let me wake up properly, go to office and in 1-2 hours we can stream for a bit
🔥4