I
I.K
Guest
Day 5: System Design + DSA Journey
Hello, I'm continuing my journey of daily learning, focusing on System Design concepts (via the roadmap.sh System Design Roadmap) and then tackling DSA challenges on LeetCode. This is DAY 5!
π System Design: Consistency Patterns
Todayβs System Design concept explores Consistency Patterns β the different ways distributed systems manage and present data. The core challenge here is balancing correctness, performance, and availability.
The three main consistency models are:
- Strong Consistency
- Weak Consistency
- Eventual Consistency
Strong Consistency
After an update, any subsequent read immediately reflects the change.
- Data is replicated synchronously, ensuring every replica always has the latest value.
- Guarantees correctness, but at the cost of availability and often higher latency.

When money moves from one account to another, all balances are updated everywhere instantly to prevent discrepancies. Accuracy is critical, even if responses are slower.
Weak Consistency
After an update, subsequent reads may or may not reflect the latest value.
- Updates may not propagate immediately.
- Provides high availability and low latency, but risks temporary inconsistencies.

Player actions are visible instantly within the same data center, but lag or temporary connection drops can cause other players to see delayed or missing actions.
Eventual Consistency
A form of weak consistency β all updates will eventually propagate to all replicas.
- Replication is asynchronous.
- Prioritizes availability and speed but allows temporary inconsistencies.

When a user posts an update, it may appear instantly to nearby users but take time to reach users in other regions. Some see it immediately, others later β but eventually, everyone converges to the same state.
My Thoughts
Consistency patterns made me reflect on the trade-offs engineers face daily. Strong consistency feels safe but slows things down; eventual consistency feels fast and scalable but risks temporary βweirdness.β
The art of system design lies in choosing the right consistency model for the right use case β banking apps need precision, but social apps need speed.
DSA Challenge: Integer to Roman
Todayβs LeetCode problem was 12. Integer to Roman.

This was a great exercise in mapping + greedy iteration.
Understanding the Problem
Convert an integer (1 β€ num β€ 3999) into its Roman numeral representation.
Roman numerals are based on fixed symbol-value pairs:
- I (1), V (5), X (10), L (50), C (100), D (500), M (1000)
- Special cases: IV (4), IX (9), XL (40), XC (90), CD (400), CM (900)
My Approach: Dictionary + Loop
- Built a lookup dictionary for symbol-value pairs.
- Iterated over values in descending order.
- Subtracted and appended symbols until the number was reduced.
Code Snippet
Code:
class Solution:
def intToRoman(self, num: int) -> str:
# Mapping integer values to Roman numerals
num_map = {
1: "I", 4: "IV", 5: "V", 9: "IX",
10: "X", 40: "XL", 50: "L", 90: "XC",
100: "C", 400: "CD", 500: "D", 900: "CM",
1000: "M"
}
result = ''
for n in [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]:
while num >= n:
result += num_map[n]
num -= n
return result
Key Takeaways
- Greedy approach works beautifully: always take the largest possible Roman numeral first.
- Using a dictionary for mapping keeps the logic clean.
- Avoided over-complicating with list comprehensions β simple loops made it easier to debug.
Final Thoughts
Day 5 was all about patterns β both in System Design (consistency patterns) and DSA (pattern-driven mapping with Roman numerals).
- On the System Design side β I learned how different consistency guarantees directly impact user experience and system reliability.
- On the DSA side β I reinforced the power of lookup tables + greedy iteration.
Five days in, I can feel the compounding effect of showing up daily. Each small lesson stacks into a bigger picture of becoming a stronger engineer

Letβs Connect!

If youβve been following along, Iβd love to hear from you:
- What consistency model have you worked with in distributed systems?
- Do you have a favorite trick for greedy algorithms like this one?
- Or just drop a
if youβd like me to keep sharing these daily learnings!
Your engagement (comments, shares, or reactions) means the world


Continue reading...