andreyka26_se
1.13K subscribers
1.1K photos
142 videos
7 files
615 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
So, question from real prod investigation.

You are high load system, and you are checking metrics of where server sends requests to.

You see 99% of destination ports reported by some low level tool (bpf) equal to 47873.

Apparently this is not usual port, as most of the IPs are leading to cloud providers, eg azure, aws, etc.

What is the actual port?

Hint: small/big endian.

(Posting real answer with explanation in the evening)
πŸ”₯6
What is the actual port?
Anonymous Quiz
9%
47873
9%
444
54%
443
14%
80
8%
4000
5%
3000
❀3
Daily (258/373 streak until LC cap)


Regular easy problem, practicing more intuition building than any pattern

https://leetcode.com/problems/furthest-point-from-origin/?envType=daily-question&envId=2026-04-25

#daily #easy
❀2
andreyka26_se
So, question from real prod investigation. You are high load system, and you are checking metrics of where server sends requests to. You see 99% of destination ports reported by some low level tool (bpf) equal to 47873. Apparently this is not usual port…
The correct answer is 443.
Now explanation. On the low level (BPF) you might have two different bytes order (not bits order though) for number that include ips and ports: big-endian and small-endian. The problem was that some tool assumed wrong endian for port and did reversing of the bytes, however the underlying library was already giving the port in the correct number
πŸ‘5
As people say in google: β€œdoes the guy who created this service got promo so that I can drop it?”
😁11
Daily (259/373 streak until LC cap)

I mean whenever I see "maximum possible minimum" and hard badge, it is skip, I"m sorry. Took me too much to even understand the problem statement, and today was socializing day I don't even have energy to solve hard nonsense right now.

https://leetcode.com/problems/maximize-the-distance-between-points-on-a-square/description/?envType=daily-question&envId=2026-04-25

#daily #hard
❀6
bots got broken nowadays in Linkedin😁😁😁 wondering which company name they couldn't load.. snowflake?
😁9
This media is not supported in your browser
VIEW IN TELEGRAM
This guy’s really fighting with it😁
😁4❀2
Today daily is amazing graph problem. Definitely recommended
πŸ‘6❀1πŸ€”1
Daily (261/373 streak until LC cap)

Amazing graph problem. Definitely recommended, it is not that frequent to have a good problem on daily (I have put thumb up)

https://leetcode.com/problems/check-if-there-is-a-valid-path-in-a-grid/description/?envType=daily-question&envId=2026-04-27

#daily #medium #pattern #recommend
❀3πŸ‘2
Daily (262/373 streak until LC cap)

Funny, I has solved this problem 26th of March last year.

Not bad daily, however I don't see any pattern except some simple math and intuition.

https://leetcode.com/problems/minimum-operations-to-make-a-uni-value-grid/submissions/?envType=daily-question&envId=2026-04-28

#daily #medium #nopattern
πŸ‘3
I have decided. Next article is going to be Uber system design or Load balancers / proxies deep dive.

Dont worry, I am not switched to leetcode posting only, jut having hard time at snowflake at the moment.
πŸ‘15πŸ”₯3❀1
For the fuck sake, this is my wallpaper on working laptop. Nothing depicts my mood more now.

Fucking nda forbids me so much to say…
😁22🀯2
Daily (264/373 streak until LC cap)

Nice reminder for Dynamic Programming, not hard to be honest.

https://leetcode.com/problems/maximum-path-score-in-a-grid/description/?envType=daily-question&envId=2026-04-30

btw, yesterday's daily was a bit bullshit and hard, so skipping.

#daily #medium #pattern
❀4
Daily (265/373 streak until LC cap)

Purely math problem if you'd like to do it.
The challenge here is only to come up with smart formula.

https://leetcode.com/problems/rotate-function/description/?envType=daily-question&envId=2026-05-01

#daily #medium
πŸ‘3
NAT GATEWAY.

Sharing some real production learning. I was never using cloud properly as I never had to. Yesterday I needed to understand how AWS NAT GW works, and it was quite surprising.

How (in general) NAT GW works.

Client (or private server) from private network (let's say LAN, or cloud provider's private virtual network) WANTS to talk to internet.

Since client has private IP, if it directly sends the request to the destination, routers will drop it according to protocols they are using, as they need public source ip.

So what typically is done, e.g. in simple case of your home internet, you have wifi router, that serves as NAT GW and replaces your private ip to its public ip (SNAT - Source NAT). That way packet can be routed to destination

On the way back (response) NAT GW receives the packet, as it had the source public IP of initial request, performs DNAT (Destination NAT) and replaces destination to be the private client.

continuation in the next post ...
#network
❀3
Generally, if I am using NAT GW in some cloud provider and want to check the logs here, what I expect to see?

I would expect to see the logs for request out (egress):
- entry 1: ec2 -> natgw, so private ip of ec2 and private ip of NAT GW.
- entry 2: natgw -> internet, so PUBLIC ip of nat gw and PUBLIC IP of internet.

However this is not how it works guys.

===

You will never see public ip of the NAT GW in flow logs in aws, because NAT GW private IP -> NAT GW public IP translation happens on IGW instance (which is also NAT in nature). What NAT GW will do is just perform SNAT from ec2 private ip to NAT's private ip.

Another learning, flow logs can be attached to different instances, and ini case this is ENI, you should understand how to analyze it properly. For example response from internet to ec2 would typically mean "ingress" as it comes FROM internat TO our private network, BUT on ENI level, the leg NAT GW -> EC2 resopnse is EGRESS, because it is coming out of NAT GW ENI to EC2.
#network #cloud
πŸ”₯4❀1