Calculating Compound Interest

Introduction

Welcome to Lesson 4 of 5 in Interest, Savings, and Borrowing — we are nearly at the finish line! So far, we have built up from reading interest terms to computing single-period interest and then extending that work across multiple periods with simple interest. In every calculation up to this point, the base stayed locked at the original principal.

This lesson changes the game. We will explore compound interest, where each period's interest is added to the balance before the next calculation begins. Instead of a fixed base, the base grows from one period to the next. We will work through this process year by year, building each new balance step by step.

The Core Idea: Interest on Interest

With simple interest, the base never moves — it is always the original deposit or loan amount. Compound interest takes a different approach. At the end of each period, the interest earned is folded into the balance, and that updated balance becomes the base for the following period.

Think of it like a snowball rolling downhill. Each rotation picks up a bit more snow, which makes the ball bigger, which means the next rotation picks up even more. With compound interest, each period's interest is a little larger than the last because the base itself has grown. This "interest on interest" effect is what makes compounding powerful over time.

Starting With Year One

Rolling the Balance Into Year Two

Sign up

Join the 1M+ learners on CodeSignal

Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal