Kotlin Language Essentials for Android
var vs val, null safety, data classes, when expressions, extension functions, scope functions and fundamental Kotlin concepts
24 면접 질문·
Junior
1What is the difference between 'var' and 'val' in Kotlin?
1
What is the difference between 'var' and 'val' in Kotlin?
답변
'var' declares a mutable (modifiable) variable, while 'val' declares an immutable (read-only) variable. It's recommended to use 'val' by default to promote immutability and avoid bugs.
2What does the '?' operator after a type mean in Kotlin?
2
What does the '?' operator after a type mean in Kotlin?
답변
The '?' operator indicates that the variable can contain null. For example, 'String?' means the variable can be a String or null. This is the basis of Kotlin's null safety system.
3What does the '!!' operator do in Kotlin?
3
What does the '!!' operator do in Kotlin?
답변
The '!!' operator (not-null assertion) forces the compiler to treat a nullable value as non-null. If the value is null, a NullPointerException is thrown. Only use when you're certain the value is not null.
4
What is the Elvis operator '?:' used for in Kotlin?
5
What is a data class in Kotlin?
+21 면접 질문
기타 Android 면접 주제
Android Fundamentals
Junior
24개 질문Android UI and Resources
Junior
30개 질문Android Lifecycle
Junior
30개 질문Android Navigation
Junior
26개 질문Android Data Management
Junior
29개 질문Android Networking
Junior
29개 질문Android Testing
Junior
28개 질문Android Gradle
Junior
26개 질문Room Database
Mid-Level
25개 질문Background Work
Mid-Level
18개 질문Jetpack Compose
Mid-Level
28개 질문Permissions and Device Features
Mid-Level
21개 질문Firebase for Android
Mid-Level
23개 질문Android MVVM Architecture
Mid-Level
18개 질문Advanced Android Networking
Mid-Level
13개 질문Kotlin Collections and Operators
Mid-Level
20개 질문Kotlin Coroutines and Flow
Mid-Level
20개 질문Android Dependency Injection
Mid-Level
15개 질문Android MVI Architecture
Mid-Level
17개 질문Android Clean Architecture
Senior
21개 질문Android Compose Advanced
Senior
17개 질문Android Performance and Monitoring
Senior
13개 질문Android Security and Privacy
Senior
18개 질문Android CI/CD and Release
Senior
15개 질문Android UX and Form Factors
Senior
18개 질문Android Testing Advanced
Senior
18개 질문