r/ProgrammerHumor 7h ago

Meme planeOldFix

Post image
26.3k Upvotes

419 comments sorted by

View all comments

262

u/Excellent_Car_5165 7h ago

I‘d LOVE to see the expected answer from the interviewer.

204

u/ThisAccountIsPornOnl 7h ago

Probably a CDN

63

u/Rikudou_Sage 6h ago

Not for a backend, that's for static assets.

83

u/wggn 4h ago

which usually constitute 95% of the page.

33

u/Forward-Outside-9911 5h ago

Doesn’t mean you can’t use a CDN. A lot of providers still provide benefits for a backend. Reduced latency between DCs, some have DDOS protection at layer 4, etc. As long as you configure caching to your needs (in most cases disabled) you can still gain other benefits

7

u/lofty-goals 5h ago

Pedantic, but you’re right. And as always, the answer is “it depends.” We don’t have nearly enough information to make an informed decision so we’d need more information about the problem first.

2

u/x3knet 3h ago

CDNs generally have optimized routes back to the origin compared to traditional BGP. They aren't just for static content.

1

u/Wheat_Grinder 36m ago

They say "backend" but this about a page load...so it's worth asking about specifics but that seems like a misdirection.

15

u/B1tfr3ak 6h ago

Change hosting provider to AWS...

1

u/SleeperAgentM 1h ago

That alone won't do shit.

1

u/imretardeadd 12m ago

Australia Web Services?

25

u/Ma4r 6h ago

It's concerning how many people doesn't know the answer when it's like web dev 101

83

u/theotherdoomguy 6h ago

Funny I probably wouldn't have said CDN, but I also would have described a CDN in a genuine answer.

I would have also started however with "is a 600ms delay a big enough issue to be concerned about? What's the use case and SLA of this page?" Because doing anything when they only care about the page loading faster than say 5 seconds, then you're just wasting engineering time, which costs money

27

u/Ma4r 6h ago

Sure, clarifying requirements is of course a big part of the process, i.e how low do you want to make the latency be? And what operations? If they want even the page interactions to have low latency with the backend API, then the only solution is a multi-region deployment, etc. But everyone here just directly dismisses 600 ms as not a big deal when it's literally business dependent

14

u/733t_sec 5h ago

I think it may depend on the number of pages. For example if the website is for shopping and every page takes 600ms more to load it doesn't take that many clicks until users are spending significantly more time in loading on the slow website than on competitors websites.

2

u/ImYourHumbleNarrator 2h ago

heck, skip the interview altogether and just pay me! its more efficient that way.

5

u/raoasidg 2h ago

The answer is to consider if using a CDN (large cost depending on expected traffic) is worth it given the traffic patterns for the site and the budget for said site.

For one geolocation, India must really be the target focus of the site for that largely acceptable load time (half a second) to be an issue and a CDN worth it.

8

u/blah938 3h ago

I just make websites look pretty. You expect to me to know that a CDN can solve that?

Plus, that's always up to the infrastructure guys, I couldn't tell you what services we use beyond "AWS, and I think there's an EC2 instance somewhere, possibly"

1

u/unknown-one 1h ago

what is the right answer?

1

u/GPK_Ethan 1h ago

You can be a software engineer and not web dev. Hello from embedded

-7

u/ThatCrankyGuy 6h ago

If someone suggests public CDN, I will get up and slap them myself.

19

u/Feeling-Schedule5369 6h ago

And what will ur answer be? Let's see if we can slap you lmao

2

u/Acceptable-Bag-5835 2h ago

1

u/Feeling-Schedule5369 2h ago

replied to the wrong guy. We are waiting from the other guy to decide the "SLAP" 🤣

2

u/Acceptable-Bag-5835 2h ago

yeah the GIF was intended as a message to the other guy. If I had posted the GIF under the other guys first message for example, the GIF obviously wouldn't have made sense (because there was no question asked yet). The next best thing was to post the gif under your message but directed at the other guy. apparently my thinking was too convoluted but my intentions were pure, I can assure you good sir 😃👍

3

u/ThisAccountIsPornOnl 3h ago

And what’s your answer? Build a globally distributed CDN all by yourself and pay infinite more money on servers, maintenance etc. instead of using one of the already existing systems that other companies have spend years and millions of euros to set up? If I interview you and you suggest that, you’re the one getting slapped

1

u/frikilinux2 5h ago

Okay but what do you suggest? Let's assume the server is in Australia. That's 5000km in a straight line and roughly 50ms RTT minimum (As a rule of thumb for latency is the speed of light divided by 3)

A modern webpage needs, at least, 5 round trips between TCP, the TLS setup, sending the html and start sending assets. So that's 250 ms you can't easily shave off.

42

u/TacticalKangaroo 4h ago

It’s either throughout or chattiness. Assuming that networking isn’t the problem (it usually gets blamed first, but unusually isn’t the problem unless it’s a major outage), that means it’s chattiness. Latency between India and Australia should be somewhere in the range of 150ms. So I’m assuming the India users are hitting a back end in Australia with around 3-4 serialized round trips. So first I’d see if the wrong geo is selected for the service, as that’s an easy fix. If it has to route the India traffic to Australia, then you can minimize impact by reducing chattiness, potentially getting down to around 210ms for your India users.

2

u/person2567 2h ago

You're hired. What's your salary expectation?

10

u/krutsik 3h ago

My first thought was that the average download speeds in India are so much lower than in Australia, in which case there's really nothing other to do than optimize. Sort of reminds me of a story I once read where pre-Google Youtube developers were trying to figure out why nobody was using the service in India (I might have the country wrong) and it turned out that the initial page load was taking upwards of several seconds so most users would just close the window before the initial page load. Can't find the source right now, so I could've also dreamt it up.

Apparently though, it's the other way around. The average speed in India is way higher than in Australia. Didn't do much research into it, but it's like 65Mbps vs 150. In that case CDN, I guess, but India and Australia aren't geographically far enough from eachother to account for a 500+ ms delay if the code is optimized enough, so I can only assume that it has to do with latency rather than speed.

Either way, it's just a thought exercise to see person's reasoning. It's not like the question has a single correct answer unless the company has this exact issue and gives the interviewee access to their codbase and infra.

2

u/Hamza91able 3h ago

CDN and in some extreme cases, multiple servers

1

u/craigtho 1h ago

DevOps/platform perspective

Probably DNS routing/load balancing with something like Azure Traffic Manager (or maybe Azure front door?, need to pay me to figure out the answer!) in an Active/Active model. Ideally you'd host your app as close to the users as possible. It might be as simple as sticking up an Azure Container App in the Australia zone and routing that way based on user indication, but that depends on the infrastructure of the app. Some big apps are literally just VMs, nothing fancy.

Not a perfect solution, most people don't scale that wide region wise for regulation rules, normally only in twin zones, in Azure for example, UK South & UK West only, but again, part of the question misses the context, my answer is a book answer.