Β© 2026 3DaysOfSwift.com. All rights reserved.
This repository contains FizzBuzz. A classic interview question.
Task: The FizzBuzz algorithm.
Difficulty level: Beginner.
Description: A common coding challenge is known as the "BuzzFizz" algorithm, which asks developers to loop through a series of numbers printing each number as a String. However, when the number can be divided by three the word "Fizz" should be printed. When the number is divisible by five the word "Buzz" should be printed. When the number is divisible by both three and five the word "FizzBuzz" is printed.
Things to think about: Get a working solution together first. Afterwards think about the efficiency of your solution and alter the code to make fewer duplicated calculations.
Unit tests: Write unit tests first. They provide immediate feedback for each function you create helping you to know if your code works and matches the expected behaviour.
Instructions: Create a new project or Xcode playgound and write the buzz fizz algorithm. If you want to be professional you can write unit tests.
Download this Xcode project at 3DaysOfSwift.com.
Apple created The Swift Programming Language (TSPL) book to discuss and describe the following language features.
- The Basics
- Basic Operators
- Strings and Characters
- Collection Types
- Control Flow
- Functions
- Closures
- Enumerations
- Structures and Classes
- Properties
- Methods
- Subscripts
- Inheritance
- Initialization
- Deinitialization
- Optional Chaining
- Error Handling
- Concurrency
- Macros
- Type Casting
- Nested Types
- Extensions
- Protocols
- Generics
- Opaque Types
- Automatic Reference Counting
- Memory Safety
- Access Control
- Advanced Operators
Read our Xcode playground conversion only at 3DaysOfSwift.com
Β© 2026 3DaysOfSwift.com. All rights reserved.
Built for professional iOS developers.
π©πΏβπ»π§π»βπ»ππΏββοΈπ§πΌβπ»π©πΌβπΌπ©π½βπ»π§πΏβπ»ππΌββοΈπ©πΌβπ»π¨πΌβπ»π¨π½βπ»ππ½ββοΈπ©π»βπ»π§πΎβπ»π©π»βπ»π©πΎβπ»π¨πΌβπ»ππ»ββοΈπ¨πΏβπ»ππΌββοΈ