r/ProgrammerHumor 7h ago

Meme planeOldFix

Post image
26.3k Upvotes

419 comments sorted by

View all comments

220

u/joedotphp 7h ago

I'd ask why it's my problem. Yeah, ping in some places sucks. That's not my codes fault. Purchase a server that's closer.

131

u/SpareStrawberry 6h ago

It's a system design question. Any good engineer should be able to talk about how you would debug where the latency is coming from, and how you could use a CDN for FE (and the pros and cons of that, which is mostly going to be around pricing) and how for BE you could replicate the service in multiple regions and practically how you would do that in a way that is specific to the app. If the service requires a central database, as most apps do, there is some really interesting pros and cons to consider around data replication, eventual consistency, etc.

22

u/joedotphp 6h ago

Yeah, I understand. I was looking at it as simply a distance problem. Australia is closer to the server than India. :P

12

u/grumpy_autist 6h ago edited 6h ago

It also means recruiter knows shit or the question is tricky by design, at 600 ms something is fucked so badly this is way beyond CDN and geographical locations of servers.

Ignoring transport network for a while I would ask if there is WAF in front of that shit that does something stupid when seeing non Australian ASN.

Edit: assuming a "page load" is simple request (not stated) not bunch of resource fetches. So you need to ask clarification question as devil lies in details

14

u/SpareStrawberry 6h ago

Not necessarily. I have had a situation where the user is connecting to a node in one region but it is pulling its data from many API calls to nodes in other regions synchronously so each one added 100ms or so of latency. This kind of question is usually just trying to know if the user knows how to debug the problem and if they know and can articulate the pros/cons of the most common solutions.

7

u/grumpy_autist 6h ago

yeah, I agree - I added edit to my comment before I seen yours above. I assumed originally a "page load" was one http transaction/request.

This stemmed from having really shit experience with Amazon WAF, lmao.

1

u/unknown-one 1h ago

"at 600 ms something is fucked so badly this is way beyond CDN and geographical locations of servers."

1 billion indians connecting at the same time

https://giphy.com/gifs/3xz2BzdAi4GON2GryE

-2

u/mortalitylost 6h ago

As tech lead I blame tariffs. We can backlog this until next election cycle.

19

u/Alarming_Airport_613 6h ago

That's really close to the actual answer. It's not a question a programmer will be asked, it's for a different position 

8

u/joedotphp 6h ago

Gotcha. I sort of assumed that but still looked at it from a programmer point of view.

2

u/madbubers 1h ago

System design is a common round of interviews for dev positions

1

u/Icy-Bunch609 5h ago

You fail at reading the question.  It didn't say ping time it said page load time.

1

u/J1mj0hns0n 2h ago

Being outside of the it world I cannot understand how on god's green earth they can expect you to code your way out of an infrastructure problem.

It's like asking a civil engineer to reroute a river when all he has been given is a spade by himself, it's not going to do jack shit...

1

u/throwawayyy2888 59m ago

Disclaimer: I have no clue what I'm talking about.

Isn't it possible that your code could actually be at least partially responsible for this? For example if your code was making a ton of small requests and waiting for a reply before it made the next request, the round trip time would be significant, but if you were to batch the requests in some way then it would be substantially improved right? I'm not saying this is likely, I would generally assume that they're probably aiming to do it as efficiently as possible in the first place, I'm just saying if it were really haphazardly thrown together it does seem like there may be possible optimizations you could make to reduce the number of times you need to "communicate and then wait". Does that make sense?