Android & Jetpack Compose (50 Qs)•Part 3: ART Internals, Memory Leak Profiling & Production Hardening (25 - 35)
Network Layer with Retrofit, OkHttp, and Interceptors: Connection pooling and certificate pinning.
senior LevelPerformanceMemory ManagementHTTP & REST APIs
In Simple Words: The gold standard Android networking stack:
- Connection Pooling: OkHttp keeps persistent HTTP/2 and HTTP/3 TCP sockets open, eliminating handshake latency for subsequent requests.
- Interceptors: Chain of middleware for logging, adding auth headers (
Authorization: Bearer <token>), and handling token refresh automatically viaAuthenticator. - Certificate Pinning: Hardcodes SHA-256 public key hashes to reject rogue certificate authority MITM attacks.