Musk-Trump fight gets ugly!

ALSO: Database Isolation Levels

In partnership with

Welcome back!

This weeks problem has been asked 50 times in FAANGs over the last 6 months. Let’s see what makes this problem so special.

Today we will cover:

  • Word Break

  • Database Isolation Levels

Read time: under 4 minutes

CODING CHALLENGE

Word Break

Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.

Note that the same word in the dictionary may be reused multiple times in the segmentation.

Example 1:

Input: s = "leetcode", wordDict = ["leet","code"]
Output: true
Explanation: Return true because "leetcode" can be segmented as "leet code".

Example 2:

Input: s = "catsandog", wordDict = ["cats","dog","sand","and","cat"]
Output: false

Solve the problem here before reading the solution.

PRESENTED BY THE RUNDOWN AI 

Learn AI in 5 minutes a day

What’s the secret to staying ahead of the curve in the world of AI? Information. Luckily, you can join 1,000,000+ early adopters reading The Rundown AI — the free newsletter that makes you smarter on AI with just a 5-minute read per day.

SOLUTION

To solve this problem, we'll use dynamic programming. We'll create a boolean array dp where dp[i] represents whether the substring s[0:i] can be segmented into words from the dictionary.

We start with dp[0] = true because an empty string can always be segmented. Then for each position in the string, we look backwards to see if we can make a valid word. If we find that the previous part was already valid (dp[j] = true) and the current piece s[j:i] is in our dictionary, then we mark the current position as valid too.

We keep doing this until we reach the end. The answer is whether dp[n] is true, meaning the whole string can be broken into dictionary words.

The time complexity is O(n^2 * m) where n is the length of the string and m is the length of the longest word in the dictionary.

SYSTEM DESIGN

Database Isolation Levels

When multiple users try to read and write data simultaneously in a database, things can get messy. One user might read data while another is in the middle of changing it, leading to inconsistent results. Database isolation levels help prevent these problems by controlling how transactions interact with each other.

Let's look at the main isolation levels, from least strict to most strict:

Read Uncommitted is the lowest isolation level. It allows transactions to read data that hasn't been committed yet. While this offers the best performance, it can lead to dirty reads, where you read data that might get rolled back later.

Read Committed ensures you only read data that has been committed. This prevents dirty reads but can still lead to non-repeatable reads. For example, if you read the same data twice in a transaction, you might get different results if another transaction commits changes in between.

Repeatable Read guarantees that if you read some data once, you'll get the same result if you read it again within the same transaction. But it doesn't prevent phantom reads, where new rows appear in your result set when you run the same query twice.

Snapshot Isolation is a more sophisticated approach. When a transaction starts, it sees a consistent snapshot of the database as it existed at that moment. Any changes made by other transactions after your transaction started remain invisible until your transaction ends. This prevents both non-repeatable reads and phantom reads.

Serializable is the strictest level. It makes transactions behave as if they were executed one after another, rather than concurrently. While this provides the strongest consistency guarantees, it significantly reduces performance.

Here's how the isolation levels compare:

Isolation Level

Dirty Reads

Non-repeatable Reads

Phantom Reads

Performance

Read Uncommitted

Yes

Yes

Yes

Highest

Read Committed

No

Yes

Yes

High

Repeatable Read

No

No

Yes

Medium

Snapshot

No

No

No

Medium

Serializable

No

No

No

Lowest

Most applications use Read Committed as it provides a good balance between consistency and performance. Use stricter levels only when your application specifically requires stronger guarantees.

FEATURED COURSES

5 Courses of the Week

 Google’s Crash Course on Python: This Python course teaches programming fundamentals to beginners. You'll learn Python syntax, use code editors, write simple programs, and solve complex problems through interactive exercises.

 Microsoft Azure for AI and ML: Your first course after learning Python, cover the full ML lifecycle from data prep to production deployment using Azure’s AI/ML services and workflows.

 Grokking the Modern System Design Interview: The ultimate guide to the System Design Interview – developed by Meta & Google engineers. Master distributed system fundamentals, and practice with real-world interview questions & mock interviews.

 Machine Learning A-Z: AI, Python & R + ChatGPT Prize: Comprehensive ML course covering Python & R implementation, from basic predictions to advanced topics like reinforcement learning and NLP.

 IBM Applied Data Science with R: Learn R programming for data analysis, SQL integration, and visualization. Build a complete data science portfolio with practical projects.

HEARD OF ARTISAN? 

Hire an AI BDR to Automate Your LinkedIn Outreach

Sales reps are wasting time on manual LinkedIn outreach. Our AI BDR Ava fully automates personalized LinkedIn outreach using your team’s profiles—getting you leads on autopilot.

She operates within the Artisan platform, which consolidates every tool you need for outbound:

  • 300M+ High-Quality B2B Prospects

  • Automated Lead Enrichment With 10+ Data Sources Included

  • Full Email Deliverability Management

  • Personalization Waterfall using LinkedIn, Twitter, Web Scraping & More

NEWS

This Week in the Tech World

Tesla Plunges After Musk-Trump Feud: Tesla lost $152 billion in market cap, its biggest single-day loss ever, after President Trump threatened to cut government contracts following Musk's criticism of the spending bill. The stock fell 14% as their relationship collapsed.

Apple's WWDC Focuses on Design Over AI: Apple unveiled "Liquid Glass" design language at WWDC, its biggest software redesign since 2013. Wall Street was underwhelmed by incremental AI features, sending the stock down 1.2% as investors wanted more AI progress.

Waymo Cars Burned in LA Protests: Five Waymo robotaxis were set ablaze during anti-ICE protests in downtown Los Angeles. The Alphabet-owned company suspended service in the area amid widespread demonstrations against Trump's immigration crackdown.

Mistral Launches European Reasoning Model: French AI firm Mistral releases its first reasoning model, Magistral, designed to reason in European languages. CEO Arthur Mensch says it competes with OpenAI and DeepSeek while specializing in mathematics and coding.

Microsoft Launches Xbox Handheld Gaming: Microsoft enters portable gaming with new ROG Xbox Ally devices developed with ASUS. This marks Xbox's first handheld console, offering full-screen Xbox experience with cloud gaming support for on-the-go play.

Nvidia CEO on AI Programming: Jensen Huang calls AI the "great equalizer" at London Tech Week, saying programming computers now means "just ask it nicely". He compared AI programming to training a person, making coding accessible to everyone through human language.

Sam Altman's World Launches in UK: OpenAI CEO's biometric identity startup World brings eye-scanning Orb devices to London. The system creates unique codes to verify humans vs. AI, addressing growing fraud concerns as AI tools become more sophisticated.

Meta Forms New AI Lab: Meta is creating a "superintelligence" research lab led by Scale AI CEO Alexandr Wang. The company is also in talks to invest over $10 billion in Scale AI as part of its push to gain an edge in AI development.

IN THE AI WORLD

Start learning AI in 2025

Keeping up with AI is hard – we get it!

That’s why over 1M professionals read Superhuman AI to stay ahead.

  • Get daily AI news, tools, and tutorials

  • Learn new AI skills you can use at work in 3 mins a day

  • Become 10X more productive

BONUS

Just for laughs 😏

HELP US

👋 Hi there! We are on a mission to provide as much value as possible for free. If you want this newsletter to remain free, please help us grow by referring your friends:

📌 Share your referral link on LinkedIn or directly with your friends.
📌 Check your referrals status here.

YOUR FEEDBACK

What did you think of this week's email?

Your feedback helps us create better emails for you!

Login or Subscribe to participate in polls.

Until next time, take care! 🚀

Cheers,