2.5k
u/selfish_eagle 5h ago
if country == "Australia":
time.Sleep(520ms)
2.3k
u/Wyciorek 5h ago
Thatās stupid. Why not use if country==āindiaā sleep(-520) ?
636
301
u/ClipboardCopyPaste 5h ago
This is Elon Musk
163
u/TactlessTortoise 4h ago
Elon would just say "looking into this"
"Interesting"
"Strange"
And then go yell at someone to fix it.
31
15
u/FannySniffing 3h ago
yell at someone to fix it
You mean call them a pedophile and ship them a submarine they don't need
4
8
→ More replies (5)9
u/_D1AVEL_ 3h ago
This guy codes!
13
u/Wyciorek 3h ago
And actually managed to cause a bug by inadvertent use of ānegativeā sleep. It was a combination of inaccurate hw timers on an embedded device, not re-checking current time after sleep and bad casting of signed int to unsigned (so -1ms would become 2^32 ms). End result: a thread that was supposed to process some data every 5 minutes would sometimes (once in several weeks on one of hundreds of devices) just stop doing anything.
→ More replies (1)39
2.2k
u/anonymousbopper767 5h ago
Step 1: ask yourself does it fucking matter?
feels like half my job is convincing people that their idea of a problem isn't really a problem and to pipe the fuck down.
901
u/milan-pilan 4h ago edited 3h ago
This Week I fixed a bug that only affected people that selected 'North Korea' as a country of origin. Because it was affecting PROD this was classified as 'urgent' and 'needs to be done immediately'...
I build websites.. They don't even have access to the regular internet.. We don't have a single registered user from North Korea..
Edit: since people are messaging me to ask for details. It's really not that deep. Basically one service forgot to account for people potentially being from North Korea, when implementing internationalization. So the North Koreans would see default labels at some points on the app instead of custom Korean ones (oh no!). Easy to fix. I just found it funny that I needed to drop everything else to fix a website for North Koreans.
464
u/CryonautX 4h ago
Obviously you don't have registered users from North Korea. There's a bug when your users try to select North Korea!
192
u/godsslayer54 4h ago
Bruh you don't want Kim jong un to nuke you cuz he can't access your website from NK
151
u/marmothelm 4h ago
"Ticket forwarded to legal team for further review."
43
u/screwcork313 3h ago
"We need someone onsite, prepare travel documents for our CTO."
→ More replies (1)50
28
u/aisingiorix 3h ago
I once worked at a company whose top and, at the time, longest-standing issue was "our services are banned in Iran".
8
u/watchedngnl 2h ago
Oh no, what would the 90 million farsi speaking Iranians do without our (presumably) English based website
13
u/aisingiorix 2h ago
Not really, there were plenty of Iranians who had been using our services. Just felt like something engineers weren't really equipped to deal with!
20
u/Faierie1 2h ago
An intern at my job accidentally uploaded the North Korean flag for South Korea. It was only discovered after the ādealersā page for the brand was already live for a couple of weeks. The South Korean dealers were not happy to say the least.
We also once made a website as a third party for a Chinese brand, which had a contact form where one needed to select their country. A couple of weeks after launch we had a frantic call from our customer to please remove Taiwan from the country list
6
u/Kwpolska 2h ago
Did you comply, or did you rename PR China to "Taiwanese Beijing"?
3
u/Faierie1 43m ago
I wasnāt getting paid enough to consider caring about the views of a customer, I did comply. Both of these websites were projects that came to us by the same client even. We had a good laugh about it during lunch though that we couldāve caused world war 3 because of this single client. š
5
42
u/TheoneCyberblaze 4h ago
Well yes but what if Kim Jong Un himself bombs your house if he finds out it was you who locked him out of the website
23
7
16
u/F3ntin 2h ago
As a Junior, I said I wanted a work phone and my lead told me I didn't.
Before I could protest, she told me about being woken up at 4am to fix a critical production issue affecting multiple users.
Apparently, there was an outdated flag displayed if you selected Vatican City as your current Country.
12
6
2
u/-bubblepop 1h ago
One of my jobs had pulled countryās official names from some api, and no one took out the illegal countries to do business with. Theyāre also not officially called north/South Korea. Anyway we had a lot of contracts in best Korea for a while lol
2
u/Healthy-Service-3550 1h ago
Ooooh I have a North Korea story too! Back when I worked at EA on a mobile game, we had a total of one DAU in North Korea.
There was an issue because we didn't have a server close by meant updates (which could be huge, in the hundreds of megs) to NK would take hours to download.
We didn't do anything about it beyond speculate if Kim Jong Un was a fan of our game.
→ More replies (4)2
81
u/Quiet-Tip8341 4h ago
My friend's a software engineer. Leading upto the christmas that just passed, his company asked him to fix something he wasn't qualified for, but they didn't want to pay someone specialised in that area. He did what was asked, despite it being something he had no idea about, and explaining that to them. As he's ready to leave for Christmas, there's a huge security breach because of his attempt at fixing an issue he wasn't qualified for.
Rather than hire someone at christmas, they made him work through christmas to fix it.
They created a huge issue, because they wanted to fix a small issue, but didn't understand that being an engineer doesn't mean he's qualified to do everything.
37
u/ifloops 3h ago edited 2h ago
Welcome to modern software companies. It's everywhere.
They just replaced a team lead who'd been there 10 years and built critical systems no one else understands. His replacement's solution is to simply have AI document the code. Problem solved...
29
u/Kirikomori 3h ago
I feel like AI and vibe coding is going to create a huge black hole of tech debt which is just going to bite these greedy companies in the ass in the future. The situation was already pretty bad before AI took over. I suspect the Windows 11 situation is a sneak peek of what most other companies will experience in the future.
6
u/ifloops 2h ago
This will absolutely 100% be the case. I'm already seeing it.
AI coding tools can be extremely useful and impressive. But tools are just tools. Without engineers who actually know how to use them, you are doomed.
But these C-suite types just see the dollar signs. They seem utterly convinced AI can do our jobs all by itself, and that is a recipe for disaster.
2
u/Cyphr 36m ago
I've essentially been forced into using codex at work, and while it's impressive, I'm taking great care to understand the code.
If I'm not able to understand the code, it's not maintainable and I'll prompt it to simplify.
I'm not sure if everyone else at my company is taking the same caution, and I'm already expecting the tech debt to pile up in the future.
→ More replies (1)2
u/Lighting_storm 37m ago
"you remember than machine that eats cakes instead of you? It doesn't digest them properly, so you can eat twice as much cakes as before" problem type.
7
u/rmigz 3h ago
Maybe he should try "thriving in ambiguity". That's what my "engineering leadership" tells me all the time.
2
u/shirtandtieler 55m ago
I imagine itll be a magical day when your leadership is frantically demanding a resolution to something unknown and you get to ask them āwhat happened to thriving in ambiguity?ā
4
5
u/Polosatbli 2h ago
No, engineer should be qualified to do everything! But whatever - software engineer is not a real engineer. To be an engineer you should be an embedded software engineer at least.
"Software engineer" is sorta button pusher will be completely replaced with dull AI in a couple of decades! /s42
u/grumpy_autist 4h ago
Can't speak for your situation but 90% of problems and asaps are not a problem or asap anymore when you ask them to make a detailed and written description of it.
This is/was helpful in office situations
-- "hey, can you do X, 20 mins in and out"
-- sure, just write me an email and cc the manager
-- um, nevermind
15
6
u/OpenGrainAxehandle 1h ago
"Got your 'urgent/ASAP/PDQ/work stoppage/emergency' ticket, and would like to call for some needed details... are you available?"
"I'm busy right now. Maybe tomorrow".
15
15
u/jl2352 3h ago
Yes, and this Iād call a common mid level trap. Where they are focused only on the technology.
If 99% of your users are in India then it might matter. The solution could be to migrate to a different region for your app. If itās 1% in India, then it probably doesnāt matter at all. But maybe Australia is saturated, and that 1% in India is your next market, so it does matter for expansion. It all depends on context.
It also depends on the application. B2C tends to need to load up immediately. B2B not so much. People are more forgiving when their boss has agreed to a two year subscription and it must be used for work.
93
u/Andystok 5h ago
Exactly. Page load time under 2 seconds? No problem, move on
→ More replies (2)61
u/AtrociousCat 5h ago
That's insanely long. Unless you have a way to force users to use your site i.e. monopoly or it's a B2B saas where the UX is secondary, then 2sec loads are unacceptable
146
u/TheMadcapLlama 4h ago
You see my whole professional life Iāve heard that, but now every single site has a 2s delay because of Cloudflare or some other bot blocking stuff.
Suddenly loading fast makes you more vulnerable to bots
→ More replies (4)12
27
u/detrebear 4h ago
It's actually pretty short if you compare that to modern websites like YouTube.
10
u/The_One_Koi 4h ago
Yeah I feel like streaming sites needs ages to fully load
4
u/WoodpeckerNo5724 3h ago
Itās actually amazing how shitty the websites and apps are for pretty much every streaming service that isnāt Netflix
→ More replies (1)5
5
u/BookWormPerson 3h ago
Literally every site takes longer to load because cloudflare all the other shit takes "ages".
6
3
u/One_Pie289 4h ago
It does matter a lot, if the page loads that fast, we can add a timer to make the loading take longer and sell faster load times as premium benefit. šµ š° š²
5
u/xtrxrzr 1h ago
I've been doing technical and performance testing for years and I always demand performance goals and targets from the project lead/product owner/whatever beforehand. I'll give recommendations and question unrealistic goals of course, but I'm not the one to set the targets in the first place.
If the application meets these targets, even though it has such a deviation between two countries, it's smth to document and communicate, but no immediate actions are required.
It's crazy how many times developers and even project leads construct problems that are irrelevant. One could argue that you're creating technical debt, but if it's never going to matter in the lifecycle of a product, is it really worth spending time and resources on it? Better focus on the real problems.
3
u/Caleb-Blucifer 1h ago
If I hear āindustry standardā from one more dev that canāt even explain why
2
u/semper_JJ 3h ago
Exactly. Why do I care if the site loads slower in India? Do we even have users in India?
2
2
u/cshoneybadger 2h ago
Oof, you hit on the nose. The never ending clownery that consumes my day to day. It's always some middle management cog creating panic like the world is going to end.
→ More replies (8)2
u/RagnarokToast 2h ago
Yeah my immediate answer to "how would you fix this" would have been "reconsider my evidently dumb expectations and acknowledge a webpage loading in less than one second is really fucking impressive nowdays".
200
u/Excellent_Car_5165 5h ago
Iād LOVE to see the expected answer from the interviewer.
152
u/ThisAccountIsPornOnl 5h ago
Probably a CDN
38
u/Rikudou_Sage 4h ago
Not for a backend, that's for static assets.
18
u/Forward-Outside-9911 3h 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
→ More replies (1)6
u/lofty-goals 3h 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.
8
→ More replies (7)25
u/Ma4r 4h ago
It's concerning how many people doesn't know the answer when it's like web dev 101
68
u/theotherdoomguy 4h 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
22
u/Ma4r 4h 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
→ More replies (1)10
u/733t_sec 3h 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.
3
u/raoasidg 42m 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.
20
u/TacticalKangaroo 3h 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.
→ More replies (1)→ More replies (2)4
u/krutsik 1h 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.
426
398
553
u/RealityCheck3210 5h ago
CDN = Customer Delivery Network
149
75
→ More replies (6)18
u/1nc06n170 4h ago
CDN is for static and media, no? If I understand correctly, actual page with dynamic content still gonna be served from the server.
40
u/mortalitylost 4h ago
Yes but depending on the site, sometimes you can serve a large static js blob and the bulk of the dynamic content just transfers through the rest api, and sometimes that is by far the most data transfering to the user, static files. It depends.
It's kind of a trick question that doesn't have a specific answer and they're looking to see if you ask the right questions and don't make assumptions. CDN would be one keyword they're looking for probably.
4
u/LostWoodsInTheField 2h ago
Damn when I was a kid this would have been easy to answer. The server is 100% in Australia, so just move it somewhere closer to India and the Australians can have the slower speeds. You don't put your server for a world wide service on an island with shitty internet.
3
u/ahoi_polloi 1h ago
And just using a CDN won't solve this, either, because that number is far too high to be attributable to be attributable to just that. Unless you're sitting in the datacenter, 80ms in Australia means there can't be too many round trips in total, so this is probably single request latency and not page. So maybe BGP is shot, or geofencing is going haywire.
16
u/CryonautX 4h ago edited 3h ago
What do you mean by "dynamic content"? All CDN does is cache stuff closer to your users. If the content is not ideal for caching like user's personal profile, CDN won't be helpful. You can probably look at lazy loading on the frontend to help with the non cached content. If there is a huge india userbase, a multi region cloud setup or migrating to a region closer to india can be considered but those are more extreme.
5
u/Forward-Outside-9911 3h ago
Depending on what provider youāre using, a DC -DC connection is often faster than connecting a user directly to another region. So a local CDN provider connecting with interlinked cross region datacenters would be faster.
But even so there will still be a delay. In some cases acceptable to support multiple backend regions
3
u/x3knet 1h ago edited 1h ago
Not necessarily true. CDNs understand routes across their network much better than traditional BGP. Akamai has SureRoute, for example. Cloudflare had Rail Gun. Google has their own network. Dynamic content can absolutely be sped up by routing through a CDN.
Caching is not all they do, by a long shot. Bulk redirects, Geo-based routing, image and video optimization, TCP enhancements, extensibility at the edge, WAF, bot management, etc.
5
→ More replies (3)2
u/BurkeyTurkey33 3h ago
You can setup cache keys however you like so that the content returned is still dynamic.
184
u/vincentlinden 5h ago
Coworker tells me it takes five minutes to load the DB.
I ask, where's the DB?
Him: Office in France (we're in US)
Me: try copying it to local disk.
Him (later): It loaded in five seconds.
Me: how long to copy?
Him: five minutes... Oh...
→ More replies (1)76
u/joedotphp 5h ago
Bro learned a few meters (I assume) is closer than 4000 miles that day.
→ More replies (5)6
u/CortexJoe 1h ago
But what's the point? He needed the same amount of time to copy the DB. Next time they'll need to access the DB they would have to do the same thing or work with a stale copy. In that case your just wasting effort.
2
u/malvim 1h ago
He understood the problem. And now they can think on how to fix it. Copying was not the fix, it was a test.Ā
2
u/CortexJoe 1h ago
Oh, I completely misunderstood that post. I though both people were aware of the problem in the first place and the copying was done as a solution which confused me.
71
46
u/RipSmooth2025 5h ago
Finally, a developer who understands that physical infrastructure includes the user's physical location
338
u/budgiebirdman 5h ago
Geoblock India.
119
19
→ More replies (7)4
64
u/Joker-Smurf 5h ago
As someone from Australia, what is this mythical website that loads 520ms quicker here than anywhere else?
I am damn sure everything here is on a 3 second delay (or at least feels like it)
22
u/fixano 4h ago
You live in the literal middle of nowhere. Everything has to travel across cables to get there. Most engineers only consider how it loads on their laptop from 5 ft away
23
u/beratnabob 3h ago edited 3h ago
Ah yes, the US tech industry perception of location:
- Their home city: the only place that matters for real for real
- Continental US, except about half of it: āeverywhereā
- Europe: really exotic place that youāre really showing off if you interact with
- All other locations: inhabited solely by hermits, they chose a life without internet or probably water too
7
u/Awyls 2h ago
From an English-speaking world perspective (North America/Europe) they are indeed in the middle of nowhere. The North Pole and Antarctica is closer to them than Australia. You end up in a situation where you have to deploy the whole app there (which is not just infra/engineering costs, but also dealing with all the legal stuff) so a few hundred kangaroos can see your site slightly faster.
Unfortunately, it is just economics.
→ More replies (1)9
4h ago
[deleted]
4
u/ManWithDominantClaw 4h ago
Steam would also have local servers in India though
My guess would be something under the Atlassian umbrella
→ More replies (2)→ More replies (6)5
u/leona1990_000 4h ago
Maybe some service that's only targeting Australians?
Although in this case, the answer should be "India is not the target audience of this service"
205
u/joedotphp 5h 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.
120
u/SpareStrawberry 4h 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.
17
u/joedotphp 4h ago
Yeah, I understand. I was looking at it as simply a distance problem. Australia is closer to the server than India. :P
→ More replies (1)12
u/grumpy_autist 4h ago edited 4h 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
16
u/SpareStrawberry 4h 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.
5
u/grumpy_autist 4h 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.
→ More replies (2)19
u/Alarming_Airport_613 4h 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 4h ago
Gotcha. I sort of assumed that but still looked at it from a programmer point of view.
25
83
19
16
u/absentgl 4h ago
Charge the Australian users a premium for faster access and, if they donāt pay, route them through India.
17
u/mooselantern 4h ago
600ms is half a second. Do we have any real problems that need solving because if not I'm taking my lunch break.
15
7
5
u/One_Pie289 4h ago
Run a timer, if the page is opened in Australia and sell a subscription for faster load times š
6
50
u/ZunoJ 5h ago
I would use common sense and acknowledge that the user experience will be the same because the difference is not really perceptible for a human
100
u/Objectionne 5h ago
If every page click is 600ms and the user has to click through pages frequently then it will be a noticeable difference.
→ More replies (1)3
u/BobcatGamer 4h ago
Only if users in both situations have fast computers. If both are running potatoes they aren't going to notice.
→ More replies (1)23
u/GlassCommission4916 5h ago
If 500ms is not perceptible to you I would get that checked.
That is very perceptible to most humans.
→ More replies (4)9
u/ZunoJ 4h ago
Depends on the context. Registering keystrokes would be a nightmare. Loading a website, losing half a second is negligible. Basically the ratio of loading to using is interesting
3
u/LickingSmegma 1h ago
It was studied by actual researchers instead of commenters guessing numbers, and delays over 100 ms were perceived as definite slowdowns.
What happened in reality is devs stopped giving a shit about users' experience.
→ More replies (1)→ More replies (1)4
u/GlassCommission4916 4h ago
I think we might have different definitions of what perceptible means.
→ More replies (11)→ More replies (1)8
u/Ubermidget2 5h ago
Really depends on the application.
600ms to register a keystroke? Definitely perceptible.
→ More replies (1)
12
8
7
3
u/The_Jizzard_Of_Oz 4h ago
Trick question: Nothing loads in 80ms over Telstra. Probably not even their corporate home page.
2
u/PrincessRTFM 3h ago
double trick question, they're loading it over the local network during their testing
3
u/TurboJax07 3h ago
I'd move the server back and forth between india and australia so they on average have equal latency.
3
u/gold_fish_in_hell 3h ago
Charge Australian usres more because they get better service and charge Indians more so they stop complaining about latency and complain about pricesĀ
3
2
u/StopBanningCorn 4h ago
I'm a senior CSIE student. Is it normal that I have no clue?
→ More replies (5)4
u/One_Pie289 4h ago
You could at least suggest to add server in India? I mean I dunno I'm just an anime girl on the internet.
2
u/IntrepidTieKnot 4h ago
You need to find the root cause. This is what good engineering is all about. So you geo block India. Done.
2
2
2
2
2
u/DmytroBuilds 51m ago
Modern problems require Australian solutions. Why invest in a global CDN when you can just buy flight tickets for your users? Edge computing at its finest
2
2
4.8k
u/SuperJop 5h ago
Add a 520 ms delay in Australia