andreyka26_se
606 subscribers
621 photos
66 videos
6 files
315 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
During the daily, I discovered interesting compiler optimization or whatever it is. Case1. I'm using permutations *= cnt % mod => gives 3600ms Case2. I'm using permutations = permutations * cnt % mod => gives 11ms
UPD:

permutations *= cnt -> 3000ms
permutations = permutations * cnt -> 3000ms
permutations = permutations * cnt % mod -> 17ms
permutations = (permutations * cnt) % mod -> 17ms
permutations *= cnt % mod -> 3000ms



For now seems strange
πŸ€”1
andreyka26_se
UPD: permutations *= cnt -> 3000ms permutations = permutations * cnt -> 3000ms permutations = permutations * cnt % mod -> 17ms permutations = (permutations * cnt) % mod -> 17ms permutations *= cnt % mod -> 3000ms For now seems strange
Actually makes sense. The smaller the numbers the quicker the multiplication.

p *= cnt % mod will be converted to p = p * (cnt % mod). So basically we will always work with bigger numbers

Order of operations isfrom left to right for β€˜*’ and β€˜%’ as they are same β€œrank”
πŸ‘1🀯1
Daily (124 day streak)

Happy Thursday. Amazing problem, I love problems that are representing some abstract model, that you can imagine, or even better - real world model, rather than just some numbers. Today is exactly that type of problems

https://leetcode.com/problems/count-covered-buildings/description/?envType=daily-question&envId=2025-12-11

#daily #medium
πŸ‘3
Fun fact, did you know you can add contributions/commits to github for the past and for future days. E.g. just added for 24th of Dec.

My ex techlead has shared the fun repo, and I was really doubting how it can add for the past or for the future, but it can for new empty repo

https://github.com/Shpota/github-activity-generator
πŸ”₯2
Well actually even in already created repo, you can do it, and it will be reflected in activity.

Here I created commit in 2026th.

But you would need to play with query parameters in github so it is shown:

https://github.com/andreyka26-git?tab=overview&from=2025-12-01&to=2026-12-11
πŸ”₯2😁1
I love Google ecosystem for personal use, Tasks, Calendar, Keep (notes), Drive/Docs, etc.

The only one thing I was not happy about Google Notes (Keep) is rich text editing (bold, italic formats, headings, etc).

THEY HAVE ADDED IT!!!

Was waiting for it for 3-4 years. On top of that every now and then I see improvements and new features for Google Tasks.

Love Google. At some point I will be hired there. Want to work on some of these personal / time management tools.
πŸ”₯12
Daily (125 day streak)

Actually nice problem. Feels like some version of real engineering problem that somebody had.

https://leetcode.com/problems/count-mentions-per-user/description/?envType=daily-question&envId=2025-12-12

#daily #medium
πŸ‘2
Daily (126 day streak)

Happy Saturday. Today is easy, so few mins problem - get your coin.

https://leetcode.com/problems/coupon-code-validator/?envType=daily-question&envId=2025-12-13

#daily #easy
πŸ”₯2
You watch as well?
πŸ‘9
Feeeh, Navi(((
Daily (127 day streak)

It is Medium+ or even Medium, not Hard for sure. Especially given the hints.

https://leetcode.com/problems/number-of-ways-to-divide-a-long-corridor/description/?envType=daily-question&envId=2025-12-14

#daily #hard
πŸ‘1
Vibe.

Goal is to eventually finish this book before 2026. I gonna do a review, cause in my opinion the book is REALY overrated.

What do you read nowadays?
πŸ”₯6
Daily (128 day streak)

Happy Monday, easy one, or easy-mid. Good problem - go and collect the coin.

https://leetcode.com/problems/number-of-smooth-descent-periods-of-a-stock/description/?envType=daily-question&envId=2025-12-15

#daily #medium
❀3
today's daily is hard, this is acceptance rate. But we are strong, there is discipline, so we gonna make it, however not before I go sleep
πŸ”₯3
andreyka26_se
today's daily is hard, this is acceptance rate. But we are strong, there is discipline, so we gonna make it, however not before I go sleep
fuck it, tomorrow watching editorial. I came up with dp then realized the budget is shared var between dp subproblems(
🀯1
Daily (129 day streak)

The hardest dynamic programming question I have every had. First time I see that DP function returns not scalar, but map that should be merged. No way I'm solving it within 1 hour, however initial idea was almost fully correct

https://leetcode.com/problems/maximum-profit-from-trading-stocks-with-discounts/description/?envType=daily-question&envId=2025-12-16

#daily #hard
πŸ”₯5
FUCK LEETCODE. omg these people again fucked up. So, today's daily (will post in a bit) is dp problem. I solved using 3 dp variables (top down memoization), and it hits memory limit.

Trying to put @cache -> memory limit. Trying to put @lru_cache -> time limit. Stupid shit required you TO FUCKING CLEAN THE CACHE BEFORE RETURNING ANSWER.
WTF??

So on the picture without cache = {} it won't work...

They also did it in editorial, CAUSE GUESS WHAT IT WILL ALSO FAIL WITH MEMORY LIMIT.
😁6πŸ”₯1🀑1