Musk Testifies Against OpenAI

ALSO: Distributed Logging and Monitoring

In partnership with

Welcome back!

This week’s coding challenge has been asked by every single FAANG company. Let’s see if you can solve it in under 45 minutes.

Today we will cover:

  • Combination Sum

  • Distributed Logging and Monitoring

Read time: under 4 minutes

CODING CHALLENGE

Combination Sum

Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.

The same number may be chosen from candidates an unlimited number of times. Two combinations are unique if the frequency of at least one of the chosen numbers is different.

The test cases are generated such that the number of unique combinations that sum up to target is less than 150 combinations for the given input.

Example 1:

Input: candidates = [2,3,6,7], target = 7
Output: [[2,2,3],[7]]
Explanation:
2 and 3 are candidates, and 2 + 2 + 3 = 7. Note that 2 can be used multiple times.
7 is a candidate, and 7 = 7.
These are the only two combinations.

Example 2:

Input: candidates = [2,3,5], target = 8
Output: [[2,2,2,2],[2,3,3],[3,5]]

Solve the problem here before reading the solution.

PRESENTED BY WISPR FLOW

Works inside Cursor, Warp, VS Code, and every IDE.

Wispr Flow sits at the system level — dictate into any editor, terminal, or app with full syntax accuracy. No plugins needed. No setup per tool. 89% of messages sent with zero edits.

SOLUTION

To solve this problem, we'll use a backtracking approach. Backtracking is a technique that tries to build an answer step by step. If it realizes that the current path won't work, it goes back and tries a different path.

In this case, we'll use a recursive function called backtrack that explores all possible combinations of candidates that sum up to the target. We'll start by sorting the candidates to help with avoiding duplicate combinations and to optimize the backtracking process.

The key idea is to:

  1. Sort the candidates array

  2. Use a recursive function that tries including or excluding each candidate

  3. Keep track of the current combination and current sum

  4. Add a combination to the result when the sum equals the target

Time complexity is O(2^n), where n is the number of candidates. That’s because we're essentially exploring all possible combinations and there are a total of 2^n such combinations.

SYSTEM DESIGN

Distributed Logging and Monitoring

When your application runs across hundreds of servers, finding the root cause of problems becomes incredibly challenging. A user reports a failed payment, but which of your many services caused the issue? This is where distributed logging and monitoring comes in.

Let's start with logging. In a distributed system, each service generates its own logs. But having logs scattered across different servers makes troubleshooting difficult. The solution is to use a centralized logging system where all services send their logs to a central location.

Every log entry should include a correlation ID, a unique identifier that tracks a request as it moves through different services. When a user makes a request, generate a correlation ID and pass it to every service involved. This way, you can trace the entire journey of a request across your system.

For monitoring, you need three types of metrics:

  1. Infrastructure metrics: CPU, memory, and disk usage of your servers

  2. Application metrics: Response times, error rates, and request counts

  3. Business metrics: Number of orders, revenue, active users

These metrics help you spot problems before users do. For example, if memory usage is climbing unusually fast, you can address it before the system crashes.

Use alerts wisely. Too many alerts cause "alert fatigue" where important notifications get ignored. Set up different alert levels:

- Critical: Immediate action required (system down)

- Warning: Need attention soon (high memory usage)

- Info: Good to know (new deployment complete)

Remember, good logging and monitoring isn't about collecting everything possible. It's about collecting the right information that helps you understand and fix problems quickly.

FEATURED COURSES

5 Courses of the Week

✅ Google Cloud Data Engineer Professional Certificate: Industry-recognized program from Google Cloud that prepares you for the Professional Data Engineer certification exam, covering data lakes and warehouses, batch and streaming pipelines with Dataflow and Pub/Sub, BigQuery analytics, and ML integration with Vertex AI.

✅ Retrieval Augmented Generation (RAG) by DeepLearning.AI: Design, build, and evaluate production-ready RAG systems including retrievers, vector databases (Weaviate), prompt engineering, and deploy with real-world datasets from e-commerce, media, and healthcare.

✅ MLOps Specialization by DeepLearning.AI: This 4-course specialization covers the full MLOps lifecycle; from scoping projects, handling concept drift, and building data pipelines with TensorFlow Extended, to deploying, monitoring, and maintaining production ML systems.

✅ Beginner Python Certification Prep: Python fundamentals covering syntax, data types, control flow, functions, OOP, and advanced topics like generators and regex to prepare for PCEP exam.

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

DON'T FORGET TO TRY WISPR FLOW

The best prompt engineers aren't typing. They're talking.

Power users figured this out early: speaking a prompt gives you 10x more context in half the time. You include the edge cases, the examples, the tone you want — because talking is fast enough that you don't skip them.

Wispr Flow captures everything you say and turns it into clean, structured text for any AI tool. Speak messy. Get polished input. Paste into ChatGPT, Claude, Cursor, or wherever you work.

89% of messages sent with zero edits. 4x faster than typing. Works system-wide on Mac, Windows, and iPhone.

NEWS

This Week in the Tech World

Musk Testifies Against OpenAI: Elon Musk took the stand in the high-stakes trial over OpenAI's future, accusing Sam Altman and the leadership team of abandoning the nonprofit mission Musk says he co-founded the company to serve.

Cursor Agent Wipes Production DB: A Claude-powered Cursor agent autonomously deleted a startup's full production database and backups after finding a broad API token during a routine task, wiping months of data for a car-rental platform in seconds.

OpenAI Launches Workspace Agents: OpenAI debuted Workspace Agents in ChatGPT as the successor to custom GPTs for organizations. Powered by Codex, they run in the cloud and integrate with Slack, Drive, Microsoft 365, Salesforce, Notion, and Atlassian.

China Blocks Meta-Manus Deal: Beijing ordered Meta to unwind its $2B+ acquisition of AI startup Manus, escalating scrutiny of US investment in Chinese frontier tech and signaling cross-border AI M&A is now a national-security battleground.

Google Unveils Eighth-Gen TPUs: Google Cloud rolled out 8th-gen TPUs as two specialized chips: TPU 8t for large-scale AI training and TPU 8i for high-volume inference workloads, directly challenging Nvidia's GPU dominance in the accelerator market.

OpenAI Lands on AWS Bedrock: Amazon and OpenAI expanded their partnership, making OpenAI's models, Codex, and managed agents available through AWS Bedrock.

Microsoft Offers Mass Buyouts: Microsoft is offering buyouts to about 7% of its US workforce by the end of June—the first company-wide buyout in its 51-year history—as Big Tech keeps cutting headcount while pouring billions into AI infrastructure.

Google Inks Pentagon AI Deal: Google signed a classified deal allowing the Department of Defense to use its AI models for sensitive military work, joining OpenAI and xAI in supplying AI systems to the US government for national security use.

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,