System Design Interview in 30 Days | Day 2
How apps talk to your server, and where the data lives
Your app sends "make me a short link". The network is slow, it retries, and now you have two links for one click.
Today: the API and the table behind it. A thread 🧵
#SystemDesign #SystemDesignInterview #InterviewPrep #SoftwareEngineering #DistributedSystems #BackendDevelopment #TechInterview
So if you build agents, save only what the agent cannot see again, keep the always-loaded part small, give every page one writer, and check notes against the logs.
Anthropic's full post: https://t.co/3zoRKwPjEY
One Claude model saved 413 memory files and won 1 Pokémon badge. A newer one saved 10 files and won 4.
Anthropic just published what they learned about agent memory. The short version: write down less, and check what you wrote. A thread:
Dreaming can also build a wiki of linked pages.
On 25 questions about 350,000 files: search alone 53%, search plus the wiki 61%, and about 20,000 fewer tokens per question.
When many agents wrote one shared page, 41 of 57 facts survived. One writer per page kept all 57.
How did Mata Sita know the messenger was really Lord Hanuman?
How Mata Sita Knew Lord Hanuman Was Real: he showed her Lord Rama's ring, and she sent back her chudamani. Both sides proved who they were.
In software that is mutual authentication. Between servers, mutual TLS.
Who delivers your Diwali wish to everyone in the family group?
How WhatsApp Sends Your Diwali Wish: your phone sends it once, locked with a key only the group has. The server cannot read it. It makes a copy per person and keeps Dadi's until her phone is on.
That is fan-out.
Rerank 20 and send the best 4: $0.46 per 1,000. A semantic cache at 35% hits: $0.43. Both: $0.30.
Day 15: a cache at similarity 0.90 answers "cancel my order?" with the stored answer to "cancel my subscription?". How do you catch it?
AI Engineering in 30 Days, Day 14.
Same model, same question, 3x the cost once you add search. Why?
The retrieved chunks. 3,000 tokens of them go into every prompt and are billed as input. With the lesson's prices, 1,000 answers go from $0.22 to $0.67.
One RAG answer: 67% retrieved chunks, 27% the answer, 5% instructions and question, about 0.1% embedding the question.
Token count is the lever, not price per token. A lesson in our AI Engineering course ($35, or ₹1,333 in India):
https://t.co/zzVrjOZHcl
@Abhijit_091 For the URL shortener, interviewers push on the ID. 7 base62 chars give about 3.5 trillion codes, but a hash still needs a collision check. A counter per shard has no collisions but makes links guessable. Pick by whether links must stay private.
@SparkTsaiX@miniii_codes Agree. The habit that pays off most for me: before changing anything, write down what you expect the logs or metrics to show if your hypothesis is right. Half the time the data says no and you just saved an hour.
@suhaanxsyed@itskavvya Same pattern here. The startup rounds that feel like system design usually test two things DSA rounds never do: can you size the problem with rough numbers first, and can you name what breaks when one box dies.
Real systems: hybrid logical clocks (CockroachDB), TrueTime with commit wait (Spanner), or one place that hands out the order.
Day 16: two writes on two replicas during a network split carry Lamport 7 and 9. Last write wins keeps 9. What was lost?
System Design Interview in 30 Days, Day 15.
Server A logs "order paid" at .100. Server B logs "order created" at .130. Same order.
B's clock ran 50 ms fast. The order really came first. Both logs are honest, and sorted by timestamp the story runs backwards.
The fix: count events, do not read the clock. A Lamport clock adds 1 before each event, sends its counter with every message, and on arrival takes the larger plus 1. Order 12, payment 15.
Both our courses, ₹1,999 in India or $49 elsewhere:
https://t.co/yWsTgcCYwR
@almokhtar_al Check the parsed arguments, not just the command name. "git" on an allowlist still runs anything through git -c core.sshCommand=..., so run with an argv array, no shell, and an allowlist of flags as well as binaries.
@thatjeffsmith Keeping the vectors next to the data is the right call. The part I would add is the database user behind the MCP connection: give the agent a read-only user with a row limit, because the tool runs every query with whatever rights that login has.
@DanKornas One channel detail that bites people: WhatsApp only lets a business send free-form replies for 24 hours after the user's last message. After that you need a pre-approved template, so the agent has to know which window each conversation is in.