- InstaByte
- Posts
- Apple M5 chip made AI 3.5x faster
Apple M5 chip made AI 3.5x faster
ALSO: Time-Series Database

Welcome back!
This week's problem took me 24 hours to solve the first time. Let's see how you do.
Today we will cover:
Rotate Array
Time-Series Database
Read time: under 4 minutes
CODING CHALLENGE
Rotate Array
Given an integer array nums
, rotate the array to the right by k
steps, where k
is non-negative.
Example 1:
Input: nums = [1,2,3,4,5,6,7], k = 3
Output: [5,6,7,1,2,3,4]
Explanation:
rotate 1 steps to the right: [7,1,2,3,4,5,6]
rotate 2 steps to the right: [6,7,1,2,3,4,5]
rotate 3 steps to the right: [5,6,7,1,2,3,4]
Example 2:
Input: nums = [-1,-100,3,99], k = 2
Output: [3,99,-1,-100]
Explanation:
rotate 1 steps to the right: [99,-1,-100,3]
rotate 2 steps to the right: [3,99,-1,-100]
Solve the problem here before reading the solution.
PRESENTED BY SUPERHUMAN
Go from AI overwhelmed to AI savvy professional
AI keeps coming up at work, but you still don't get it?
That's exactly why 1M+ professionals working at Google, Meta, and OpenAI read Superhuman AI daily.
Here's what you get:
Daily AI news that matters for your career - Filtered from 1000s of sources so you know what affects your industry.
Step-by-step tutorials you can use immediately - Real prompts and workflows that solve actual business problems.
New AI tools tested and reviewed - We try everything to deliver tools that drive real results.
All in just 3 minutes a day
SOLUTION
To solve this problem efficiently, we'll implement an in-place rotation algorithm that minimizes extra space usage and handles cases where k might be larger than the array length.
The algorithm works as follows:
First, we use
k %= len(nums)
to handle cases wherek
is larger than the array length.We define a reverse helper function that reverses elements in-place.
Reverse the entire array.
Reverse the first
k
elements.Reverse the remaining elements.
Time complexity is O(n)
, where n
is the length of the array. We perform three reverse operations, each taking O(n/2)
time. Space complexity is O(1)
as we modify the array in-place.

SYSTEM DESIGN
Time-Series Database

Regular databases struggle when dealing with time-based data like stock prices, sensor readings, or server metrics. When you're collecting millions of data points every second, you need a specialized solution. This is where Time-Series Databases (TSDBs) come in.
A TSDB is designed specifically to handle data that changes over time. Instead of updating existing values like traditional databases, it stores each new measurement as a separate data point with its own timestamp. This approach makes it much more efficient at handling continuous streams of data.
Let's look at how TSDBs are different from regular databases:
Data Structure: TSDBs organize data by time intervals rather than by rows and columns. This makes it faster to query data for specific time ranges.
Compression: Since time-series data often follows patterns, TSDBs use special compression techniques. For example, if a temperature sensor reports 20°C for several hours, the database can store this efficiently instead of saving thousands of identical readings.
Data Retention: TSDBs often include built-in features to automatically delete or compress old data. You might want to keep detailed data for the last week but only hourly averages for older data.
Time-Based Queries: TSDBs are optimized for common time-series operations like finding rates of change, averaging over time periods, or detecting trends.
Popular time-series databases include InfluxDB, Prometheus, and TimescaleDB. Each has its strengths:
InfluxDB is purpose-built for time-series data and offers excellent write performance
Prometheus is designed for monitoring and includes built-in alerting
TimescaleDB extends PostgreSQL, making it familiar for teams already using PostgreSQL
Here's how they compare:
Feature | Regular Database | Time-series Database |
---|---|---|
Data Model | Row-based | Time-based |
Write Pattern | Updates existing data | Append-only |
Query Focus | Current state | Historical patterns |
Compression | General purpose | Time-series optimized |
Best for | CRUD operations | Continuous measurements |
FEATURED COURSES
5 Courses of the Week
✅ Stanford’s Algorithms Specialization: Master fundamental algorithms through programming assignments and conceptual learning. This specialization prepares you to excel in technical interviews and communicate fluently about algorithms without focusing on low-level implementation details.
✅ AI Programming with Python: Build Python fundamentals for AI using NumPy, Pandas, and Matplotlib. Learn deep learning frameworks like PyTorch and natural language processing with Transformers.
✅ Microsoft Back-End Developer Professional Certificate: Master server-side programming with .NET, C#, and Azure Cloud, developing scalable applications using AI tools.
✅ Intro to Machine Learning with Pytorch: Learn machine learning from foundational algorithms (linear regression, decision trees, SVMs) to deep neural networks and unsupervised learning.
✅ Data Engineering with AWS: Design data models, build data warehouses and data lakes, automate pipelines, and work with massive datasets using AWS services.
HEARD OF THE CODE?
What 100K+ Engineers Read to Stay Ahead
Your GitHub stars won't save you if you're behind on tech trends.
That's why over 100K engineers read The Code to spot what's coming next.
Get curated tech news, tools, and insights twice a week
Learn about emerging trends you can leverage at work in just 10 mins
Become the engineer who always knows what's next
NEWS
This Week in the Tech World

Apple Unveils M5 MacBook Pro: Apple launched the 14-inch MacBook Pro with M5 chip, delivering 3.5x faster AI performance, 1.6x faster graphics, and up to 24 hours of battery life. Starts at $1,599, available October 22.
Python Dominates TIOBE Index: Python maintained its lead with 24.45% in October's TIOBE Index, holding a historic 15% advantage over second-place C. This marks the largest language lead in TIOBE history. SQL reentered the top 10.
OpenAI Partners With Broadcom: OpenAI and Broadcom announced a deal to co-develop 10 gigawatts of custom AI chips, reducing OpenAI's reliance on Nvidia. Deployment starts late 2026. Broadcom stock jumped 10% on the announcement.
GitHub Copilot Chat Flaw: Security researchers discovered a critical vulnerability in GitHub Copilot Chat that leaked AWS keys and private repository data through hidden markdown prompts. GitHub patched the flaw in August.
Google Launches Gemini Enterprise: Google introduced Gemini Enterprise at $30 per user monthly, a comprehensive AI platform for building custom workplace agents. Early customers include Figma, Klarna, and Virgin Voyages with 50+ agents deployed.
Microsoft Releases Agent Framework: Microsoft launched a preview of its open-source Agent Framework for .NET and Python, enabling developers to easily create AI agents and multi-agent workflows for enterprise applications.
Meta Hires AI Talent for $1.5B: Meta acquired Thinking Machines Lab co-founder Andrew Tulloch with a compensation package reportedly reaching $1.5 billion over six years, underscoring the escalating AI talent arms race.
Microsoft Patches 172 Flaws: Microsoft's October Patch Tuesday fixed 172 vulnerabilities including six zero-days, two actively exploited in the wild. The company removed the legacy Agere Modem driver entirely rather than patching it.
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! |
Until next time, take care! 🚀
Cheers,