Bits By Picasso
@bitsbypicasso
Followers
0
Following
34
Media
5
Statuses
66
Pixelated bits. One line of code at a time.
Joined April 2024
Under normal conditions, you can have all three. But when the network fails (and it will at some point), you must choose either CP or AP.
0
0
0
More examples CP: Banking systems - better to reject a request than risk double-spending. AP: Shopping carts - better to accept a temporary view than block the user.
1
0
0
Partition Tolerance The system keeps working even if network links break (a must in real systems). You must sacrifice either C or A during a partition. CA (Consistency + Availability) assumes no partitions = unrealistic E.g of CA: A single-node SQL DB (not distributed)
1
0
0
Availability: Every request gets a response, but it might be stale during failure. E.g (AP system): DynamoDB, Cassandra. Prioritizes uptime & user experience over immediate consistency. Great for things like shopping carts or newsfeeds. #SystemDesign #DistributedSystems
1
0
0
Consistency: Every read gets the latest write. All nodes see the same data. E.g (CP system): MongoDB with replica sets. May reject requests if data can't be replicated. Used where correctness > uptime, like banking. #CAPTheorem #SystemDesign
1
0
0
CAP Theorem? States that in any distributed system, during a network partition (P), you must choose between: - Consistency (C) - Availability (A) - Partition Tolerance (P) Since network partitions are inevitable, we must choose between CP or AP systems. #SystemDesign
1
0
0
Rule #4 from So Good They Can’t Ignore You: Don’t wait for a grand plan. Make methodical, intentional Small Bets, learn from each, and watch outcomes grow. Big impact starts with tiny experiments. #LittleBets #ThinkSmallActBig
0
0
0
Use two pointers: •slow moves 1 step 🐢 •fast moves 2 steps 🐇 If there’s a cycle, they will meet inside it. No cycle? fast hits null.
1
0
0
🐢🐇 Floyd’s Cycle Detection Ever needed to detect a loop in a linked list? Floyd’s Algorithm (aka the "Tortoise and Hare") does it with O(1) space. It’s elegant, fast, and interview gold. Here’s how it works 👇 #coding #Algorithms
1
0
0
Here’s the code to do it: Note: The loop might run indefinitely in theory (but unlikely in practice)! #DataScience #JavaScript #CodingTips
0
0
0
Imagine you have rand10() that generates random numbers from 1 to 10. Now, you need to convert it into rand6(). 🔀 Rejection sampling ensures each number in 1–6 has an equal chance (1/6). Any bias in how numbers repeat is unfair and breaks uniformity. #Randomness #Programming
1
0
0
What’s Rejection Sampling? 🤔 It’s a neat trick to generate fair random values from an unfair source. 🎲 We start with a simple random function, then selectively keep values that match our target distribution. Let’s break it down. #DataScience #Statistics #Math
1
0
0
These 5 steps have really shifted my perspective. Building valuable skills takes time, clarity, and consistent effort. Still working on applying them. #SoGoodTheyCantIgnoreYou #LearningInPublic
0
0
0
Step 5: Be patient. Building career capital takes time. No shortcuts—just focus and consistency. #SoGoodTheyCantIgnoreYou #LongGame
1
0
0
Step 4: Deliberate practice means doing the hard stuff. It’s uncomfortable, but growth happens when you push your limits. #SoGoodTheyCantIgnoreYou #CraftsmanMindset
1
0
0
Step 3: Define what “good” actually means. Not just “I want to improve,” but how? Clear goals turn effort into progress. #SoGoodTheyCantIgnoreYou #DeliberatePractice
1
0
0
Step 2: Identify the career capital that matters in your market. It’s not about being good at everything—it’s about getting good at the right thing. Still figuring out mine. #SoGoodTheyCantIgnoreYou #CareerCapital
1
0
0
Step 1: Figure out what kind of career market you’re in. - Winner-takes-all: one dominant skill - Auction: many ways to win Knowing this changes how you think about growth. #SoGoodTheyCantIgnoreYou
1
0
0
Reflection: building real career capital—skills that set you apart. So Good They Can’t Ignore You by Cal Newport lays out 5 steps for this. Sharing what I’m learning in the next few posts. #SoGoodTheyCantIgnoreYou
1
0
0