JSON Serialization

DATA › Networking

Mapping JSON to Kotlin types with kotlinx.serialization, Moshi, and Gson.

JSON serialization is a near-universal Android interview topic because every networked app parses API payloads, and the library you pick affects build speed, app size, and crash safety. Interviewers test whether you understand compile-time codegen versus runtime reflection, how each library handles missing/unknown/optional fields and defaults, and why kotlinx.serialization is now the default for new Kotlin and KMP code. Expect to compare kotlinx.serialization, Moshi, and Gson and to reason about polymorphism and custom serializers.

What this covers

Study this topic

Further reading