Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A hands-on exercise book for developers who already know some Kotlin and want to sharpen their skills through deliberate practice. It covers everything from basic syntax and nullability to collections, functional programming, coroutines, flows, and advanced topics like reflection and annotation processing.
【Book Arc】
- **Opening (~0%–12%)**: Starts with essential Kotlin exercises covering `when` expressions, nullability, and object declarations. The goal is to build fluency with core language features through small, focused problems.
- **Early (~12%–32%)**: Moves into functional programming and collections—observable values, collection processing optimization, recursive algorithms like partitions, and custom coroutine contexts. This stage builds problem-solving skills with Kotlin's standard library.
- **Middle (~32%–52%)**: Dives into coroutines and flows with practical scenarios: simulating a cafeteria with channels, building a `NewsViewModel` with `Flow`, handling cancellation correctly, and testing coroutine-based code. Also introduces advanced topics like property delegation choices and Java interoperability.
- **Late (~52%–end)**: Covers reflection, annotation processing with KSP, and generating wrapper classes. The book closes with a large set of solutions (from ~218 onward) covering functional quicksort, powerset, DSLs, scope functions, and flow utilities.
【Key Takeaways】
- **Exercises are the core learning mechanism** (Opening): Each concept is introduced through a concrete coding task with starting code, example usage, and unit tests, making the book a workbook rather than a reference.
- **Progressive difficulty from essentials to advanced** (Early–Middle): The book moves from `when` expressions and nullability to coroutines, flows, and annotation processing, so readers can grow with the material.
- **Coroutines and flows get substantial coverage** (Middle): Topics include context propagation, dispatchers, cancellation mistakes, testing, and flow operators—practical skills for modern Kotlin development.
- **Functional programming is taught through real refactoring** (Early): Exercises like optimizing collection processing and refactoring Java-style loops into Kotlin collection functions teach idiomatic style.
- **Advanced topics include reflection and KSP** (Late): Readers implement a function caller via reflection and an annotation processor that generates a measured wrapper class, bridging Kotlin with Java tooling.
- **Solutions are provided for every exercise** (Late): The book includes a full solutions section, enabling self-study and verification without external help.
- **GitHub project integration** (Throughout): Starting code and unit tests are available in the `MarcinMoskala/kotlin-exercises` repository, encouraging local practice.
【Reading Tips】
- **Skim the essentials if you're already comfortable** (Opening): If you know Kotlin basics, jump to the functional and coroutine sections where the real challenge lies.
- **Deep-read the coroutine and flow chapters** (Middle): These are the most complex and practically valuable parts; work through the cancellation and testing exercises carefully.
- **Use the GitHub repo alongside the book**: Clone the project and solve exercises locally with unit tests to get immediate feedback.
- **Don't skip the solutions section**: Compare your approach with the provided solutions, especially for recursive and functional problems.
- **Treat advanced topics as optional stretch goals**: Reflection and KSP are niche; tackle them if you need that specific skill.
【Coverage Limits】
The excerpts cover the table of contents and a sample of exercises from the opening through the middle, plus some advanced topics. The full solutions section and later chapters are only partially represented, so this guide may not capture every exercise or nuance.
Page 13
e -> "No idea, really" } fun main() { println(name(1)) // ? println(name("A")) // ? println(name(null)) // ? println(name(5)) // ? println(name(100)) // ? pr...
or this code to use Kotlin collection processing functions. The function is responsible for finding the best students for internships. This is what is looks...
ge and unit tests can be found in the MarcinMoskala/kotlin- exercises project on GitHub in the file advanced/reflection/FunctionCaller.kt. You can clone this...
nes to fit the page. In real code, I would not do that. 230 Solution: Factorial sequence val factorial: Sequence<BigInteger> = sequence { var i = BigInteger....
est fun `should collect exceptions from all coroutines`() { val fakeNotificationsClient = FakeNotificationClient( delayTime = 100, failEvery = 10 ) val fakeE...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Kotlin Exercises (Marcin Moskała)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Kotlin Exercises (Marcin Moskała)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Kotlin Exercises (Marcin Moskała)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment