A unified, deep-dive reference covering the Kotlin language, data structures, concurrency, the Android application layer, architecture, testing, and tooling — written for senior-level interview preparation and day-to-day engineering.

📦 GitHub repository: github.com/LeonardoBai12/AdvancedKotlinAndroidEngineering

About

Hi, I’m Leonardo Bai, an Android engineer from Brazil.

This repository started as a collection of notes, interview preparation material, handwritten manuscripts, video scripts, and concepts I revisited countless times until I truly understood them. Over the years, it evolved into a structured reference covering many of the topics that frequently appear in senior-level Android engineering discussions.

More importantly, this project is my interpretation of the Knowledge Portfolio concept introduced by David Thomas and Andrew Hunt in The Pragmatic Programmer.

In the book, the authors encourage developers to treat knowledge as an investment: something that must be accumulated continuously, diversified across different areas, reviewed regularly, and shared whenever possible. Technologies change, frameworks come and go, and expertise naturally depreciates over time. The ability to learn, adapt, and continuously invest in your own growth is one of the most valuable skills an engineer can develop.

This repository represents years of that investment.

It combines lessons learned from real-world Android development, technical interviews, official documentation, books, experimentation, teaching, writing, and even the occasional rubber duck debugging session. Many sections exist because I encountered a concept that I couldn’t explain clearly enough, and decided to keep studying until I could.

While the primary focus is Kotlin and Android, the broader goal is to build a durable foundation in software engineering fundamentals — understanding not only how things work, but also why they work.

If you’re building your own knowledge portfolio, I hope this repository can contribute to it.


References & Inspirations

The content is heavily influenced by official documentation and several books that have shaped the way I think about software engineering:

Special thanks to David Thomas and Andrew Hunt for introducing the Knowledge Portfolio mindset, which became one of the guiding principles behind this project.


Built With

The site is built with Jekyll using the Chirpy theme.


Part I — Language & Data Structures

Chapter Topics
1 · Kotlin Foundations Algorithms, compilation, data types, variables, operators, control flow
2 · OOP Foundations Encapsulation, inheritance, polymorphism, abstraction, dependency inversion
3 · Idiomatic Kotlin data/sealed/enum classes, scope functions, extensions, generics, variance
4 · Memory & Hashing Stack vs heap, object references, HashMap internals, equals/hashCode
5 · Garbage Collection JVM GC, reference types, memory leaks, Android considerations
6 · Kotlin Collections List/Set/Map, arrays, sequences, lazy evaluation, common operations

Part II — Performance & Concurrency Theory

Chapter Topics
7 · Algorithm Analysis & Big O Complexity classes, asymptotic analysis, O(1)–O(N!), LeetCode patterns
8 · Concurrent Collections ConcurrentHashMap, CopyOnWriteArrayList, thread-safe collections
9 · The N+1 Problem Query batching, eager/lazy loading, Room relationship strategies

Part III — Asynchronous Kotlin

Chapter Topics
10 · Kotlin Coroutines & Flow Fundamentals, builders, dispatchers, cancellation, exception handling, Flow, Channels

Part IV — Android Application Layer

Chapter Topics
11 · The Compilation Pipeline Source → bytecode → DEX → ART, R8, ProGuard
12 · Android Lifecycle Activity/Fragment lifecycle, ViewModel scope, process death
13 · Jetpack Compose Composables, state, recomposition, side effects
14 · Deep Links & Navigation URI routing, explicit/implicit deep links, NavController
15 · Android Security Attack surface, encryption, secrets, network security, OWASP Mobile Top 10
20 · Background Work & Notifications Services (started/bound, Binder, Messenger, AIDL), WorkManager, BroadcastReceiver, Notifications, Foreground Services
21 · Platform Constraints & Push Doze Mode, App Standby Buckets, battery optimisation, AlarmManager, FCM, background limits history

Part V — Design & Architecture

Chapter Topics
16 · Gradle & Multi-Module Architecture Module types, REP/CCP/CRP, api vs implementation, convention plugins
17 · SOLID Principles SRP, OCP, LSP, ISP, DIP — with Kotlin examples
18 · Architecture & Pragmatic Wisdom Clean Architecture layers, MVVM, state/events, DI
19 · Testing Testing pyramid, FIRST principles, unit/integration/UI/E2E tests

Appendices

  Topics
Appendix A · Profiling & Diagnostics Android Studio Profiler, LeakCanary, CPU/Memory/Vitals

This site uses Just the Docs, a documentation theme for Jekyll.