Top 30 Mobile Dev Concepts Quiz
30 multiple-choice questions on the Mobile Dev fundamentals, drawn from 30 bites in the Mobile Dev library. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.
Mobile app development across platforms
30 questions. Pick an answer, or open “Show the answer” to read it.
Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.
Question 1 of 30
A developer needs to store a user's current score in a game, which will change throughout gameplay. Which Kotlin keyword should be used?
Show the answer
Answer: c · var
The card states that 'var' should be used for values that need to be reassigned, such as a user's score, while 'val' is for values that remain constant after initial assignment. Choosing 'val' here would lead to a compilation error when trying to update the score.
Read the full bite: Kotlin Variables: `val` for Constants, `var` for Variables
Question 2 of 30
For displaying long, scrolling lists of data in React Native, which component is recommended for optimal performance?
Show the answer
Answer: d · FlatList, because it efficiently renders only the items currently visible on screen.
FlatList is the recommended component for long lists because it optimizes performance by only rendering items currently visible on screen. ScrollView, while providing scrolling, renders all its children at once, which can lead to performance issues with extensive content.
Read the full bite: React Native Core Components: Your UI Building Blocks
Question 3 of 30
A Swift function tries to compile the line let total = 0 followed later in the same function by total = total + 10. What happens?
Show the answer
Answer: c · It fails to compile, because let creates a constant that can only be assigned once, and the second line attempts a second assignment
let enforces single assignment for any type, value or reference, and the compiler catches a second assignment as an error before the program ever runs. Option A is wrong because the let versus var distinction is unrelated to value versus reference semantics, and option C is wrong because Swift never silently ignores a reassignment, it is a hard compile error.
Question 4 of 30
Which keyword is best for a variable initialized at runtime from an API call, never to change?
Show the answer
Answer: a · final
The 'final' keyword is used for variables whose values are determined at runtime and assigned once, making them immutable thereafter. 'const' is incorrect because it requires the value to be known at compile-time, which is not the case for an API response.
Question 5 of 30
What is the main consequence of using the not-null assertion operator (!!) in Kotlin?
Show the answer
Answer: b · It tells the compiler to trust that a value is not null, potentially leading to a runtime NullPointerException if it is.
The not-null assertion operator (!!) bypasses Kotlin's compile-time null safety, forcing the compiler to assume a value is non-null. If the value turns out to be null at runtime, it will result in a NullPointerException, defeating the purpose of Kotlin's null safety. Option A is incorrect because it introduces risk, and options C and D describe the Elvis operator (?:) and safe call operator (?.), respectively.
Read the full bite: Kotlin Null Safety: Catch Nulls at Compile Time
Question 6 of 30
What is the main benefit of using control flow statements like if and for in Swift?
Show the answer
Answer: c · They allow a program to make decisions and repeat specific actions.
Control flow statements are essential because they enable programs to make decisions based on conditions and to repeat blocks of code, moving beyond a simple linear execution. While they can help structure logic to avoid errors, their primary role isn't automatic error fixing or direct speed optimization.
Read the full bite: Swift Control Flow: Directing Your Code's Path
Question 7 of 30
Which of the following is a key benefit of using StyleSheet.create() for styling in React Native?
Show the answer
Answer: c · It optimizes performance by processing style objects once and referencing them efficiently on the native side.
The card explicitly states that StyleSheet.create() processes style objects once and sends them to the native side, which is much faster than re-serializing raw JavaScript style objects on every render. Its primary use is for static styling, not dynamic changes, although it can be combined with dynamic styles.
Question 8 of 30
What is a direct consequence of Dart's principle that "everything is an object"?
Show the answer
Answer: c · Even basic data types like integers and strings have callable methods.
The core idea is that even simple types like int and String are objects, meaning they come with built-in methods and properties, unlike primitive types in other languages. Dart does not have primitive types that need conversion; all values are objects from the start, and 'null' itself is an object of type 'Null'.
Read the full bite: Dart's Core Data Types: Everything is an Object
Question 9 of 30
What is a mandatory requirement when using an `if` expression to assign a value to a variable in Kotlin?
Show the answer
Answer: b · An `else` branch must always be present to cover all possible outcomes.
When `if` is used as an expression, it must always return a value. To guarantee this, the compiler requires an `else` branch to cover all possible cases. The last line of a branch implicitly becomes its return value, without needing an explicit `return` keyword.
Read the full bite: Kotlin's Control Flow Expressions: `if` and `when`
Question 10 of 30
What is the fundamental mechanism by which Swift Optionals prevent runtime crashes from missing values?
Show the answer
Answer: d · They require explicit checks for nil values at compile time, making absence part of the type.
The card states Optionals make "the potential absence of a value an explicit part of its type system, forcing developers to handle the 'nil' case at compile time." This explicit handling prevents runtime crashes by ensuring nil is addressed before code execution. Force-unwrapping (option C) is explicitly mentioned as an anti-pattern that causes crashes if the value is nil, not prevents them.
Read the full bite: Swift Optionals: Handling Nothing Safely
Question 11 of 30
What is the primary reason for using control flow statements in a program?
Show the answer
Answer: a · To allow the program to make decisions and repeat actions based on conditions.
The card explains that control flow allows programs to "react to different inputs, repeat tasks, and handle problems," which directly translates to making decisions and repeating actions. Defining reusable code blocks (functions) is a separate concept, even though functions often contain control flow.
Read the full bite: Dart's Control Flow: Telling Your Code What to Do Next
Question 12 of 30
To perfectly center a child component both horizontally and vertically within its parent using Flexbox, which properties should be applied to the parent container?
Show the answer
Answer: c · flex: 1, justifyContent: 'center', alignItems: 'center'
Option C is correct because 'flex: 1' makes the parent fill available space, 'justifyContent: 'center'' centers children along the primary axis (vertical by default), and 'alignItems: 'center'' centers them along the cross axis (horizontal by default). Option B is incorrect because setting 'flexDirection: 'row'' would change the primary axis, altering how 'justifyContent' and 'alignItems' center the content relative axes.
Read the full bite: Flexbox: Responsive Layouts in React Native
Question 13 of 30
What is the main purpose of using functions in Kotlin?
Show the answer
Answer: d · To package reusable logic, preventing code duplication and enhancing structure.
The card states functions exist "to solve the problem of code repetition and disorganization" by packaging logic into "a single, named block that can be called from anywhere." Option C is incorrect because while good code structure can aid optimization, functions' primary role isn't automatic speed enhancement.
Read the full bite: Kotlin Functions: Named, Reusable Code Blocks
Question 14 of 30
What is the primary characteristic that makes Dart's arrow function syntax (=>) suitable for a function?
Show the answer
Answer: a · It implicitly returns the result of a single, concise expression.
Arrow syntax is designed for functions that compute and return the result of a single expression, implicitly handling the return. Options A and B describe scenarios where a block body function is required, while option D incorrectly states that arrow syntax requires an explicit return keyword.
Read the full bite: Dart Function Syntax: Block Body vs. Arrow Notation
Question 15 of 30
Which statement accurately describes Metro's primary role in a React Native project?
Show the answer
Answer: c · It compiles multiple JavaScript source files into a single, optimized bundle for execution.
Metro's core function is to act as a "specialized compiler" that takes numerous JavaScript files, resolves dependencies, transforms code, and combines them into a single, optimized bundle for efficient loading on devices. Option B describes a package manager, C describes native build tools, and D describes the React Native framework itself.
Read the full bite: Metro: The JavaScript Bundler for React Native
Question 16 of 30
When should a developer generally prefer using a Swift struct over a class for a new data type?
Show the answer
Answer: b · When the data is simple, self-contained, and changes to a copy should not affect the original.
Structs are value types, meaning they are copied on assignment, and changes to the copy do not affect the original. This makes them suitable for simple, self-contained data where independent copies are desired. Classes are used for shared identity and inheritance, and are managed by ARC.
Read the full bite: Swift Structs vs. Classes: Value vs. Reference Types
Question 17 of 30
You add a new case to a widely-used enum. When does this silently undermine compile-time safety?
Show the answer
Answer: b · When switches over the enum include a default clause
A default clause catches the new case automatically, so the compiler cannot force you to handle it explicitly. Omitting a default clause produces a build error for unhandled cases, which preserves compile-time safety.
Question 18 of 30
What is the primary reason Kotlin classes are final by default?
Show the answer
Answer: a · To encourage explicit design for inheritance and promote composition over inheritance.
The card states that Kotlin's design makes inheritance an intentional act to encourage more robust code and promotes composition over inheritance. Option A directly captures these core reasons. Option C is incorrect as 'final by default' relates to inheritance, not the mutability of properties, which is controlled by 'val' and 'var'.
Read the full bite: Kotlin Inheritance: Open for Extension, Closed by Default
Question 19 of 30
You need to store a collection of unique product SKUs that are currently in stock and frequently check if a particular SKU is available. Which Dart collection is the most efficient choice for this task?
Show the answer
Answer: a · Set, because it guarantees uniqueness and optimizes for fast existence checks.
Set is specifically designed for storing unique items and provides highly efficient checks for an item's existence, making it ideal for this scenario. While a Map can also provide fast lookups, a Set is the most direct and efficient choice when only uniqueness and existence checking are required, without needing to associate a value.
Read the full bite: Dart Collections: Choosing List, Set, or Map
Question 20 of 30
For which scenario is using platform-specific file extensions (e.g., MyComponent.ios.js) the most appropriate solution?
Show the answer
Answer: d · Implementing a component with fundamentally different structure and behavior on iOS and Android.
Platform-specific file extensions are recommended when a component's structure, behavior, or dependencies are fundamentally different between platforms. Options A, C, and D describe small, inline differences that are best handled with the Platform module's select method or OS checks, as using separate files for these would be overkill.
Question 21 of 30
Which statement accurately describes the behavior of the copy() method generated for a Kotlin data class?
Show the answer
Answer: d · It performs a shallow copy, meaning references to mutable objects within the data class are shared between the original and the new instance.
The card explicitly states that the copy() function creates a shallow copy. This means if a data class contains a mutable object, both the original and the copied instance will refer to the same mutable object. Option A is a common misconception, as many expect a copy function to perform a deep copy for safety.
Read the full bite: Kotlin Data Classes: Automatic Boilerplate for Data Holders
Question 22 of 30
What is the fundamental mechanism by which Hermes improves React Native app startup performance?
Show the answer
Answer: d · It performs Ahead-Of-Time (AOT) compilation of JavaScript into optimized bytecode during the app's build phase.
Hermes is an Ahead-Of-Time (AOT) focused engine that pre-compiles JavaScript into optimized bytecode during the build process, reducing the work the device has to do at startup. While it contributes to a smaller app size, its primary mechanism for faster startup is not tree-shaking or JIT compilation.
Read the full bite: Hermes: The JS Engine for Faster React Native Apps
Question 23 of 30
Which scenario best justifies using Swift's explicit error handling system (with "throws" and "do-catch")?
Show the answer
Answer: d · For operations that can fail in various ways, requiring the caller to understand the specific type of failure to recover.
The card states Swift's error handling is for "recoverable errors where the caller needs context about what went wrong." Option D directly reflects this, emphasizing the need for specific failure context. Option A is incorrect because the card advises using optionals for simple binary success/failure without extra context.
Read the full bite: Swift Error Handling: Throwing, Catching, and Propagating
Question 24 of 30
How does Dart's sound null safety fundamentally alter variable nullability?
Show the answer
Answer: b · Variables are non-nullable by default, requiring explicit opt-in for nullability.
Dart's sound null safety makes variables non-nullable by default, meaning they are guaranteed to hold a value. To allow a variable to be null, developers must explicitly opt-in by adding a '?' to its type. Option D describes the opposite behavior, which is common in many other languages but not Dart with null safety.
Read the full bite: Dart's Sound Null Safety: No More Null Errors
Question 25 of 30
In performance-critical Swift code, why is 'some Protocol' generally preferred over 'any Protocol'?
Show the answer
Answer: b · It guarantees a specific, consistent concrete type at compile time, enabling static dispatch and avoiding existential container overhead.
The card states that 'any Protocol' incurs performance costs due to dynamic dispatch and potential heap allocation for its existential container. 'some Protocol' avoids this by promising a specific concrete type at compile time, allowing for static dispatch and better performance. Option C is incorrect because protocols do not define stored properties; that is a feature of concrete types or class hierarchies.
Read the full bite: Protocols: Swift's Blueprint for Behavior
Question 26 of 30
Which fundamental design aspect of the React Native Bridge is primarily responsible for its performance limitations and visible UI jank?
Show the answer
Answer: b · Its asynchronous message passing mechanism between the JavaScript and native threads.
The card explicitly states that the Bridge's asynchronous nature and the inherent delays it causes are the source of its main limitations, leading to UI jank and preventing synchronous UI layout access. While JSON serialization adds overhead, the core problem causing delays and visual 'jumps' is the asynchronous communication.
Read the full bite: The React Native Bridge: Why It's Being Replaced
Question 27 of 30
Under which circumstance is it generally recommended to reconsider using a chain of standard Kotlin collection operations (like filter followed by map) and opt for an alternative?
Show the answer
Answer: b · When the collection is extremely large, and creating intermediate lists would be inefficient.
Standard chained collection operations create new intermediate lists for each step, which can be very inefficient for large collections. In such cases, using 'asSequence()' or a traditional loop is preferred to avoid this overhead. Option C is incorrect because aggregation can also be achieved using functional operations like 'reduce' or 'fold'.
Read the full bite: Kotlin Collections: Think Transformations, Not Loops
Question 28 of 30
When is it most appropriate to use Expo Application Services (EAS)?
Show the answer
Answer: d · When preparing a production-ready build for app store submission or pushing over-the-air updates.
EAS is designed for production workflows, handling cloud builds, app store submissions, and over-the-air updates for React Native apps. It is explicitly stated as distinct from local development tools like the `expo` CLI, which are used for prototyping and running local development servers.
Read the full bite: Expo Application Services (EAS): The Cloud Toolchain for React Native
Question 29 of 30
What is the primary issue that "weak" or "unowned" references are designed to resolve in Swift's ARC?
Show the answer
Answer: b · Preventing memory leaks caused by two class instances holding strong references to each other.
The card states that `weak` or `unowned` references are used "To break these cycles" which occur "when two class instances hold strong references to each other, preventing either from ever being deallocated," leading to memory leaks. While `weak`/`unowned` help with deallocation, their primary role is to resolve the specific problem of strong reference cycles, not general unreachability.
Read the full bite: Automatic Reference Counting (ARC): Swift's Memory Manager
Question 30 of 30
Which statement accurately describes how Kotlin extension functions fundamentally add functionality to a class?
Show the answer
Answer: a · The compiler transforms calls to them into static utility method invocations, passing the receiver object as an argument.
Kotlin extension functions are syntactic sugar; the compiler rewrites calls to them as static utility method calls, passing the receiver instance as an argument. They do not modify the original class's bytecode, create new classes, or use reflection to add methods dynamically.
Read the full bite: Kotlin Extension Functions: Add Methods Without Inheritance
Could you explain these out loud?
That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.