Skip to content

Instantly share code, notes, and snippets.

@tusharhow
Last active February 1, 2025 11:40
Show Gist options
  • Select an option

  • Save tusharhow/0501c33752878cdb1ea76def2d9bb68e to your computer and use it in GitHub Desktop.

Select an option

Save tusharhow/0501c33752878cdb1ea76def2d9bb68e to your computer and use it in GitHub Desktop.

Revisions

  1. tusharhow revised this gist Feb 1, 2025. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -155,6 +155,19 @@
    "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"
    }
    ]
    }
  2. tusharhow revised this gist Feb 1, 2025. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -142,6 +142,19 @@
    "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"
    }
    ]
    }
  3. tusharhow revised this gist Feb 1, 2025. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -129,6 +129,19 @@
    "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"
    }
    ]
    }
  4. tusharhow revised this gist Feb 1, 2025. 1 changed file with 0 additions and 13 deletions.
    13 changes: 0 additions & 13 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -129,19 +129,6 @@
    "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 sfsfsfsfsfssffsfs 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": "immutable"
    }
    ]
    }
  5. tusharhow revised this gist Feb 1, 2025. 1 changed file with 0 additions and 13 deletions.
    13 changes: 0 additions & 13 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -142,19 +142,6 @@
    "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": "immutable"
    },
    {
    "id": 12,
    "question": "What is sfsfsfsfsfssffsfs 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": "immutable"
    }
    ]
    }
  6. tusharhow revised this gist Feb 1, 2025. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -142,6 +142,19 @@
    "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": "immutable"
    },
    {
    "id": 12,
    "question": "What is sfsfsfsfsfssffsfs 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": "immutable"
    }
    ]
    }
  7. tusharhow revised this gist Feb 1, 2025. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -132,7 +132,7 @@
    },
    {
    "id": 11,
    "question": "What is the difference between val and var in Kotlin?",
    "question": "What is sfsfsfsfsfssffsfs difference between val and var in Kotlin?",
    "options": [
    "No difference",
    "val is immutable, var is mutable",
    @@ -141,7 +141,7 @@
    ],
    "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"
    "category": "immutable"
    }
    ]
    }
  8. tusharhow revised this gist Feb 1, 2025. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -129,6 +129,19 @@
    "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"
    }
    ]
    }
  9. tusharhow created this gist Feb 1, 2025.
    134 changes: 134 additions & 0 deletions quizes
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,134 @@
    {
    "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"
    }
    ]
    }