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
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
andreyka26_se
1/16 https://www.youtube.com/live/5R7jVjeFEng?is=NPsikssXjWl1WxHd #leetcode #stream
Follow up jump game 2, and iterative inorder traversal.
Next time we are starting with them
🔥6❤1
Daily 379th day streak

Bullshit problem. Pure math, edge cases, brain puzzle. Useless for interviews, no patterns.

Not recommended.

https://leetcode.com/problems/sum-game/description/?envType=daily-question&envId=2026-08-23

#daily #medium #nopattern
❤2
Want some stream a bit today as well? Or better next weekend?
🔥9
andreyka26_se
Want some stream a bit today as well? Or better next weekend?
in 30 mins

(there will be recording), so no worries
🔥7
Interesting conversation with Claude. So Integrated information theory for Consciousness is the one that really has first proof?)
🤔5