LeetCode MEDIUM 518 Coin Change II Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Coin Change II
  • Main tags: Array, Dynamic Programming

What the problem is really asking

The input gives a target amount and a list of coin denominations. Each denomination can be used as many times as needed.

The task is to count how many distinct combinations can make the amount exactly. It is not asking for the minimum number of coins, and it is not asking whether the amount is possible at all.

Continue ...

System Design Video Streaming Platform Summary

Generated by Codex with gpt-5

Selected problem: Video Streaming Platform

Scope: Design a global video-on-demand platform that supports resumable creator uploads, transcoding, metadata/search, and adaptive-bitrate playback on web, mobile, and TV clients; exclude recommendations, ads, and live streaming from the first version.

Problem framing

This is the classic “design YouTube / Netflix-style VOD platform” interview. Grokking is useful for the interview flow: clarify scope, define APIs early, size uploads versus reads, and separate large media blobs from metadata. Alex Xu adds the practical serving path: object storage for source and encoded media, an asynchronous transcoding pipeline, CDN-based delivery, and a metadata control plane. DDIA sharpens the deeper answer: treat search indexes, counters, and playback-ready state as derived data maintained from durable logs and background workflows, not as one giant transactional database.

Continue ...

LeetCode MEDIUM 322 Coin Change Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Coin Change
  • Main tags: Array, Dynamic Programming, Breadth-First Search

What the problem is really asking

The input gives a set of coin denominations and a target amount. Each coin can be used as many times as needed.

The goal is not to count how many different ways the amount can be formed. The goal is to find the fewest coins needed to reach the exact amount. If the amount cannot be formed exactly, the answer is -1.

Continue ...

System Design ChatGPT Summary

Generated by Codex with gpt-5.4

Selected problem: ChatGPT

Scope: Design a text-first ChatGPT-style assistant that supports multi-turn conversations, streamed responses, document-backed answers, bounded tool use, and durable conversation history for consumers and teams.

Problem framing

This interview problem combines ideas from several classic designs instead of mapping neatly to one old chapter. Grokking’s framework still applies: clarify scope, define APIs, estimate scale, pick a data model, then explain the high-level design and bottlenecks. Alex Xu’s chat-system chapter is useful for session handling, streaming delivery, and multi-device conversation sync; the YouTube chapter is useful for large-object storage and asynchronous processing; DDIA adds the deeper foundation for logs, caches, replication, partitioning, derived data, and backpressure. The key modern shift is that the assistant is not only a chat transport problem. It is a stateful product sitting on top of an expensive inference pipeline.

Continue ...

LeetCode HARD 239 Sliding Window Maximum Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: HARD
  • Problem: Sliding Window Maximum
  • Main tags: Array, Queue, Sliding Window, Heap (Priority Queue), Monotonic Queue

What the problem is really asking

The input gives an array and a window size k. Imagine placing a length-k window over the first k elements, recording the maximum value inside that window, then moving the window one step to the right and repeating until the end.

Continue ...

LeetCode MEDIUM 1004 Max Consecutive Ones III Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

This problem sounds like a bit-flipping question, but the useful reframe is simpler:

find the longest contiguous subarray that contains at most k zeroes.

Continue ...

LeetCode MEDIUM 152 Maximum Product Subarray Summary

Generated by Codex with GPT-5

Quick facts

What the problem is really asking

This problem asks for the contiguous subarray whose product is as large as possible.

That sounds close to Maximum Subarray, but products behave very differently from sums. With sums, a very negative running total is usually bad news. With products, a very negative running product can suddenly become the best thing to keep if the next number is also negative.

Continue ...

LeetCode MEDIUM 221 Maximal Square Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Maximal Square
  • Main tags: Array, Dynamic Programming, Matrix

What the problem is really asking

The input is a grid of "0" and "1" values. The job is to find the area of the largest square made entirely of 1s.

The part that usually traps people is the word “square.” A brute-force approach tends to ask:

Continue ...

LeetCode MEDIUM 994 Rotting Oranges Summary

Generated by Codex with GPT-5

Quick facts

  • Difficulty: MEDIUM
  • Problem: Rotting Oranges
  • Main tags: Array, Breadth-First Search, Matrix

Problem gist

The grid has three kinds of cells: empty (0), fresh oranges (1), and rotten oranges (2). Every minute, any fresh orange touching a rotten orange in the four main directions also becomes rotten.

Continue ...

System Design Distributed File Storage Summary

Generated by Codex with gpt-5

Selected problem: Distributed File Storage

Scope: Design a cloud file storage and sync service that stores large files durably, keeps file and folder metadata consistent, and propagates changes across devices and shared workspaces.

Problem framing

This is the classic Dropbox / Google Drive interview problem. Grokking and Alex Xu both push the same core split early: separate the metadata and synchronization plane from the binary file storage plane. DDIA adds the more durable framing: the namespace, versions, and permissions are the system of record, while notifications, sync cursors, search indexes, thumbnails, and audit views are derived data built from change streams.

Continue ...