GPT-5 is coming!

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 THE RUNDOWN AI

Learn AI in 5 minutes a day

This is the easiest way for a busy person wanting to learn AI in as little time as possible:

  1. Sign up for The Rundown AI newsletter

  2. They send you 5-minute email updates on the latest AI news and how to use it

  3. You learn how to become 2x more productive by leveraging AI

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

 Data Science/ML/DL/NLP Bootcamp: Comprehensive program covering theory, practice, and mathematics of data science, machine learning, deep learning, and NLP with end-to-end projects.

 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.

 Learn DevOps: Docker, Kubernetes, Terraform and Azure DevOps: Complete DevOps training covering containerization, orchestration, infrastructure as code, and CI/CD pipelines across AWS, Azure, and Google Cloud platforms.

 Microsoft Azure Developer Associate Certificate Prep: Course for Developing Solutions for Microsoft Azure: Learn Azure Storage features, develop .NET applications for Azure services, and deploy cloud applications with hands-on practice for Developer Associate certification.

NEWS

This Week in the Tech World

GPT-5 Unifies AI Models: OpenAI announced that GPT-5 will merge advancements from several specialized models into a single, more capable system. The company aims to integrate reasoning, multimodality, and long-context understanding into one core foundation. GPT-5 is expected to launch later in 2025.

Jack Dorsey's Bluetooth Messaging App: Twitter co-founder Jack Dorsey launched Bitchat, a peer-to-peer messaging app that works entirely over Bluetooth without internet, servers, or accounts. Messages are encrypted and stored only on-device.

Copilot Gets Web Browser: GitHub announced that its Copilot coding agent now has access to a web browser powered by the Playwright MCP server. The agent can interact with web applications while making changes, reproduce bugs, and validate its work.

Tesla Stock Tumbles 7%: Tesla lost $68 billion in value after Elon Musk announced plans to form the "America Party." Investors worry about Musk's political involvement hurting Tesla's brand during a crucial growth period.

Grok AI Makes Antisemitic Posts: Elon Musk's Grok chatbot posted antisemitic comments praising Hitler on X before being corrected. xAI blamed unauthorized modifications and said they're training the model to prevent hate speech.

Bezos Sells $666M Amazon Stock: Jeff Bezos sold nearly 3 million Amazon shares worth $665.8 million as part of his plan to unload 25 million shares through May 2026. The sale came after his $50 million Venice wedding.

Robinhood Defends OpenAI Tokens: Robinhood CEO Vlad Tenev defended the company's OpenAI stock tokens despite warnings they don't represent actual equity. He said it's about giving retail investors exposure to private AI companies.

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,