andreyka26_se
Hello all new people, probably from Anna's meet, if you are from somewhere else - pls do let me know, maybe I should say kudos to somebody else. Quick intro about the channel, and what we are doing here is in "replied".
Btw, Anna is writing stuff here: https://nammemememe.substack.com
you might get a lot of interesting things about FAANG interviews, offers, how to prep, etc.
you might get a lot of interesting things about FAANG interviews, offers, how to prep, etc.
Substack
nammemememe | Substack
Click to read nammemememe on Substack. Launched a year ago.
❤5🔥3
Now there is going to be bunch of skipped daily leetcode qs that I was solving all that time but never posted. You can skip up until it will be the last one which is today:
1846. Maximum Element After Decreasing and Rearranging
1846. Maximum Element After Decreasing and Rearranging
🔥2
Daily (315/373 streak until LC cap)
Pretty tough one, but interesting.
https://leetcode.com/problems/maximum-building-height/?envType=daily-question&envId=2026-06-28
#daily #hard #nopattern
Pretty tough one, but interesting.
https://leetcode.com/problems/maximum-building-height/?envType=daily-question&envId=2026-06-28
#daily #hard #nopattern
❤1
Daily (317/373 streak until LC cap)
Pretty easy, but cool problem for challenging some of the leetcode problems. Recommended. Also it is special case of this problem https://leetcode.com/problems/rearrange-characters-to-make-target-string/submissions/2049315140/.
So you can solve 2 problems with one codebase.
https://leetcode.com/problems/maximum-number-of-balloons/description/?envType=daily-question&envId=2026-06-28
#daily #easy #pattern
Pretty easy, but cool problem for challenging some of the leetcode problems. Recommended. Also it is special case of this problem https://leetcode.com/problems/rearrange-characters-to-make-target-string/submissions/2049315140/.
So you can solve 2 problems with one codebase.
https://leetcode.com/problems/maximum-number-of-balloons/description/?envType=daily-question&envId=2026-06-28
#daily #easy #pattern
❤1
Daily (318/373 streak until LC cap)
This is hedge fund level of problems. Do not recommend, bullshit and useless.
https://leetcode.com/problems/number-of-zigzag-arrays-i/description/?envType=daily-question&envId=2026-06-28
#daily #hard #nopattern
This is hedge fund level of problems. Do not recommend, bullshit and useless.
https://leetcode.com/problems/number-of-zigzag-arrays-i/description/?envType=daily-question&envId=2026-06-28
#daily #hard #nopattern
❤1
Daily (319/373 streak until LC cap)
Same as prev one, but tighter constraints. Again, don't recommend, it is the problem they ask in hedge fund, not in FAANGs.
https://leetcode.com/problems/number-of-zigzag-arrays-ii/description/?envType=daily-question&envId=2026-06-28
#daily #hard #nopattern
Same as prev one, but tighter constraints. Again, don't recommend, it is the problem they ask in hedge fund, not in FAANGs.
https://leetcode.com/problems/number-of-zigzag-arrays-ii/description/?envType=daily-question&envId=2026-06-28
#daily #hard #nopattern
❤1
Daily (320/373 streak until LC cap)
Easy one for bruteforce, pretty hard for the optimized O(n) solution. But bruteforce will pass here.
https://leetcode.com/problems/count-subarrays-with-majority-element-i/description/?envType=daily-question&envId=2026-06-28
#daily #medium #pattern
Easy one for bruteforce, pretty hard for the optimized O(n) solution. But bruteforce will pass here.
https://leetcode.com/problems/count-subarrays-with-majority-element-i/description/?envType=daily-question&envId=2026-06-28
#daily #medium #pattern
❤1
Daily (322/373 streak until LC cap)
Not bad problem, not that hard, however no pattern.
https://leetcode.com/problems/find-the-maximum-number-of-elements-in-subset/description/?envType=daily-question&envId=2026-06-28
#daily #medium #nopattern
Not bad problem, not that hard, however no pattern.
https://leetcode.com/problems/find-the-maximum-number-of-elements-in-subset/description/?envType=daily-question&envId=2026-06-28
#daily #medium #nopattern
❤1
Daily (323/373 streak until LC cap)
Now today's problem (all previous ones where for my long time away)
This one is pretty easy, I would rate it as easy. Go for it.
https://leetcode.com/problems/maximum-element-after-decreasing-and-rearranging/description/?envType=daily-question&envId=2026-06-28
#daily #medium #nopattern
Now today's problem (all previous ones where for my long time away)
This one is pretty easy, I would rate it as easy. Go for it.
https://leetcode.com/problems/maximum-element-after-decreasing-and-rearranging/description/?envType=daily-question&envId=2026-06-28
#daily #medium #nopattern
❤1
Daily (324/373 streak until LC cap)
Easy if using O(n^2) or built-in function. But pretty tough if using some special algo like KMP.
https://leetcode.com/problems/number-of-strings-that-appear-as-substrings-in-word/description/?envType=daily-question&envId=2026-06-29
#daily #easy #nopattern
Easy if using O(n^2) or built-in function. But pretty tough if using some special algo like KMP.
https://leetcode.com/problems/number-of-strings-that-appear-as-substrings-in-word/description/?envType=daily-question&envId=2026-06-29
#daily #easy #nopattern
❤2
Warm up for Concurrency / Multithreading in System design. Let's say we have plane seat booking system like Kiwi or event booking system like Ticket master.
The domain is simple, multiple users might click on the same seat and double book it. Solution: lock the seat for 10 minutes and allow single user to proceed with payment or timeout before others can lock it as well.
The domain is simple, multiple users might click on the same seat and double book it. Solution: lock the seat for 10 minutes and allow single user to proceed with payment or timeout before others can lock it as well.
🔥5
andreyka26_se
Warm up for Concurrency / Multithreading in System design. Let's say we have plane seat booking system like Kiwi or event booking system like Ticket master. The domain is simple, multiple users might click on the same seat and double book it. Solution: lock…
Will this code lock seat without double booking?
Anonymous Quiz
15%
yes
61%
no, there will be double booking
24%
idk, see answer
❤3
andreyka26_se
Warm up for Concurrency / Multithreading in System design. Let's say we have plane seat booking system like Kiwi or event booking system like Ticket master. The domain is simple, multiple users might click on the same seat and double book it. Solution: lock…
The reason for double booking problem here.
We are assume our backend is multithreaded, however even in single threaded nodejs, the same thing can happen because of different network delays.
- 2 threads read the seat, and see status = "available", which means we can write "reserved".
- both threads are writing 'reserved' and putting their customer that is doing the request.
- you see that red customer2 (red) overrides whatever was written by customer1 (blue). However customer1 (blue) got successful write, no errors, nothing.
We are assume our backend is multithreaded, however even in single threaded nodejs, the same thing can happen because of different network delays.
- 2 threads read the seat, and see status = "available", which means we can write "reserved".
- both threads are writing 'reserved' and putting their customer that is doing the request.
- you see that red customer2 (red) overrides whatever was written by customer1 (blue). However customer1 (blue) got successful write, no errors, nothing.
❤2
andreyka26_se
The reason for double booking problem here. We are assume our backend is multithreaded, however even in single threaded nodejs, the same thing can happen because of different network delays. - 2 threads read the seat, and see status = "available", which…
you might think: yea, just let's do serializable isolation on database (single thread) and single thread of the app (async nodejs for example), and it will work
well.... no it won't.
For one threaded app. We can serially (single threaded manner) send requests to database, but due to I/O asynchrony, we might still end up in situation that both thread1 and thread2 read the data before any of them write anything.
For one threaded storage (can be Redis for example). Since 2 reads will happen before writes -> they will still return available, and then we just sequentially write the data as in the diagram.
So here neither single threaded app, not single threaded storage saves us.
well.... no it won't.
For one threaded app. We can serially (single threaded manner) send requests to database, but due to I/O asynchrony, we might still end up in situation that both thread1 and thread2 read the data before any of them write anything.
For one threaded storage (can be Redis for example). Since 2 reads will happen before writes -> they will still return available, and then we just sequentially write the data as in the diagram.
So here neither single threaded app, not single threaded storage saves us.
❤2
andreyka26_se
you might think: yea, just let's do serializable isolation on database (single thread) and single thread of the app (async nodejs for example), and it will work well.... no it won't. For one threaded app. We can serially (single threaded manner) send requests…
So remember, whenever you have race conditions situation in your system design, blindly "read data by application, make decision in application and then write back to storage" does not work.
You will need to use some additional things to make it work, and we are going to talk about it in the article that currently "work in progress"
You will need to use some additional things to make it work, and we are going to talk about it in the article that currently "work in progress"
👍7🔥2
Daily (325/373 streak until LC cap)
Not bad problem, has well known pattern that I haven't seen for a very long time in daily problems. Definitely recommended. It is not hard
https://leetcode.com/problems/number-of-substrings-containing-all-three-characters/description/?envType=daily-question&envId=2026-06-30
#daily #medium #pattern
Not bad problem, has well known pattern that I haven't seen for a very long time in daily problems. Definitely recommended. It is not hard
https://leetcode.com/problems/number-of-substrings-containing-all-three-characters/description/?envType=daily-question&envId=2026-06-30
#daily #medium #pattern
🔥6