NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content

Quiz: iOS

iOS questions from real interviews as a quiz, with an explanation for every option.

39 questionsAll topicsiOS

Try it: 5 questions

Loading…

Sample questions

  1. What is applicationWillResignActive typically used for in the iOS app lifecycle?

    • Pause tasks that should not run while the app is inactive.
    • Resume the app after it returns from the background.
    • Launch the app the first time a user opens it.
    • Clean up resources immediately before the app terminates.
    Full answer
  2. What distinguishes a unidirectional data flow from a bidirectional one?

    • A unidirectional flow uses only synchronous calls, while a bidirectional flow uses asynchronous ones.
    • A unidirectional flow is possible only in Redux, while a bidirectional flow is possible only in MVC.
    • In a unidirectional flow, data moves one way; in a bidirectional flow, changes can travel back as well.
    • In a unidirectional flow, only the view is updated, while in a bidirectional flow, only the model is updated.
    Full answer
  3. What is reflection in programming, and what is it used for in Swift?

    • Checking types only at compile time to prevent dynamic access to data.
    • Automatically converting any object to JSON without inspecting its properties.
    • The ability to inspect types and object data at runtime, for example with Mirror.
    • Changing an app’s source code during the build based on object values.
    Full answer
  4. Which statements about data flow and state management in SwiftUI are correct? Select all that apply.

    • @EnvironmentObject makes an observable object available through a View hierarchy without passing it through every parameter.
    • @State stores a View's local state, while @Binding lets a child View change the state it is connected to.
    • @Binding creates an independent copy of state, so changes in a child View do not affect the parent View.
    • @StateObject typically creates and stores an ObservableObject in a View, while @ObservedObject observes an object passed to it.
    • @ObservedObject creates and stores an observable object, while @StateObject only receives one from a parent.
    Full answer
  5. Which Core Data classes directly describe the structure of a data model? Choose three.

    • NSManagedObject
    • NSEntityDescription
    • NSManagedObjectContext
    • NSAttributeDescription
    • NSManagedObjectModel
    Full answer
  6. What is a URL primarily used for on the internet?

    • A protocol that encrypts data sent between a client and a server
    • An address a client can use to locate and request a resource
    • A data format a browser uses to render a page
    • An identifier that guarantees a file is unique on every device
    Full answer
  7. How do AVFoundation and user input handling differ in iOS?

    • AVFoundation handles taps and key presses, while input handling is responsible for media playback and recording.
    • Both APIs are for handling audio and video, but AVFoundation is used only for recording.
    • AVFoundation manages the app interface, while input handling provides access to the camera and microphone.
    • AVFoundation works with audio and video, while input handling deals with user events such as taps and key presses.
    Full answer
  8. Which practices help avoid strong reference cycles in Swift when using ARC? Select three.

    • Capture self as [weak self] when a closure is stored by the object.
    • Use strong references in both directions so neither object is deallocated.
    • Use unowned if the object is guaranteed to remain alive while the reference is used.
    • Declare a delegate reference as weak if it could complete a cycle.
    • Capture self in a stored closure without a capture list.
    Full answer
  9. How does a Capacity Array typically manage memory when elements exceed its current capacity?

    • It reserves exactly as much memory as the array will ever need in advance.
    • It allocates a larger array and copies the elements; growing capacity reduces how often this happens.
    • It stores each new element in a separate memory location, so existing elements never need to be copied.
    • When full, it removes some older elements to make room in the same array.
    Full answer
  10. What does git cherry-pick <commit> do in the current branch?

    • Applies the selected commit’s changes and creates a new commit
    • Moves the selected commit from one branch to another
    • Creates a branch pointing to the selected commit
    • Merges every commit from another branch into the current one
    Full answer