math behind linux file permissions
each digit is just read + write + execute added up:
- read = 4
- write = 2
- execute = 1
three digits, in this order: owner, group, everyone else.
so you add up what each one is allowed to do:
7 = 4+2+1 = read, write, execute
6 = 4+2 = read, write
5 = 4+1 = read, execute
4 = just read
0 = nothing
common ones:
- 777 = everyone can do everything (almost never what you want)
- 755 = owner does everything, everyone else can read and run it (scripts, folders)
- 644 = owner reads and writes, everyone else just reads (normal files)
- 600 = only the owner touches it (keys, secrets)
quick way to read any number: break it into 3 digits, then split each digit back into 4/2/1.
644 means owner = 4+2 (read write), group = 4 (read), others = 4 (read).
that's the whole system.
While working with caches, always implement cache stampede protection.
The moment a hot cache key expires, you donโt want 10,000 users hitting your database at the same time.
Let a single request rebuild the cache through a distributed lock while every other request waits briefly or gets stale data.
Add TTL jitter too, so your hot keys donโt all expire at once.
Alex Xu's System Design Interview is the most recommended book in tech hiring.
Volume 1: $39.99 on Amazon.
Volume 2: $40.00 on Amazon.
Both together: $79.99.
Thousands of engineers have bought them. Millions have been told to buy them. Every tech interview prep list on the internet includes these two books.
In December 2024, one engineer at AWS read both volumes cover to cover.
His name is Gaurav Kumar. CS grad from USC. Day job at Amazon Web Services. He goes by liquidslr on GitHub.
He took notes on every single chapter. Organized them by topic. Linked every section to the original research papers from Amazon, Google, and Discord. Then he pushed the whole thing to GitHub for free.
Then he built a free website to read them on. He named it Pagefy.
Every chapter. Every diagram concept. Every system. Free. Forever.
Here is what is inside:
โ Chapter 1: Scale From Zero To Millions Of Users
โ Chapter 2: Back-of-the-Envelope Estimation
โ Chapter 3: A Framework For System Design Interviews
โ Chapter 4: Design A Rate Limiter
โ Chapter 5: Design Consistent Hashing
โ Chapter 6: Design A Key-Value Store
โ Chapter 7: Design A Unique ID Generator In Distributed Systems
โ Chapter 8: Design A URL Shortener
โ Chapter 9: Design A Web Crawler
โ Chapter 10: Design A Notification System
โ Chapter 11: Design A News Feed System
โ Chapter 12: Design A Chat System
โ Chapter 13: Design A Search Autocomplete System
โ Chapter 14: Design YouTube
โ Chapter 15: Design Google Drive
โ Chapter 16: Proximity Service
And that is Volume 1.
Volume 2 continues:
โ Nearby Friends
โ Google Maps
โ Distributed Message Queue
โ Metrics Monitoring and Alerting System
โ Ad Click Event Aggregation
โ Hotel Reservation System
โ Distributed Email Service
โ S3-like Object Storage
โ Real-Time Gaming Leaderboard
โ Payment System
โ Digital Wallet
โ Stock Exchange
Here is why this matters:
Every FAANG company asks system design questions. Google. Amazon. Meta. Microsoft. Apple. Netflix. Uber. Airbnb. Stripe.
The median software engineer at these companies makes $226,000. Senior makes $312,000. Staff makes $457,000.
The interview that stands between you and that salary is system design.
The book that everyone says to read costs $79.99. The official video course on ByteByteGo costs $499 for lifetime or $189 a year. Hello Interview charges $279 lifetime. Educative charges $59 a month.
These notes cover the same 28 chapters as the books. For $0.
Not a summary. Not a cheatsheet. Structured notes with diagrams, key concepts, and source papers for every chapter of both volumes. Browse them as a website at https://t.co/dJGyoX8MBH. Search any topic. Jump to any chapter at 1 AM the night before the interview.
5,555 stars. 1,059 forks. One AWS engineer on his own time.
One honest flag: there is no LICENSE file on the repo. These are study notes summarizing a copyrighted book. If you can afford $79.99, buy the books. Alex Xu deserves the royalty. These notes are for the night before, when you already read the book and forgot half of it.
One engineer. Two books. Twenty eight chapters. Free on GitHub.
The book teaches you the answers. This repo helps you remember them.
SOLID Principles Explained with Clear Examples:
๐ - ๐๐ข๐ง๐ ๐ฅ๐ ๐๐๐ฌ๐ฉ๐จ๐ง๐ฌ๐ข๐๐ข๐ฅ๐ข๐ญ๐ฒ ๐๐ซ๐ข๐ง๐๐ข๐ฉ๐ฅ๐
A class should have only one reason to change.
- Example: Instead of one giant User class that handles authentication, profile updates, and sending emails, split it into UserAuth, UserProfile, and EmailService.
๐ - ๐๐ฉ๐๐ง/๐๐ฅ๐จ๐ฌ๐๐ ๐๐ซ๐ข๐ง๐๐ข๐ฉ๐ฅ๐
Classes should be open for extension but closed for modification.
- Example: Define a Shape interface with an area() method. When you need a new shape, just add a Circle or Triangle class that implements it.
๐ - ๐๐ข๐ฌ๐ค๐จ๐ฏ ๐๐ฎ๐๐ฌ๐ญ๐ข๐ญ๐ฎ๐ญ๐ข๐จ๐ง ๐๐ซ๐ข๐ง๐๐ข๐ฉ๐ฅ๐
Subtypes must be substitutable for their base types without breaking behavior.
- Example: If Bird has a fly() method, then Eagle and Sparrow should both work anywhere a Bird is expected.
๐ - ๐๐ง๐ญ๐๐ซ๐๐๐๐ ๐๐๐ ๐ซ๐๐ ๐๐ญ๐ข๐จ๐ง ๐๐ซ๐ข๐ง๐๐ข๐ฉ๐ฅ๐
Don't force classes to implement interfaces they don't use.
- Example: Instead of one fat Machine interface with print(), scan(), and fax(), break it into Printable, Scannable, and Faxable. A SimplePrinter only implements Printable.
๐ - ๐๐๐ฉ๐๐ง๐๐๐ง๐๐ฒ ๐๐ง๐ฏ๐๐ซ๐ฌ๐ข๐จ๐ง ๐๐ซ๐ข๐ง๐๐ข๐ฉ๐ฅ๐
High-level modules should not depend on low-level modules. Both should depend on abstractions.
- Example: Your OrderService should depend on a PaymentGateway interface, not directly on Stripe or PayPal.
The real power of SOLID is not in following each principle in isolation. It's in how they work together to make your code easier to change, test, and extend.
โป๏ธ Repost to help others learn this
Caching is the one pattern that comes up in almost every system design interview.
Most engineers know the high-level overviewโฆ but completely fall apart when the interviewer starts drilling into the deep-dives โ cache stampede, thundering herds, stale data at scale, or smart invalidation strategies.
Letโs fix that today.
Interviewers have moved way beyond โDesign Twitterโ. They now hit you with the hard follow-ups:
โHow do you handle cache stampede at 10x traffic?โ or โWhat happens when your cache becomes inconsistent during peak load?โ
These 15 must-know Caching Strategies & Pitfalls are exactly the ones that separate clean designs from production systems that actually stay fast and reliable at scale.
I turned them into this full detailed thread with clear explanations and hands-on ways to master each one.
Save this thread. Read till the end.
Your next interview and your on-call shifts will thank you.
Also checkout - https://t.co/Ots2nRhO5f
I have 12+ years of experience in backend engineering and now work as a Principal Engineer.
One thing Iโve noticed is this: A lot of engineers want to become โbackend architectsโ because the title sounds cool.
But very few actually understand what that role requires.
It is not just:
- knowing Kafka
- drawing boxes in interviews
- saying โletโs use microservicesโ
- or memorizing CAP theorem
If you want to become one, here are 10 areas you need to learn well:
๐น Java 17 Sealed Classes โ Interview Perspective (3 mins)
๐งต ๐งต
Iโve shared a quick discussion on Sealed Classes & Interfaces in Java 17, explained through a practical scenario.
The example covers a Payment Gateway API response model, where sealed classes help:
โข Restrict permitted response types
โข Enforce fixed response structures as per service
agreements
โข Prevent unintended extensions
โข Improve domain modeling clarity
This is a real-world interview-style question focused on modern Java design decisions, not just syntax.
#Java17 #SealedClasses #JavaInterview #BackendDevelopment #SoftwareDesign #BitBee
Your Spring Boot app is using 2GB of memory. It was 512MB last week.
No errors. App still responds. Just slower every day.
Then one morning: OutOfMemoryError. App is dead. You restart it. Next week, same thing.
That's a memory leak. And restarting is not a fix.
Something in your code is holding references to objects that should have been garbage collected. Heap keeps growing. GC runs but can't free anything. Eventually no space left.
Common culprits in Spring Boot:
โ JPA Stream<Entity> not closed โ EntityManager holds every entity in memory. 100K rows loaded, none released.
โ ThreadLocal not cleared after request โ filter stores user context, request ends, ThreadLocal stays. Memory piles up with every request.
โ ConcurrentHashMap as cache without eviction โ data goes in, nothing comes out. No TTL. No max size. Grows until heap explodes.
โ Static List or Map that only grows โ .add() on every request, never .clear(). Classic leak.
How to find it:
โ Monitor /actuator/metrics/jvm.memory.used โ if heap grows and never drops after GC, you have a leak
โ Take heap dump before the crash: jmap -dump:format=b,file=heap.hprof <pid>
โ Open in Eclipse MAT โ run Leak Suspects Report โ it tells you exactly which object is eating memory
Memory leaks don't crash your app on day one. They crash it on the day your biggest client is using it.
#memoryleaks
I have 12 years of experience and working as a Principal Engineer @Atlassian and I have seen concurrency scaring the hell out of a lot of junior engineers.
Itโs one of the most feared topics in system design & backend interviews โ race conditions, deadlocks, thread poolsโฆ you name it.
But once you internalize these 20 must-know concepts, everything clicks.
Save this thread. Read till the end.
Your future interviews and production systems will thank you.
A billionaire walked into a five-star hotel and asked for the cheapest room they had.
The receptionist blinked, confused.
โSir, our presidential suite has a full city viewโฆโ
Before you spend $2,000 on an AI course, read this.
A lot of people are buying expensive AI courses right now.
But honestly, most of them donโt need to.
Some of the best AI learning resources in the world are already free. And theyโre not built by self-proclaimed AI experts online.Theyโre created by the companies actually building the models, chips, tools, and infrastructure behind this entire AI wave.
If you want to learn AI properly, it makes sense to learn directly from the source.
But before that, Check out 100+ such resources shared in this community of 200K+ AI/ML Engineers: https://t.co/1551GLLSyi
Here's a list of 10 free AI learning platforms from industry leaders:
๐ญ - ๐๐ป๐๐ต๐ฟ๐ผ๐ฝ๐ถ๐ฐ:
https://t.co/i11SbYMwsc
๐ฎ - ๐๐ผ๐ผ๐ด๐น๐ฒ:
https://t.co/AP7UJIWCZS
๐ฏ - ๐ ๐ฒ๐๐ฎ:
https://t.co/Szgt9UZwEG
๐ฐ - ๐ก๐ฉ๐๐๐๐:
https://t.co/jhKE77g8qA (GOATed)
๐ฑ - ๐ ๐ถ๐ฐ๐ฟ๐ผ๐๐ผ๐ณ๐:
https://t.co/7oyuGNBso1
๐ฒ - ๐ข๐ฝ๐ฒ๐ป๐๐:
https://t.co/SB5qSuOJND
๐ณ - ๐๐๐ :
https://t.co/bivomoOsgU
๐ด - ๐๐ช๐ฆ:
https://t.co/4XySMsxNbR
๐ต - ๐๐ฒ๐ฒ๐ฝ๐๐ฒ๐ฎ๐ฟ๐ป๐ถ๐ป๐ด๐๐:
https://t.co/wW9udDmT29
๐ญ๐ฌ - ๐๐๐ด๐ด๐ถ๐ป๐ด ๐๐ฎ๐ฐ๐ฒ:
https://t.co/9llzeMmuAo
If youโre serious about learning AI, the biggest difference usually comes from consistency, not another course.
Honestly, if you want to secure a backend role in a fintech company that deals heavily with transactions, these are the things you must understand.
If the company actually knows what theyโre doing, their questions will revolve around things like:
Idempotency โ preventing duplicate transactions
Concurrency control โ handling multiple requests safely
Database transactions (ACID)
Distributed systems basics
A lot of people underestimate this side of backend.
But thatโs just the surfaceโฆ
Bookmark and retweet so people can learn from this too