China bans NVIDIA chips

ALSO: Data Compaction in LSM Trees

Welcome back!

The algorithm pattern we'll learn today appears in countless other problems. Master it here, and you'll unlock solutions to many more challenges.

Today we will cover:

  • Minimum Path Sum

  • Data Compaction in LSM Trees

Read time: under 4 minutes

CODING CHALLENGE

Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right, which minimizes the sum of all numbers along its path.

Note: You can only move either down or right at any point in time.

Example 1:

Input: grid = [[1,3,1],[1,5,1],[4,2,1]]
Output: 7
Explanation: Because the path 1 → 3 → 1 → 1 → 1 minimizes the sum.

Example 2:

Input: grid = [[1,2,3],[4,5,6]]
Output: 12

Solve the problem here before reading the solution.

PRESENTED BY AWS

Meet AWS Experts and Community at AWS re:Invent

Take your technical career to the next level. Master new AWS services, join immersive workshops, and network with top cloud innovators at AWS re:Invent 2025. As a re:Invent attendee, you'll receive 50% discount code towards any AWS Certification exam. 

SOLUTION

To solve this problem, we'll use dynamic programming. We'll create a 2D array to store the minimum path sum for each cell. The solution works as follows:

  1. Create a DP table with the same dimensions as the input grid.

  2. Initialize the first cell, first row, and first column.

  3. For each cell, calculate the minimum path sum by adding the current cell's value to the minimum of the paths from above or left.

  4. The bottom-right cell will contain the minimum path sum from top-left to bottom-right.

Time complexity is O(m*n), where m and n are the dimensions of the grid. Space complexity is also O(m*n).

SYSTEM DESIGN

Data Compaction in LSM Trees

NOTE: If you don’t know what an LSM Tree is, please read the System Design topic here before moving forward.

When databases use LSM Trees to write data, they create multiple small files called SSTables. Over time, these files accumulate and slow down read operations because the database needs to check many files to find data. This is where compaction comes in.

Compaction is the process of combining multiple SSTables into a single, larger SSTable. During compaction, the database merges these files while removing duplicates and deleted entries.

There are two main compaction strategies: Size-tiered and Leveled compaction.

Size-tiered compaction groups SSTables of similar sizes together. When enough SSTables of a similar size exist, they're merged into a larger SSTable. This process continues, creating increasingly larger SSTables. This strategy works well for write-heavy workloads because it minimizes write amplification (how many times data is rewritten).

Leveled compaction organizes SSTables into levels, with each level being larger than the previous one. Level 0 contains the newest data, and when it gets full, some data is merged into Level 1. This continues through multiple levels, with each level being about 10 times larger than the previous one. This approach provides better read performance because there's less overlap between SSTables.

Here's how both strategies compare:

Size-tiered

Leveled

Better for writes

Better for reads

Higher space amplification

Lower space amplification

Simpler to implement

More complex to implement

Less predictable performance

More consistent performance

Used in Cassandra

Used in RocksDB

FEATURED COURSES

5 Courses of the Week

 IBM Generative AI Engineering Certificate: Master LLMs, transformers, and NLP. Build AI apps using BERT, GPT, LLaMA. Includes hands-on projects using LangChain and RAG.

 Google Cloud Developer Certificate: Teaches cloud-native application design and maintenance through hands-on Google Cloud labs. Provides real-world experience with Google Cloud technologies for the Cloud Developer role.

 Meta Front-End Developer Certificate: Master web development skills by learning HTML5, CSS, JavaScript, and industry-standard design tools like Bootstrap and React. You'll complete multiple projects and a final capstone project.

 Data Engineering with AWS: Design data models, build data warehouses and lakes, automate pipelines, and work with massive datasets using AWS services.

 LLMs & Text Generation: Learn to build custom chatbots using NLP techniques, transformer architectures, and retrieval augmented generation (RAG).

STAY AHEAD 

Fact-based news without bias awaits. Make 1440 your choice today.

Overwhelmed by biased news? Cut through the clutter and get straight facts with your daily 1440 digest. From politics to sports, join millions who start their day informed.

NEWS

This Week in the Tech World

China bans Nvidia chip purchases: Beijing orders tech companies to stop buying Nvidia's RTX Pro 6000D chips, saying domestic alternatives now match performance. House Speaker Johnson calls China an "adversary" as chip war escalates between world's largest economies.

Amazon launches AI seller agent: E-commerce giant adds agentic capabilities to Seller Assistant, letting AI take actions for third-party merchants. Tool handles inventory, pricing, and account issues for 1.3 million sellers using generative AI listing features.

Lyft partners with Waymo for Nashville: Ride-sharing company teams with Alphabet's robotaxi service to launch in Nashville next year. Lyft stock jumps 10% as company provides fleet management while Waymo expands beyond current Phoenix, SF, and LA operations.

OpenAI reveals ChatGPT usage study: First comprehensive analysis of 1.5 million conversations shows 73% are non-work related, up from 53% last year. Most common uses are practical guidance, information seeking, and writing assistance across global user base.

Tech giants commit $40B to UK AI: Microsoft announces $30 billion investment to build UK's largest supercomputer during Trump state visit. Nvidia, Google, OpenAI, and Salesforce also pledge major funding as countries compete for AI infrastructure leadership.

OpenAI launches teen ChatGPT controls: Company introduces age-appropriate ChatGPT experience with parental oversight after FTC inquiry into AI safety for minors. Parents can set usage hours, manage features, and receive distress notifications starting end of month.

Warren questions Trump's crypto czar: Senator Elizabeth Warren probes whether David Sacks exceeded 130-day limit for Special Government Employees. Lawmakers warn overstaying raises ethics concerns as administration shapes cryptocurrency and AI policy.

WORK SMARTER WITH AI

Used by Execs at Google and OpenAI

Join 400,000+ professionals who rely on The AI Report to work smarter with AI.

Delivered daily, it breaks down tools, prompts, and real use cases—so you can implement AI without wasting time.

If they’re reading it, why aren’t you?

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,