Skip to content

Instantly share code, notes, and snippets.

@tusharhow
Last active February 1, 2025 11:40
Show Gist options
  • Save tusharhow/0501c33752878cdb1ea76def2d9bb68e to your computer and use it in GitHub Desktop.
Save tusharhow/0501c33752878cdb1ea76def2d9bb68e to your computer and use it in GitHub Desktop.
{
"quizzes": [
{
"id": 1,
"question": "What is Kotlin's 'when' expression equivalent to in Java?",
"options": [
"if-else statement",
"switch statement",
"for loop",
"while loop"
],
"correctAnswer": "switch statement",
"explanation": "Kotlin's 'when' expression is similar to Java's switch statement but more powerful, as it can handle any type of expression and doesn't require break statements.",
"category": "Kotlin"
},
{
"id": 2,
"question": "What is the purpose of 'suspend' keyword in Kotlin?",
"options": [
"To pause the application",
"To mark a function that can be paused and resumed",
"To stop a thread",
"To suspend the entire program"
],
"correctAnswer": "To mark a function that can be paused and resumed",
"explanation": "The suspend keyword is used to mark functions that can be paused and resumed later, making them suitable for use with coroutines for asynchronous programming.",
"category": "Kotlin"
},
{
"id": 3,
"question": "What is Jetpack Compose?",
"options": [
"A database library",
"A modern UI toolkit for Android",
"A networking library",
"A testing framework"
],
"correctAnswer": "A modern UI toolkit for Android",
"explanation": "Jetpack Compose is Android's modern toolkit for building native UI. It simplifies and accelerates UI development on Android using a declarative approach.",
"category": "Android"
},
{
"id": 4,
"question": "What is the purpose of ViewModel in Android?",
"options": [
"To store UI-related data",
"To handle database operations",
"To manage network calls",
"To create layouts"
],
"correctAnswer": "To store UI-related data",
"explanation": "ViewModel is designed to store and manage UI-related data in a lifecycle conscious way, surviving configuration changes like screen rotations.",
"category": "Android"
},
{
"id": 5,
"question": "What is Room in Android?",
"options": [
"A UI component",
"A database abstraction layer",
"A networking library",
"A memory management tool"
],
"correctAnswer": "A database abstraction layer",
"explanation": "Room is an abstraction layer over SQLite that provides easier database operations while ensuring compile-time verification of SQL queries.",
"category": "Android"
},
{
"id": 6,
"question": "What is a Coroutine in Kotlin?",
"options": [
"A type of variable",
"A lightweight thread for asynchronous programming",
"A database operation",
"A UI component"
],
"correctAnswer": "A lightweight thread for asynchronous programming",
"explanation": "Coroutines are lightweight threads that can be suspended and resumed, making them perfect for asynchronous programming without blocking the main thread.",
"category": "Kotlin"
},
{
"id": 7,
"question": "What is the purpose of StateFlow in Kotlin?",
"options": [
"To manage UI state",
"To handle database operations",
"To make network calls",
"To create animations"
],
"correctAnswer": "To manage UI state",
"explanation": "StateFlow is a state-holder observable flow that emits the current and new state updates to its collectors, commonly used for UI state management.",
"category": "Kotlin"
},
{
"id": 8,
"question": "What is Material Design 3?",
"options": [
"A programming language",
"A design system by Google",
"A database system",
"A testing framework"
],
"correctAnswer": "A design system by Google",
"explanation": "Material Design 3 is Google's latest design system that provides guidelines, components, and tools for creating modern and consistent user interfaces.",
"category": "Android"
},
{
"id": 9,
"question": "What is the purpose of Dependency Injection?",
"options": [
"To manage memory",
"To handle UI events",
"To provide dependencies to classes",
"To create layouts"
],
"correctAnswer": "To provide dependencies to classes",
"explanation": "Dependency Injection is a design pattern where dependencies are provided to a class instead of being created inside it, promoting loose coupling and easier testing.",
"category": "Programming"
},
{
"id": 10,
"question": "What is the difference between val and var in Kotlin?",
"options": [
"No difference",
"val is immutable, var is mutable",
"val is slower, var is faster",
"val is for numbers, var is for strings"
],
"correctAnswer": "val is immutable, var is mutable",
"explanation": "In Kotlin, val declares an immutable variable that can't be reassigned after initialization, while var declares a mutable variable that can be reassigned.",
"category": "Kotlin"
},
{
"id": 11,
"question": "What is the difference between val and var in Kotlin?",
"options": [
"No difference",
"val is immutable, var is mutable",
"val is slower, var is faster",
"val is for numbers, var is for strings"
],
"correctAnswer": "val is immutable, var is mutable",
"explanation": "In Kotlin, val declares an immutable variable that can't be reassigned after initialization, while var declares a mutable variable that can be reassigned.",
"category": "Kotlin"
},
{
"id": 12,
"question": "What is the difference between val and var in Kotlin?",
"options": [
"No difference",
"val is immutable, var is mutable",
"val is slower, var is faster",
"val is for numbers, var is for strings"
],
"correctAnswer": "val is immutable, var is mutable",
"explanation": "In Kotlin, val declares an immutable variable that can't be reassigned after initialization, while var declares a mutable variable that can be reassigned.",
"category": "Kotlin"
},
{
"id": 13,
"question": "What is the difference between val and var in Kotlin?",
"options": [
"No difference",
"val is immutable, var is mutable",
"val is slower, var is faster",
"val is for numbers, var is for strings"
],
"correctAnswer": "val is immutable, var is mutable",
"explanation": "In Kotlin, val declares an immutable variable that can't be reassigned after initialization, while var declares a mutable variable that can be reassigned.",
"category": "Kotlin"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment