The Happy Path

224 posts

The Happy Path banner
The Happy Path

The Happy Path

@The_HappyPath

Quick software engineering explainers for things you should've googled by now

Entrou em Aralık 2025
125 Seguindo440 Seguidores
Tweet fixado
The Happy Path
The Happy Path@The_HappyPath·
Every web request passes through invisible infrastructure before it reaches a server. Reverse proxies, load balancers, API gateways, session management: all sitting in between. Here's the full series breaking down that middle layer, one concept at a time. 🧵
English
1
1
3
393
The Happy Path
The Happy Path@The_HappyPath·
@javarevisited Because they make reads significantly faster, and for the right access patterns that tradeoff is worth it. If a column gets read far more than it gets written, paying a small write cost for much faster lookups pays off. It’s a case by case call.
English
0
0
0
48
Javarevisited
Javarevisited@javarevisited·
As a developer, Have you ever thought: Why do databases use indexes even though they slow down writes?
English
12
0
9
2.4K
Captain-EO 👨🏾‍💻
Three statements. One is false 1. An index speeds up both reads and writes equally 2. A composite index on (A, B) can serve queries on column A alone 3. Too many indexes can slow down INSERT and UPDATE operations Which one is the lie?
English
12
1
28
8K
The Happy Path
The Happy Path@The_HappyPath·
Most replies will point at readiness probes, and that solves the "pod not ready yet" case. But 404s can also show up when v1 and v2 simply disagree. A session that hits v1 then v2 will break if routes, payloads, or DB schema changed between them. The usual fix: ship the code behind a flag, wait until every pod is on v2, then flip it on. Readiness probes handle "is the pod up". Backward compatibility handles "can v1 and v2 coexist".
English
0
0
0
124
Abhishek Singh
Abhishek Singh@0xlelouch_·
You deploy new version of your app to Kubernetes. Half the traffic gets 404 errors for 30 seconds during rollout. How will you achieve zero-downtime deployment? Topic: Zero-Downtime Deployment
English
8
1
27
3.5K
Sudhanshu
Sudhanshu@yadavji_codes·
Interviewer: You are logging into a website using OTP which is valid only for 40 seconds. No one stored it anywhere ! Now how does the server verify it without ever saving it ?
Sudhanshu tweet media
English
23
3
40
732
The Happy Path
The Happy Path@The_HappyPath·
@javarevisited Because vertical scaling is much simpler to implement. Going horizontal means running a distributed system, which brings things like sharding, cascading failures, and way more operational overhead.
English
0
0
4
321
Javarevisited
Javarevisited@javarevisited·
Interviewer: If horizontal scaling is better, why do some systems still scale vertically?
English
7
0
13
4.8K
The Happy Path
The Happy Path@The_HappyPath·
@javarevisited The Short Answer: UNION removes duplicate records whereas UNION ALL includes all duplicates
The Happy Path tweet media
English
0
0
3
309
Javarevisited
Javarevisited@javarevisited·
Interviewer: What’s the difference? UNION vs UNION ALL
English
9
0
22
5.1K
Suni
Suni@suni_code·
Interviewer: A 10GB file is compressed to 3GB. No data is removed. No Quality lost then What is actually being removed?
Suni tweet media
English
29
4
103
19.4K
The Happy Path
The Happy Path@The_HappyPath·
Not sure if a query is actually using an index? Prepend EXPLAIN to any SELECT and the database will show exactly how it plans to execute it, including whether it picks an index or scans every row.
The Happy Path tweet media
English
0
1
6
245
The Happy Path
The Happy Path@The_HappyPath·
@CyberRacheal No code stored means this must be Time-based OTP (TOTP), used by authenticator apps like Authy. The formula is code = f(secret_key, current_time), where secret_key is shared at onboarding. App and server independently compute the same code.
The Happy Path tweet media
English
3
24
281
26.8K
Cyber_Racheal
Cyber_Racheal@CyberRacheal·
Interviewer: An OTP is valid for 60 seconds, but the server never stores it. How does it verify a code it doesn’t even 'know'?🤔
Cyber_Racheal tweet media
English
61
70
625
269.4K
The Happy Path
The Happy Path@The_HappyPath·
@javarevisited COUNT(*) collapses the whole table into a single row. But name could have a different value on every row, so the database has no way to decide which name belongs with that one count. A possible fix: SELECT name, COUNT(*) FROM users GROUP BY name
English
0
1
6
1.5K
Javarevisited
Javarevisited@javarevisited·
Interviewer: Why does this fail? SELECT name, COUNT(*) FROM users;
English
6
1
35
16.1K
The Happy Path
The Happy Path@The_HappyPath·
@javarevisited A TTL cache should be enough to handle this: On each incoming click: 1. Check clickd:{user_id}:{item_id} in Redis 2. If present, it’s a duplicate within the 5-min window 3. If absent, SETEX it with a 300s expiry
The Happy Path tweet media
English
0
0
1
262
Javarevisited
Javarevisited@javarevisited·
Technical interview question: You have a stream of user clicks. You need to detect if a user clicked the same item twice within 5 minutes. System must be real-time. How would you design it?
English
6
1
25
4.3K
The Happy Path
The Happy Path@The_HappyPath·
- Server gets the OTP input by the user - Server computes the expected OTP. Not a hash but the actual code that should be sent by the user - Server compares the code sent by the user to the one it computed, and they should be equal This approach relies on the Auth app and the server being able to compute the same value for the code
English
0
0
0
18
Sunya
Sunya@snlmzero·
@The_HappyPath @suni_code Your diagram has an issue. In the last step you mentioned “if the codes match”. Which code serves matches with? Server gets the otp, recompute the hash and compares with what?
English
1
0
0
34
Suni
Suni@suni_code·
Interviewer: An OTP is valid for exactly 30-60 seconds. Even though no one stored it anywhere. how does the server verify it without ever saving it?
Suni tweet media
English
46
36
736
293.4K
The Happy Path
The Happy Path@The_HappyPath·
@cyber_rekk A. 172.16.11.254 1. Set all the host bits to 1 to find the broadcast address 2. Subtract 1 to find the last usable host IP address
The Happy Path tweet media
English
0
0
3
381
The Happy Path
The Happy Path@The_HappyPath·
@SumitM_X Returns 10 rows: rows 11 through 20. OFFSET 10 skips the first 10, then LIMIT 10 grabs the next 10
The Happy Path tweet media
English
0
0
5
234
SumitM
SumitM@SumitM_X·
What will this query return - SELECT CustomerID, Name, Email FROM Customers LIMIT 10 OFFSET 10;
English
13
2
26
5.3K
SumitM
SumitM@SumitM_X·
Tech Lead tells you to delete orderid 123 and sends this query : DELETE FROM orders WHERE order_id <> 123; Whats your next step?
English
35
2
79
24.5K
The Happy Path
The Happy Path@The_HappyPath·
Indexing one column helps. But if a query filters on two, the database might have to scan hundreds of rows for the second condition. A composite index handles both columns in a single lookup.
The Happy Path tweet media
English
0
0
1
129
The Happy Path
The Happy Path@The_HappyPath·
@cyber_razz It’s A. Each digit is really just 3 bits: one for read (4), one for write (2), one for execute (1). So 7 = 111 = rwx, 5 = 101 = r-x, 0 = 000
The Happy Path tweet media
English
0
0
15
1.4K
Abdulkadir | Cybersecurity
LINUX KNOWLEDGE CHECKPOINT What does this numeric permission represent? 750 A) rwxr-x--- B) rwxrwx--- C) rwxr----- D) rw-r-x---
English
50
7
179
31.2K
The Happy Path
The Happy Path@The_HappyPath·
@cyber_rekk The answer is B. /29. An IPv4 address is 32 bits. Subtract the prefix length to get host bits: 32 - 29 = 3, which means 2³ = 8 total addresses. Remove network and broadcast, and that leaves exactly 6 usable hosts.
The Happy Path tweet media
English
0
0
3
433
The Happy Path
The Happy Path@The_HappyPath·
Indexes make reads faster, but they aren't free. Every INSERT, UPDATE, and DELETE also has to update every index on that table.
The Happy Path tweet media
English
0
0
0
999