[{"id":"LIFE-001","type":"short","category":"app-lifecycle","difficulty":1,"topic":"App states and transitions","tags":["app-state","lifecycle","background","suspended","inactive"],"question":"A user is working in your app, takes a phone call, hangs up, goes out to the home screen, and comes back 30 minutes later. Which states does the app pass through along the way?","source":{"kind":"community"}},{"id":"LIFE-002","type":"mcq","category":"app-lifecycle","difficulty":1,"topic":"The Inactive state","tags":["app-state","inactive","lifecycle"],"question":"Which situations put an app in the **Inactive** state? Pick **all** that apply.","source":{"kind":"community"}},{"id":"LIFE-003","type":"short","category":"app-lifecycle","difficulty":1,"topic":"What AppDelegate does","tags":["appdelegate","uiapplicationdelegate","launch","lifecycle"],"question":"What kind of object is `AppDelegate`, and which events does it handle?","source":{"kind":"community"}},{"id":"LIFE-004","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Why SceneDelegate exists","tags":["scenedelegate","uiscene","multi-window","ipad","lifecycle"],"question":"A request comes in to open the same app in two windows on iPad. Why was `SceneDelegate` introduced?","source":{"kind":"community"}},{"id":"LIFE-005","type":"mcq","category":"app-lifecycle","difficulty":2,"topic":"Callbacks in a scene-based app","tags":["scenedelegate","appdelegate","lifecycle","callback"],"question":"In an iOS 13+ scene-based UIKit app (one that uses SceneDelegate), which callback runs when the app comes back from the background to the foreground?","source":{"kind":"community"}},{"id":"LIFE-006","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Background execution limits","tags":["background","beginbackgroundtask","suspended","background-modes"],"question":"You get a report that a save to the server never lands when the user taps save and goes straight out to the home screen. How would you fix it?","source":{"kind":"community"}},{"id":"LIFE-007","type":"mcq","category":"app-lifecycle","difficulty":1,"topic":"App entry point and UIApplicationMain","tags":["main","uiapplicationmain","launch","runloop"],"question":"Which of these does the AppDelegate marked `@main` (or the `UIApplicationMain` call) do at launch? Pick **all** that apply.","source":{"kind":"community"}},{"id":"LIFE-008","type":"short","category":"app-lifecycle","difficulty":2,"topic":"App bundle and App Thinning","tags":["app-bundle","app-thinning","slicing","on-demand-resources","app-size"],"question":"The download size shown on the App Store is far smaller than your Xcode archive. How does App Thinning cut the size down?","source":{"kind":"community"}},{"id":"LIFE-009","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Push notification flow","tags":["push-notification","apns","device-token","fcm","unusernotificationcenter"],"question":"Can you walk me through the whole path a single remote push takes to reach a user's device? Cover it from the app, APNs, and server sides.","source":{"kind":"community"}},{"id":"LIFE-010","type":"mcq","category":"app-lifecycle","difficulty":2,"topic":"Foreground notification presentation","tags":["local-notification","unusernotificationcenter","willpresent"],"question":"How do you make a local or remote notification banner show on screen while the app is in the foreground?","source":{"kind":"community"}},{"id":"LIFE-011","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Deep links and Universal Links","tags":["deep-link","universal-link","url-scheme","associated-domains","aasa"],"question":"Marketing is texting out product links and wants users with the app to land in the app and everyone else to land on the web. How would you set that up?","source":{"kind":"community"}},{"id":"LIFE-012","type":"mcq","category":"app-lifecycle","difficulty":3,"topic":"How Universal Links work","tags":["universal-link","aasa","associated-domains"],"question":"Which statements about Universal Links are correct? Pick **all** that apply.","source":{"kind":"original"}},{"id":"LIFE-013","type":"short","category":"app-lifecycle","difficulty":3,"topic":"Sandbox and sharing data between apps","tags":["sandbox","app-group","keychain-sharing","extension","pasteboard"],"question":"Your main app, a widget, and a Share Extension all have to use the same login session and cache database. How would you share data between apps and extensions on the same team?","source":{"kind":"community"}},{"id":"LIFE-014","type":"short","category":"app-lifecycle","difficulty":3,"topic":"WidgetKit timelines and App Intents","tags":["widgetkit","timeline","app-intents","shortcuts","siri"],"question":"You're getting complaints that the home screen widget doesn't change in real time. How does WidgetKit handle refreshes?","source":{"kind":"community"},"since":"iOS 16"},{"id":"LIFE-015","type":"mcq","category":"app-lifecycle","difficulty":1,"topic":"Limits of the Simulator","tags":["simulator","device-testing","xcode"],"question":"Which of these **can't be done, or can't be trusted**, in the iOS Simulator? Pick **all** that apply.","source":{"kind":"community"}},{"id":"LIFE-016","type":"short","category":"app-lifecycle","difficulty":3,"topic":"BGTaskScheduler","tags":["bgtaskscheduler","bgapprefreshtask","bgprocessingtask","background"],"question":"A requirement comes in: \"every night while the user sleeps, clear the cache and prefetch new content.\" How would you register recurring work like that on iOS?","source":{"kind":"original"},"since":"iOS 13"},{"id":"LIFE-017","type":"mcq","category":"app-lifecycle","difficulty":3,"topic":"How BGAppRefreshTask behaves","tags":["bgtaskscheduler","bgapprefreshtask","background"],"question":"Which statements about `BGAppRefreshTask` are correct? Pick **all** that apply.","source":{"kind":"original"},"since":"iOS 13"},{"id":"LIFE-018","type":"short","category":"app-lifecycle","difficulty":4,"topic":"Reliability of silent push","tags":["silent-push","content-available","background","apns","throttling"],"question":"A chat app is built to wake up on a silent push (content-available) for each new message and sync ahead of time, but the data says more than half never arrive or arrive late. Why is that happening?","source":{"kind":"original"}},{"id":"LIFE-019","type":"mcq","category":"app-lifecycle","difficulty":2,"topic":"Notification authorization options","tags":["notification-permission","provisional","requestauthorization"],"question":"Which option do you request when you want notifications delivered silently into Notification Center, with no permission prompt, so the user can decide later whether to keep getting them?","source":{"kind":"original"}},{"id":"LIFE-020","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Low Power Mode and thermal state","tags":["low-power-mode","thermal-state","processinfo","battery","energy"],"question":"How can an app find out that the user turned on Low Power Mode or that the device has gotten hot?","source":{"kind":"original"},"since":"iOS 11"},{"id":"LIFE-021","type":"short","category":"app-lifecycle","difficulty":3,"topic":"Designing permission requests","tags":["permissions","privacy","info-plist","att","camera","location"],"question":"The numbers say 60% of users refuse the camera permission. How would you design for a lower refusal rate while staying inside the review guidelines?","source":{"kind":"original"}},{"id":"LIFE-022","type":"short","category":"app-lifecycle","difficulty":4,"topic":"Termination and state restoration","tags":["termination","state-restoration","nsuseractivity","prewarming","snapshot"],"question":"Users complain that when they're writing a long post and step out to another app, what they were writing sometimes disappears. Why does that happen?","source":{"kind":"original"},"since":"iOS 15"},{"id":"LIFE-023","type":"short","category":"app-lifecycle","difficulty":4,"topic":"App Extension limits","tags":["app-extension","share-extension","memory-limit","process","app-group"],"question":"A Share Extension that takes a large photo and uploads it to the server dies silently now and then. What's different about an App Extension from the main app that would cause that?","source":{"kind":"original"}},{"id":"LIFE-024","type":"mcq","category":"app-lifecycle","difficulty":4,"topic":"Notification Service Extension","tags":["notification-service-extension","mutable-content","push","e2ee"],"question":"Which statements about a Notification Service Extension (NSE) are correct? Pick **all** that apply.","source":{"kind":"original"},"since":"iOS 10"},{"id":"LIFE-025","type":"short","category":"app-lifecycle","difficulty":3,"topic":"Launch options and cold start routing","tags":["launch-options","connectionoptions","deep-link","push-tap","cold-start"],"question":"Tapping a push while the app is closed should take the user to that chat room, but sometimes it stops on the home screen or the room appears behind the login screen. How would you design routing for a cold start?","source":{"kind":"original"}},{"id":"LIFE-026","type":"mcq","category":"app-lifecycle","difficulty":2,"topic":"UIBackgroundModes","tags":["background-modes","remote-notification","info-plist","silent-push"],"question":"What do you need in `UIBackgroundModes` in Info.plist for a silent push (`content-available: 1`) to wake the app in the background and fetch data?","source":{"kind":"original"}},{"id":"LIFE-027","type":"mcq","category":"app-lifecycle","difficulty":2,"topic":"The Background to Suspended transition","tags":["app-state","suspended","background-task","termination"],"question":"Which statements about the moment an app moves from Background to Suspended are correct? Pick **all** that apply.","source":{"kind":"company","company":"Samsung"}},{"id":"LIFE-028","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Permission screen and authorization status","tags":["push-notification","permission","unusernotificationcenter","delegate","view-lifecycle"],"question":"For a manager round assignment you built \"a screen that explains our notification permission before the system prompt\", and now you're taking questions on it. What should the app do for each authorization status (`notDetermined`, `denied`, `authorized`, `provisional`)?","source":{"kind":"company","company":"Swiggy"},"since":"iOS 15.4"},{"id":"LIFE-029","type":"mcq","category":"app-lifecycle","difficulty":2,"topic":"Handling the APNs device token","tags":["push-notification","apns","device-token","registerforremotenotifications"],"question":"Which statements about handling the device token in the remote push flow are correct? Pick **all** that apply.","source":{"kind":"company","company":"PhonePe"}},{"id":"LIFE-030","type":"short","category":"app-lifecycle","difficulty":2,"topic":"NotificationCenter threads and observers","tags":["notificationcenter","objective-c","threading","observer","memory"],"question":"If you call `NotificationCenter.default.post` on a background thread, which thread does the observer code run on?","source":{"kind":"company","company":"ByteDance"},"since":"iOS 15"},{"id":"LIFE-031","type":"short","category":"app-lifecycle","difficulty":2,"topic":"App launch sequence","tags":["app-launch","dyld","objective-c","pre-main","uiapplicationmain","launch-time"],"question":"From the moment the app icon is tapped on the home screen until the first screen is drawn, what happens in order in the system and in the app, including the stages before main()?","source":{"kind":"company","company":"Alibaba"}},{"id":"LIFE-032","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Process states vs app states","tags":["app-state","process","suspended","jetsam","memory-pressure"],"question":"How do the process states from an OS class (new, ready, running, waiting, terminated) map onto the iOS app states (Not Running, Inactive, Active, Background, Suspended)? Explain Suspended from the process point of view in particular.","source":{"kind":"company","company":"Shopee"},"since":"iOS 14"},{"id":"LIFE-033","type":"mcq","category":"app-lifecycle","difficulty":2,"topic":"APNs priority and headers","tags":["push-notification","apns","priority","apns-push-type","collapse-id"],"question":"The server team asks how to set the QoS (priority) on the notifications they send through APNs. Pick **all** the correct statements.","source":{"kind":"community","company":"Wipro"}},{"id":"LIFE-034","type":"short","category":"app-lifecycle","difficulty":3,"topic":"Native bridge for WKWebView","tags":["wkwebview","javascript-bridge","deep-link","wkscriptmessagehandler","security"],"question":"Most of the service is built in `WKWebView`, and you have to maintain the bridge the web side uses to call native features like biometrics and the camera. Which APIs do you build the bridge with?","source":{"kind":"community","company":"뱅크샐러드"},"since":"iOS 14"},{"id":"LIFE-035","type":"short","category":"app-lifecycle","difficulty":4,"topic":"Background BLE and digital car keys","tags":["core-bluetooth","background-mode","state-restoration","uwb","digital-key"],"question":"You're building a digital car key app. When the user walks up to the car with the phone in a pocket (the app in the background), it has to unlock over BLE. What configuration and design does BLE communication from the background need on iOS?","source":{"kind":"community","company":"42dot"},"since":"iOS 14"},{"id":"LIFE-036","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Leaving to the home screen","tags":["app-state","snapshot","privacy","background","scene-delegate"],"question":"When the user goes out to the home screen (with the home button or a swipe), what happens in order in the system and in the app?","source":{"kind":"company","company":"Tencent"}},{"id":"LIFE-037","type":"mcq","category":"app-lifecycle","difficulty":1,"topic":"Scene callback order on leaving and returning","tags":["app-state","scene-delegate","lifecycle-callbacks"],"question":"In a scene-based (SceneDelegate) UIKit app, the user goes out to the home screen and comes back 30 seconds later, with the app never terminated. Which list puts the callbacks in the right order?","source":{"kind":"company","company":"Samsung"}},{"id":"LIFE-038","type":"short","category":"app-lifecycle","difficulty":1,"topic":"View controller appearance lifecycle","tags":["uikit","view-lifecycle","viewdidload","observer"],"question":"In a UIKit screen, which pair of lifecycle methods would you add and remove a subscription in, like a NotificationCenter observer you only need while the screen is visible?","source":{"kind":"community","company":"Barclays"}},{"id":"LIFE-039","type":"short","category":"app-lifecycle","difficulty":1,"topic":"Scene-based app lifecycle","tags":["scene","app-lifecycle","appdelegate","swiftui"],"question":"In a scene-based iOS app, where would you put work like registering the push token, and where would you put work like saving screen state: AppDelegate or SceneDelegate?","source":{"kind":"community","company":"Photon Interactive"},"since":"iOS 13"},{"id":"LIFE-040","type":"short","category":"app-lifecycle","difficulty":3,"topic":"State restoration across devices","tags":["state-restoration","carplay","scene","multidevice"],"question":"You support the same music playback screen on iPhone, iPad, and CarPlay. When the app has been terminated and a scene reconnects, what would you restore the playing state from?","source":{"kind":"community","company":"드림어스컴퍼니"}},{"id":"LIFE-041","type":"short","category":"app-lifecycle","difficulty":2,"topic":"Hiding sensitive screens on background","tags":["lifecycle","privacy","background","authentication"],"question":"A lending app has to keep account information out of the app switcher snapshot when it goes to the background. Which lifecycle callback do you put the cover screen up in?","source":{"kind":"community","company":"피에프씨테크놀로지스"}},{"id":"ARCH-001","type":"short","category":"architecture","difficulty":1,"topic":"Cocoa MVC","tags":["mvc","cocoa-mvc","massive-view-controller","uikit"],"question":"How does Cocoa MVC in UIKit differ from the textbook MVC?","source":{"kind":"community"}},{"id":"ARCH-002","type":"mcq","category":"architecture","difficulty":1,"topic":"Placing MVC roles","tags":["mvc","responsibility","layering"],"question":"In an MVC iOS app, where's the best place for the code that turns a date string from the server into a display format for the user's locale?","source":{"kind":"community"}},{"id":"ARCH-003","type":"short","category":"architecture","difficulty":2,"topic":"MVC vs MVVM","tags":["mvc","mvvm","viewmodel","testability","binding"],"question":"Someone proposes moving an app that works fine on MVC over to MVVM. What's the fundamental difference between MVVM and MVC?","source":{"kind":"community"}},{"id":"ARCH-004","type":"mcq","category":"architecture","difficulty":2,"topic":"ViewModel boundaries","tags":["mvvm","viewmodel","responsibility","uikit"],"question":"In MVVM, which of these should a ViewModel **not** have? Select all that apply.","source":{"kind":"original"}},{"id":"ARCH-005","type":"short","category":"architecture","difficulty":2,"topic":"MVP, VIPER, MVI, RIBs","tags":["mvp","viper","mvi","ribs","comparison"],"question":"Besides MVVM, walk me through the architectures you know (MVP, VIPER, MVI, RIBs, and so on), one at a time, and tell me how they differ.","source":{"kind":"community"}},{"id":"ARCH-006","type":"short","category":"architecture","difficulty":3,"topic":"Coordinator pattern","tags":["coordinator","navigation","mvvm-c","routing","deep-link"],"question":"What problem is the Coordinator in MVVM-C meant to solve?","source":{"kind":"community"}},{"id":"ARCH-007","type":"mcq","category":"architecture","difficulty":3,"topic":"Coordinator memory","tags":["coordinator","memory","retain-cycle","weak","lifecycle"],"question":"In this Coordinator implementation, `LoginCoordinator` stays in memory after the login flow finishes. Which is the most likely cause?\n\n```swift\nfinal class AppCoordinator {\n    var children: [Coordinator] = []\n    func showLogin() {\n        let child = LoginCoordinator(nav: nav)\n        child.onFinish = { self.children.removeAll { $0 === child } }\n        children.append(child); child.start()\n    }\n}\n```","source":{"kind":"original"}},{"id":"ARCH-008","type":"short","category":"architecture","difficulty":2,"topic":"Dependency injection","tags":["dependency-injection","protocol","testing","composition-root"],"question":"Why do we do dependency injection in an iOS app?","source":{"kind":"community"}},{"id":"ARCH-009","type":"mcq","category":"architecture","difficulty":2,"topic":"Choosing DI style","tags":["dependency-injection","initializer","property","environment"],"question":"Which of these statements about dependency injection styles are correct? Select **all** that apply.","source":{"kind":"original"}},{"id":"ARCH-010","type":"short","category":"architecture","difficulty":1,"topic":"Singleton pattern","tags":["singleton","global-state","testing","thread-safety"],"question":"When do you use a singleton in an iOS app, and what's the problem with it?","source":{"kind":"community"}},{"id":"ARCH-011","type":"short","category":"architecture","difficulty":1,"topic":"Delegate pattern","tags":["delegate","notification","kvo","closure","communication"],"question":"Can you explain the Delegate pattern that shows up all over UIKit?","source":{"kind":"community"}},{"id":"ARCH-012","type":"mcq","category":"architecture","difficulty":1,"topic":"Choosing a communication style","tags":["delegate","notification","closure","design"],"question":"In which of these situations is **NotificationCenter** the best fit?","source":{"kind":"community"}},{"id":"ARCH-013","type":"short","category":"architecture","difficulty":2,"topic":"How KVO works","tags":["kvo","kvc","objective-c-runtime","isa-swizzling","observation"],"question":"How does KVO in the Objective-C runtime detect property changes under the hood?","source":{"kind":"community"}},{"id":"ARCH-014","type":"short","category":"architecture","difficulty":3,"topic":"Minimal NotificationCenter","tags":["pub-sub","observer","notification","coding","weak","thread-safety"],"question":"This is a live coding exercise. Without Foundation's NotificationCenter, design and implement a small EventBus in Swift that subscribes and publishes by name. Tell me how you handle lifetime and the unsubscribe API so no handler is left behind after an observer goes away.","source":{"kind":"community","company":"PayPal"}},{"id":"ARCH-015","type":"mcq","category":"architecture","difficulty":2,"topic":"NotificationCenter behavior","tags":["notification","notificationcenter","thread","observer"],"question":"Which of these statements about Foundation's `NotificationCenter` are correct? Select **all** that apply.","source":{"kind":"community"}},{"id":"ARCH-016","type":"short","category":"architecture","difficulty":2,"topic":"SOLID principles","tags":["solid","srp","ocp","lsp","isp","dip"],"question":"Can you explain the five SOLID principles with iOS code examples, not shapes and animals?","source":{"kind":"community"}},{"id":"ARCH-017","type":"mcq","category":"architecture","difficulty":2,"topic":"Identifying design patterns","tags":["design-pattern","observer","adapter","decorator","facade","factory"],"question":"Which of these correctly pair a situation with a design pattern? Select **all** that apply.","source":{"kind":"community"}},{"id":"ARCH-018","type":"short","category":"architecture","difficulty":3,"topic":"Legacy MVC to MVVM","tags":["migration","legacy","mvvm","refactoring","strangler"],"question":"You've been asked to move a 5-year-old MVC app (150 view controllers, almost no tests) to MVVM, and the service has to keep shipping. What's your strategy?","source":{"kind":"community"}},{"id":"ARCH-019","type":"short","category":"architecture","difficulty":3,"topic":"API client abstraction","tags":["protocol","generic","network-layer","endpoint","abstraction"],"question":"You have three network clients for the auth server, product server, and payment server that are similar but slightly different (different headers, encoding, error formats). How would you abstract them with protocols to remove the duplication?","source":{"kind":"community"}},{"id":"ARCH-020","type":"short","category":"architecture","difficulty":3,"topic":"Modularization strategy","tags":["modularization","spm","framework","build-time","boundary"],"question":"You want to split an app that grew into a single target into modules. What criteria do you use to draw module boundaries?","source":{"kind":"community","company":"Airbnb"}},{"id":"ARCH-021","type":"short","category":"architecture","difficulty":4,"topic":"Architecture by team size","tags":["scaling","team","modularization","code-ownership","ci","conflict"],"question":"As an iOS team grows from 5 to 10 to 100 people, how should the way you manage code conflicts, quality, and architecture change at each stage?","source":{"kind":"community"}},{"id":"ARCH-022","type":"mcq","category":"architecture","difficulty":3,"topic":"Module dependency direction","tags":["modularization","dependency","interface","circular"],"question":"The `SearchFeature` module needs to open `CheckoutFeature`'s payment screen from a search result. What's the correct way to do this without creating a circular dependency between the two Features?","source":{"kind":"original"}},{"id":"ARCH-023","type":"short","category":"architecture","difficulty":3,"topic":"Deciding on TCA","tags":["tca","composable-architecture","unidirectional","reducer","tradeoff"],"question":"Your team is evaluating TCA (The Composable Architecture). What problems does TCA solve?","source":{"kind":"original"},"since":"iOS 16"},{"id":"ARCH-024","type":"mcq","category":"architecture","difficulty":3,"topic":"TCA components","tags":["tca","reducer","effect","state","action"],"question":"In TCA, you're implementing \"tap a button, fetch a list over the network, show it on screen.\" Which description of a component's role is **wrong**?","source":{"kind":"original"},"since":"iOS 16"},{"id":"ARCH-025","type":"short","category":"architecture","difficulty":2,"topic":"Reactive programming","tags":["rxswift","combine","reactive","async-sequence","stream"],"question":"What problems does reactive programming, as in RxSwift or Combine, solve for you on iOS?","source":{"kind":"community"}},{"id":"ARCH-026","type":"short","category":"architecture","difficulty":4,"topic":"Large SwiftUI app structure","tags":["swiftui","large-scale","modularization","navigation","state","di"],"question":"If you were designing a SwiftUI app from scratch with dozens of screens and several teams working on it, how would you set up state management, navigation, dependency injection, and module boundaries?","source":{"kind":"community"},"since":"iOS 17"},{"id":"ARCH-027","type":"mcq","category":"architecture","difficulty":4,"topic":"Method swizzling","tags":["method-swizzling","objective-c-runtime","aop","risk"],"question":"Which of these statements about method swizzling are **correct**? Select all that apply.","source":{"kind":"community"}},{"id":"ARCH-028","type":"short","category":"architecture","difficulty":4,"topic":"Clean Architecture layers","tags":["clean-architecture","use-case","domain","boundary","responsibility","oop"],"question":"When you apply Clean Architecture on iOS, can you walk me through the layers and the dependency rule?","source":{"kind":"community"}},{"id":"ARCH-029","type":"short","category":"architecture","difficulty":2,"topic":"DI vs DIP","tags":["dependency-injection","dependency-inversion","solid","protocol","testability"],"question":"Dependency Injection and the Dependency Inversion Principle have similar names. What's the difference?","source":{"kind":"company","company":"Walmart"}},{"id":"ARCH-030","type":"mcq","category":"architecture","difficulty":2,"topic":"Unit testing with singletons","tags":["singleton","unit-test","testability","mock","dependency-injection"],"question":"In a codebase where a singleton like `AnalyticsManager.shared` is referenced directly all over, you want to unit test a view model that uses it. Which approaches are correct? Select **all** that apply.","source":{"kind":"company","company":"Walmart"}},{"id":"ARCH-031","type":"short","category":"architecture","difficulty":2,"topic":"Judging third-party libraries","tags":["third-party","dependency","spm","adapter","trade-off"],"question":"This is a take-home review. You didn't use a single third-party library in the app you submitted, and the interviewer asks why not, and if you had to, which parts you'd swap for which library. Answer with your criteria.","source":{"kind":"company","company":"Gojek"}},{"id":"ARCH-032","type":"short","category":"architecture","difficulty":3,"topic":"Analytics event dispatch","tags":["analytics","protocol","dispatcher","open-closed","take-home"],"question":"This is a take-home assignment. Design a layer in plain Swift that sends analytics events to several services (Google Analytics, Snowplow, and so on). Requirements: one line at the call site, events are modular and easy to add or remove, event names and parameters can differ per service, a service can opt in to specific events, and adding a service touches no existing code. How do you design the types?","source":{"kind":"company","company":"Headspace"}},{"id":"ARCH-033","type":"short","category":"architecture","difficulty":3,"topic":"Data layer for a tabbed app","tags":["repository","single-source-of-truth","caching","startup","whiteboard"],"question":"This is a whiteboard design. You're building a stripped-down Outlook app with only a Messages tab and a Contacts tab. Data read from the API has to show up in both tabs with no lag, and you need to optimize launch time and downloads so contacts appear as early as possible. Design the layers and the data flow.","source":{"kind":"company","company":"Microsoft"}},{"id":"ARCH-034","type":"mcq","category":"architecture","difficulty":2,"topic":"Singleton deinit","tags":["singleton","deinit","lifetime","scope","session"],"question":"For a singleton of the form `static let shared = SessionManager()`, someone asks \"can you make deinit get called, and is there a real case where you'd need to?\" Which answers are correct? Select **all** that apply.","source":{"kind":"company","company":"Paytm"}},{"id":"ARCH-035","type":"short","category":"architecture","difficulty":2,"topic":"Where business logic lives","tags":["mvvm","business-logic","viewmodel","domain","separation-of-concerns"],"question":"Pick the last screen you built and walk me through it end to end. Where did you put the business logic on that screen, and why?","source":{"kind":"company","company":"CRED"}},{"id":"ARCH-036","type":"short","category":"architecture","difficulty":3,"topic":"Limits of MVVM","tags":["mvvm","trade-off","refactoring","strangler","architecture-decision"],"question":"You said you chose MVVM for this feature. When does MVVM actually hurt?","source":{"kind":"company","company":"CRED"}},{"id":"ARCH-037","type":"mcq","category":"architecture","difficulty":3,"topic":"Deep links at scale","tags":["deep-link","universal-link","router","modularization","auth"],"question":"In a large app split into dozens of modules, which of these are correct designs for handling deep links (URL schemes, Universal Links, push payloads)? Select **all** that apply.","source":{"kind":"company","company":"Flipkart"}},{"id":"ARCH-038","type":"short","category":"architecture","difficulty":3,"topic":"Request state machine","tags":["state-machine","enum","loading-state","cancellation","unidirectional"],"question":"A screen with a network request has loading, success, failure, retry, refresh, and cancel states all tangled together. How do you design those state transitions?","source":{"kind":"company","company":"Didi"}},{"id":"ARCH-039","type":"short","category":"architecture","difficulty":3,"topic":"Extensible search API","tags":["api-design","closure","predicate","open-closed","asyncsequence"],"question":"Here's a file search function. Now it has to find only \"UTF-8 txt or H.264 mp4\" and \"files modified within the last week,\" and the conditions will keep growing. How do you extend this API without adding parameter after parameter?\n\n```swift\nfunc findFiles(in dir: URL, suffix: String) -> [URL]\n```","source":{"kind":"company","company":"Kuaishou"}},{"id":"ARCH-040","type":"short","category":"architecture","difficulty":3,"topic":"Clean Architecture circles vs user flow","tags":["clean-architecture","dependency-rule","use-case","user-flow","design-intent"],"question":"Your tech lead says \"the Clean Architecture circles (the concentric diagram) don't seem to match the user's perspective in iOS development.\" The flow the user experiences is screen to logic to server to screen, but the diagram only has arrows pointing inward. Answer by separating what the circles say from what they don't.","source":{"kind":"company","company":"네이버웹툰"}},{"id":"ARCH-041","type":"short","category":"architecture","difficulty":3,"topic":"Server Driven UI","tags":["server-driven-ui","sdui","component-registry","versioning","feed"],"question":"You want to change the feed screen's section makeup, order, and card types without shipping an app update. How do you design the Server Driven UI schema and the client renderer?","source":{"kind":"community","company":"당근"}},{"id":"ARCH-042","type":"short","category":"architecture","difficulty":3,"topic":"Designing for long-term maintenance","tags":["maintainability","design-decision","testability","adr","yagni"],"question":"You've been asked \"how would you design this feature so it's still maintainable years from now?\" Using a feature you built recently as the example, explain what criteria drove your decisions to make a structure that stays easy to change over time.","source":{"kind":"company","company":"당근"}},{"id":"ARCH-043","type":"short","category":"architecture","difficulty":3,"topic":"Reusable UI component boundaries","tags":["uikit","reusable-component","collection-view","configuration"],"question":"On a UIKit cart screen, the product card is used in the list, in search, and in recommendations, but the tap behavior and badges differ per screen. When you design a reusable `UICollectionViewCell` component, which inputs and events would you expose on the cell, and nothing more?","source":{"kind":"community","company":"Instacart"}},{"id":"ARCH-044","type":"short","category":"architecture","difficulty":3,"topic":"Moving from MVC to MVVM","tags":["mvvm","repository","migration","caching"],"question":"In an existing UIKit shopping app, the `UIViewController` handles the API calls, the cache, and the loading UI. When you move from MVC to MVVM, which layer would you put the networking and caching in?","source":{"kind":"company","company":"JD.com"}},{"id":"ARCH-045","type":"short","category":"architecture","difficulty":3,"topic":"Protocol-oriented composition","tags":["protocol-oriented","dependency-injection","composition","ios"],"question":"In an iOS ride service feature with route guidance, fare calculation, and live location updates, the inheritance hierarchy has gotten complicated. With protocol-oriented design, how would you compose the shared capabilities and the per-service differences?","source":{"kind":"community","company":"카카오모빌리티"}},{"id":"ARCH-046","type":"short","category":"architecture","difficulty":3,"topic":"Incremental legacy refactoring","tags":["refactoring","legacy","feature-flag","migration"],"question":"You need to improve the structure of a massive ViewController in a live UIKit order feature without rewriting it all at once. If you split the work into small shippable steps, which seam would you create first?","source":{"kind":"community","company":"우아한형제들"}},{"id":"ARCH-047","type":"short","category":"architecture","difficulty":2,"topic":"Modularizing a file list feature","tags":["feature-module","repository","search","refresh"],"question":"You're designing an iOS file and folder list feature with search and pull-to-refresh. To keep it maintainable independent of the UI framework, what module boundaries would you draw between the list, search, and refresh state and the data access?","source":{"kind":"community","company":"Dropbox"}},{"id":"ARCH-048","type":"short","category":"architecture","difficulty":1,"topic":"Scope of a singleton","tags":["singleton","dependency-injection","testability","global-state"],"question":"In a travel app, a global `SessionManager.shared` holds auth, cache, analytics, and experiment values all at once, and that makes testing hard. How would you decide what can stay a singleton and what has to move to initializer injection?","source":{"kind":"company","company":"Expedia"}},{"id":"BUILD-001","type":"short","category":"build-distribution","difficulty":1,"topic":"Dependency manager comparison","tags":["spm","cocoapods","carthage","dependency-manager"],"question":"How do CocoaPods, Carthage, and Swift Package Manager differ in the way they put a dependency into your project?","source":{"kind":"community"}},{"id":"BUILD-002","type":"mcq","category":"build-distribution","difficulty":1,"topic":"Swift Package Manager","tags":["spm","package-swift","binary-target"],"question":"Which of the following statements about Swift Package Manager are correct? **Select all that apply.**","source":{"kind":"community"}},{"id":"BUILD-003","type":"short","category":"build-distribution","difficulty":1,"topic":"Branch strategy","tags":["git","branching","trunk-based","gitflow","release-branch"],"question":"Why do you work on separate Git branches at all?","source":{"kind":"community"}},{"id":"BUILD-004","type":"short","category":"build-distribution","difficulty":3,"topic":"iOS CI/CD pipeline","tags":["ci-cd","fastlane","xcode-cloud","testflight","automation"],"question":"If you designed an iOS CI/CD pipeline from scratch, what steps would the pipeline that runs on every pull request have?","source":{"kind":"community"}},{"id":"BUILD-005","type":"short","category":"build-distribution","difficulty":4,"topic":"CI/CD at scale","tags":["ci-cd","monorepo","merge-queue","modularization","scale"],"question":"Over a hundred iOS engineers work on one app here. Hundreds of pull requests land a day, and even though each one passed CI, main breaks often once they're merged. How would you design CI/CD so main stays green and the release cadence holds?","source":{"kind":"community"}},{"id":"BUILD-006","type":"short","category":"build-distribution","difficulty":1,"topic":"Code signing basics","tags":["code-signing","bundle-id","certificate","provisioning-profile","entitlements"],"question":"How do the bundle ID, the certificate, and entitlements connect to a provisioning profile?","source":{"kind":"company","company":"카카오"}},{"id":"BUILD-007","type":"mcq","category":"build-distribution","difficulty":2,"topic":"Diagnosing signing errors","tags":["code-signing","provisioning-profile","certificate","xcode-error"],"question":"Archiving on your Mac fails with `Provisioning profile \"AppStore Profile\" doesn't include signing certificate \"Apple Distribution: ...\"` while the same archive works on a colleague's Mac. What's the **most likely cause**?","source":{"kind":"company","company":"카카오"}},{"id":"BUILD-008","type":"short","category":"build-distribution","difficulty":2,"topic":"Distribution methods compared","tags":["distribution","ad-hoc","enterprise","testflight","app-store","development"],"question":"How do Development, Ad Hoc, Enterprise (In-House), and App Store distribution, TestFlight included, differ?","source":{"kind":"company","company":"카카오"}},{"id":"BUILD-009","type":"short","category":"build-distribution","difficulty":1,"topic":"Major OS updates","tags":["wwdc","ios-version","deployment-target","beta","deprecation"],"question":"When a new major iOS version is announced at WWDC, in what order does your team respond?","source":{"kind":"community"}},{"id":"BUILD-010","type":"mcq","category":"build-distribution","difficulty":2,"topic":"Deployment target and SDK","tags":["deployment-target","sdk","available","compatibility"],"question":"Your app has a deployment target of iOS 16 and you want to call an API added in iOS 17. Which approach is **safe at both compile time and runtime**?","source":{"kind":"original"}},{"id":"BUILD-011","type":"mcq","category":"build-distribution","difficulty":2,"topic":"TestFlight","tags":["testflight","beta","app-store-connect"],"question":"Which of the following statements about TestFlight are correct? **Select all that apply.**","source":{"kind":"original"}},{"id":"BUILD-012","type":"short","category":"build-distribution","difficulty":3,"topic":"App Store review prep","tags":["app-review","rejection","guidelines","privacy","demo-account"],"question":"You're about to make your first App Store submission. What would you check before you submit to cut down on rejections?","source":{"kind":"original"}},{"id":"BUILD-013","type":"mcq","category":"build-distribution","difficulty":3,"topic":"Privacy manifest","tags":["privacy-manifest","required-reason-api","privacyinfo","app-store"],"question":"Which items do you **declare** in `PrivacyInfo.xcprivacy` (the privacy manifest)? **Select all that apply.**","source":{"kind":"original"},"since":"Xcode 15"},{"id":"BUILD-014","type":"short","category":"build-distribution","difficulty":2,"topic":"Separating build environments","tags":["xcconfig","scheme","build-configuration","environment","bundle-id"],"question":"You want to build against development, staging, and production servers from one project. How would you set up the schemes, build configurations, and xcconfig files?","source":{"kind":"original"}},{"id":"BUILD-015","type":"mcq","category":"build-distribution","difficulty":2,"topic":"Debug vs Release configs","tags":["build-configuration","optimization","assert","testability"],"question":"Which of the following statements about the difference between Xcode's default Debug and Release configurations are correct? **Select all that apply.**","source":{"kind":"original"}},{"id":"BUILD-016","type":"short","category":"build-distribution","difficulty":3,"topic":"Cutting build time","tags":["build-time","incremental-build","modularization","type-checking","explicit-modules"],"question":"You inherit a project where a clean build takes 15 minutes and a one-line change still takes 2 minutes. Where do you start measuring?","source":{"kind":"original"}},{"id":"BUILD-017","type":"short","category":"build-distribution","difficulty":3,"topic":"Code signing on CI","tags":["code-signing","fastlane-match","ci","keychain","app-store-connect-api"],"question":"You're automating the archive and the App Store upload on a CI server. How would you handle certificates, provisioning profiles, and App Store Connect authentication there safely?","source":{"kind":"community"}},{"id":"BUILD-018","type":"mcq","category":"build-distribution","difficulty":3,"topic":"xcodebuild archive and export","tags":["xcodebuild","archive","export-options","ipa"],"question":"You turn an `.xcarchive` built by `xcodebuild archive` into an App Store `.ipa` on CI. What is the **role** of `ExportOptions.plist`?","source":{"kind":"original"}},{"id":"BUILD-019","type":"short","category":"build-distribution","difficulty":3,"topic":"SPM version rules","tags":["spm","semantic-versioning","package-resolved","dependency-resolution"],"question":"How do you decide between SPM's version rules, `from:`, `upToNextMinor`, `exact`, and `branch`?","source":{"kind":"community"}},{"id":"BUILD-020","type":"short","category":"build-distribution","difficulty":4,"topic":"Static vs dynamic linking","tags":["static-library","dynamic-framework","mergeable-libraries","dyld","launch-time"],"question":"Your app embeds 40 dynamic frameworks. What gets better and what gets worse if you switch them to static linking?","source":{"kind":"original"},"since":"Xcode 15"},{"id":"BUILD-021","type":"mcq","category":"build-distribution","difficulty":4,"topic":"XCFramework","tags":["xcframework","binary-distribution","library-evolution","sdk"],"question":"You're shipping an internal SDK as a closed-source binary. Which of these is **a reason you need an XCFramework, or a requirement that comes with it**? Select all that apply.","source":{"kind":"original"}},{"id":"BUILD-022","type":"short","category":"build-distribution","difficulty":4,"topic":"Build systems at scale","tags":["tuist","xcodegen","bazel","pbxproj","monorepo"],"question":"A team on an app with more than a hundred modules is drowning in `project.pbxproj` conflicts and slow builds. How would you choose between a project generator such as XcodeGen or Tuist and a build system such as Bazel, and on what criteria?","source":{"kind":"community"}},{"id":"BUILD-023","type":"short","category":"build-distribution","difficulty":2,"topic":"Version and build number","tags":["version","build-number","cfbundleversion","marketing-version","semver"],"question":"How do `CFBundleShortVersionString` and `CFBundleVersion` differ?","source":{"kind":"original"}},{"id":"BUILD-024","type":"mcq","category":"build-distribution","difficulty":2,"topic":"Build number rules","tags":["build-number","testflight","app-store-connect"],"question":"You uploaded version `3.2.0`, build `120` to TestFlight, fixed a bug, and want to upload again. Which combination will App Store Connect **accept**?","source":{"kind":"original"}},{"id":"BUILD-025","type":"short","category":"build-distribution","difficulty":3,"topic":"Release risk management","tags":["phased-release","rollback","expedited-review","feature-flag","release-management"],"question":"The App Store has no rollback. What would you build into the release process to limit the damage when a new version ships with a critical bug?","source":{"kind":"original"}},{"id":"BUILD-026","type":"mcq","category":"build-distribution","difficulty":2,"topic":"App Store signing requirements","tags":["code-signing","distribution-certificate","provisioning-profile","app-store"],"question":"What do you **need** to sign a build for App Store submission? **Select all that apply.**","source":{"kind":"company","company":"카카오"}},{"id":"BUILD-027","type":"short","category":"build-distribution","difficulty":3,"topic":"Monorepo vs multirepo","tags":["monorepo","multi-repo","spm","ci","code-ownership"],"question":"This one comes up onsite. \"If you had to pick between a monorepo and several small repositories, which would you pick and why?\" Answer for an iOS app with internal modules: a design system, networking, and feature modules.","source":{"kind":"company","company":"Gojek"}},{"id":"BUILD-028","type":"mcq","category":"build-distribution","difficulty":2,"topic":"APNs certificates and keys","tags":["apns","certificate","p12","p8","push"],"question":"You're preparing the APNs credentials your push server will use. Which of the following statements are correct? **Select all that apply.**","source":{"kind":"company","company":"Mastercard"}},{"id":"BUILD-029","type":"short","category":"build-distribution","difficulty":3,"topic":"SPM in Tuist projects","tags":["tuist","spm","dependencies","project-generation"],"question":"How do you set up a third-party library through SPM in a project that Tuist generates?","source":{"kind":"company","company":"Zomato"},"since":"Tuist 4"},{"id":"BUILD-030","type":"mcq","category":"build-distribution","difficulty":1,"topic":"pod install vs update","tags":["cocoapods","podfile","lockfile","dependency"],"question":"In a project that uses CocoaPods, which of the following statements about the difference between `pod install` and `pod update` are correct? **Select all that apply.**","source":{"kind":"company","company":"TikTok"}},{"id":"BUILD-031","type":"short","category":"build-distribution","difficulty":3,"topic":"From source to binary","tags":["compiler","llvm","linker","static-library","dynamic-library","dyld"],"question":"What stages does a Swift source file go through before it's a binary running on an iPhone?","source":{"kind":"company","company":"Meituan"}},{"id":"BUILD-032","type":"mcq","category":"build-distribution","difficulty":2,"topic":"Inside an .ipa","tags":["ipa","bundle","code-signing","frameworks","mobileprovision"],"question":"You unzipped an `.ipa` exported from an archive. Which of the following statements about its **structure** are correct? **Select all that apply.**","source":{"kind":"company","company":"Pinduoduo"}},{"id":"BUILD-033","type":"short","category":"build-distribution","difficulty":3,"topic":"Dynamic code patching","tags":["hotfix","feature-flag","remote-config","app-review","objective-c","jspatch"],"question":"A shipped app has a critical bug and you can't wait for App Store review. Why did Apple ban **dynamic code patching** like the JSPatch that Chinese apps used to run, and how did they detect it?","source":{"kind":"company","company":"Baidu"}},{"id":"BUILD-034","type":"short","category":"build-distribution","difficulty":2,"topic":"Running a beta program","tags":["testflight","beta","feedback","release-process","ci-cd"],"question":"A hiring manager looks up from your resume. \"How did you run beta testing and CI/CD?\" Walk through how your TestFlight beta program was grouped, and which build went to whom and when.","source":{"kind":"company","company":"Flipkart"}},{"id":"BUILD-035","type":"short","category":"build-distribution","difficulty":3,"topic":"A/B experiments","tags":["ab-test","experiment","feature-flag","rollout","remote-config"],"question":"You're adding A/B experiments to the app. Where and how would you assign users? Describe the design from the client side.","source":{"kind":"company","company":"Alibaba"}},{"id":"BUILD-036","type":"short","category":"build-distribution","difficulty":2,"topic":"fastlane lane design","tags":["fastlane","match","jenkins","ci-cd","code-signing"],"question":"If you set up iOS CI/CD with Jenkins (or GitHub Actions) and fastlane, how would you divide the lanes?","source":{"kind":"community","company":"카카오뱅크"}},{"id":"BUILD-037","type":"short","category":"build-distribution","difficulty":3,"topic":"Tuist module layers","tags":["tuist","modularization","project-generation","build-cache","workspace"],"question":"The interviewer asks about setting up a modular project with Tuist from scratch. Walk through the units and the layers you split the modules into.","source":{"kind":"community","company":"신한카드"},"since":"Tuist 4"},{"id":"BUILD-038","type":"short","category":"build-distribution","difficulty":3,"topic":"App Store Connect API","tags":["app-store-connect-api","fastlane","spm","automation","release"],"question":"You want everything from the TestFlight upload through review submission and the phased release to run without a human. How far can the App Store Connect API take you?","source":{"kind":"community","company":"밀리의서재"}},{"id":"BUILD-039","type":"short","category":"build-distribution","difficulty":2,"topic":"Xcode compile time","tags":["xcode","build-time","modules","incremental-build"],"question":"A clean build of an ecommerce iOS app runs past 15 minutes and both CI and local builds are slow. What would you measure the stages with to decide what to fix first?","source":{"kind":"community","company":"Tokopedia"}},{"id":"BUILD-040","type":"short","category":"build-distribution","difficulty":2,"topic":"Release automation on CI","tags":["ci-cd","testflight","signing","automation"],"question":"iOS releases for a ride-hailing app depend on one person clicking through Xcode. How would you build a pipeline that runs from signing to TestFlight upload on CI?","source":{"kind":"community","company":"카카오모빌리티"}},{"id":"BUILD-041","type":"short","category":"build-distribution","difficulty":3,"topic":"Tuist module dependencies","tags":["tuist","modules","dependency-graph","interface"],"question":"In a hotel booking app's multi-module Tuist project, the Feature modules import each other's implementation modules directly, so changing one rebuilds everything. How would you change the dependency structure?","source":{"kind":"community","company":"여기어때"}},{"id":"BUILD-042","type":"short","category":"build-distribution","difficulty":3,"topic":"fastlane release reproducibility","tags":["fastlane","github-actions","release","artifact"],"question":"On a scooter-sharing app people deploy with fastlane from their own Macs, and the build numbers and environment settings come out different per person. How would you pin the lane's inputs so anyone who runs it gets the same result?","source":{"kind":"community","company":"더스윙"}},{"id":"CONC-001","type":"short","category":"concurrency","difficulty":1,"topic":"GCD basics","tags":["gcd","dispatch-queue","thread-pool","serial","concurrent"],"question":"What is GCD (Grand Central Dispatch), and why do you hand work to a queue instead of creating threads yourself?","source":{"kind":"community"}},{"id":"CONC-002","type":"mcq","category":"concurrency","difficulty":1,"topic":"sync/async vs serial/concurrent","tags":["sync","async","serial","concurrent","dispatch-queue"],"question":"Which of the following statements about `sync`/`async` and serial/concurrent queues are correct? **Select all that apply.**","source":{"kind":"community"}},{"id":"CONC-003","type":"short","category":"concurrency","difficulty":1,"topic":"Main thread and UI","tags":["main-thread","ui","main-actor","runloop","checker"],"question":"In a UIKit screen you set `label.text = result` inside a network response callback, and sometimes the screen updates late or not at all. What's causing that?","source":{"kind":"community"}},{"id":"CONC-004","type":"mcq","category":"concurrency","difficulty":2,"topic":"Serial queue self-sync","tags":["deadlock","sync","main-queue","serial","libdispatch"],"question":"You run this GCD code inside `viewDidLoad` of a UIKit view controller (main thread). What happens?\n\n```swift\nDispatchQueue.main.sync {\n    print(\"inside\")\n}\nprint(\"after\")\n```","source":{"kind":"community"}},{"id":"CONC-005","type":"short","category":"concurrency","difficulty":2,"topic":"GCD vs OperationQueue","tags":["operationqueue","operation","gcd","dependency","cancellation"],"question":"You're building an image pipeline: download, resize, then save to the disk cache, and when the user scrolls you need to cancel work in progress. Would you pick GCD or OperationQueue?","source":{"kind":"community"}},{"id":"CONC-006","type":"mcq","category":"concurrency","difficulty":2,"topic":"QoS classes","tags":["qos","quality-of-service","priority","global-queue"],"question":"The user tapped a button and is waiting for the result, and you want to send JSON parsing to a GCD background queue. Which QoS fits best?","source":{"kind":"community"}},{"id":"CONC-007","type":"short","category":"concurrency","difficulty":2,"topic":"Race conditions","tags":["race-condition","data-race","lock","serial-queue","actor","atomic"],"question":"This code gets called from several threads, and `count` comes out lower than expected. Can you explain why at the CPU level?\n\n```swift\nfinal class Stats {\n    var count = 0\n    func hit() { count += 1 }\n}\n```","source":{"kind":"community"}},{"id":"CONC-008","type":"mcq","category":"concurrency","difficulty":2,"topic":"Barrier and reader-writer","tags":["barrier","concurrent-queue","reader-writer","gcd"],"question":"In this cache built on a GCD concurrent queue, which statement about the role of the `.barrier` flag is **correct**?\n\n```swift\nlet q = DispatchQueue(label: \"cache\", attributes: .concurrent)\nfunc read(_ k: String) -> Data? { q.sync { store[k] } }\nfunc write(_ k: String, _ v: Data) {\n    q.async(flags: .barrier) { store[k] = v }\n}\n```","source":{"kind":"original"}},{"id":"CONC-009","type":"short","category":"concurrency","difficulty":3,"topic":"Diagnosing deadlocks","tags":["deadlock","debugging","lldb","lock-ordering","sync"],"question":"QA reports that the app sometimes freezes completely with no crash log. If you suspect a deadlock, in what order would you track down the cause?","source":{"kind":"company","company":"Apple"}},{"id":"CONC-010","type":"short","category":"concurrency","difficulty":2,"topic":"Combining async work","tags":["dispatchgroup","semaphore","async-let","taskgroup","fan-out"],"question":"When a screen appears you call three APIs in parallel, profile, feed, and notifications, and you have to render the UI once when all of them finish. How would you build that with GCD?","source":{"kind":"community"},"since":"Swift 5.5"},{"id":"CONC-011","type":"mcq","category":"concurrency","difficulty":2,"topic":"Semaphores and mutexes","tags":["semaphore","mutex","lock","synchronization"],"question":"Which of the following statements about `DispatchSemaphore` and mutexes (`NSLock`, `Mutex`) are correct? **Select all that apply.**","source":{"kind":"community"}},{"id":"CONC-012","type":"short","category":"concurrency","difficulty":2,"topic":"How async/await works","tags":["async-await","suspension","continuation","cooperative-thread-pool","completion-handler"],"question":"In Swift Concurrency, what actually happens when execution hits an `await`, and how is that different from blocking a thread?","source":{"kind":"community"},"since":"Swift 5.5"},{"id":"CONC-013","type":"short","category":"concurrency","difficulty":2,"topic":"How Task runs","tags":["task","unstructured","detached","inheritance","priority","cancellation"],"question":"In Swift Concurrency, when you create a `Task { }`, when and where does that code run?","source":{"kind":"community"},"since":"Swift 5.5"},{"id":"CONC-014","type":"mcq","category":"concurrency","difficulty":3,"topic":"Structured concurrency","tags":["structured-concurrency","async-let","taskgroup","cancellation"],"question":"Which of the following statements about structured concurrency (`async let`, `TaskGroup`) are correct? **Select all that apply.**","source":{"kind":"community"},"since":"Swift 5.5"},{"id":"CONC-015","type":"short","category":"concurrency","difficulty":4,"topic":"Actor reentrancy","tags":["actor","reentrancy","isolation","await","invariant"],"question":"This image cache actor built with Swift Concurrency sometimes sends two network requests for the same key. The actor protects its state, so why does this happen?\n\n```swift\nactor ImageCache {\n    private var cache: [URL: UIImage] = [:]\n    func image(for url: URL) async throws -> UIImage {\n        if let hit = cache[url] { return hit }\n        let img = try await download(url)\n        cache[url] = img\n        return img\n    }\n}\n```","source":{"kind":"original"},"since":"Swift 5.5"},{"id":"CONC-016","type":"mcq","category":"concurrency","difficulty":3,"topic":"Sendable conformance","tags":["sendable","swift-6","strict-concurrency","value-type","actor"],"question":"Under Swift 6 strict concurrency, which of the following are treated as `Sendable` (or adopt it automatically) **with no extra work? Select all that apply.**","source":{"kind":"original"},"since":"Swift 6"},{"id":"CONC-017","type":"short","category":"concurrency","difficulty":3,"topic":"Swift 6 migration","tags":["swift-6","strict-concurrency","migration","completion-handler","mainactor"],"question":"You've been asked to move a large app written with completion handlers and GCD to Swift 6 strict concurrency. In what order would you do it?","source":{"kind":"community"},"since":"Swift 6"},{"id":"CONC-018","type":"short","category":"concurrency","difficulty":3,"topic":"MainActor isolation","tags":["mainactor","global-actor","nonisolated","isolation","ui"],"question":"In Swift Concurrency, what's the difference between putting `@MainActor` on a whole view model class and putting it on specific methods only?","source":{"kind":"original"},"since":"Swift 5.7"},{"id":"CONC-019","type":"mcq","category":"concurrency","difficulty":2,"topic":"Combine operators and schedulers","tags":["combine","debounce","throttle","scheduler","receive-on"],"question":"You want to call the API once, 300ms after typing stops, instead of on every keystroke in a search field, and receive the result on the main thread. Which Combine pipeline is correct?","source":{"kind":"community"},"since":"iOS 13"},{"id":"CONC-020","type":"short","category":"concurrency","difficulty":3,"topic":"Thread Sanitizer","tags":["tsan","thread-sanitizer","data-race","debugging","ci"],"question":"How does Thread Sanitizer actually catch data races?","source":{"kind":"community"}},{"id":"CONC-021","type":"mcq","category":"concurrency","difficulty":4,"topic":"Cooperative cancellation","tags":["cancellation","task","checkcancellation","task-sleep"],"question":"In this Swift Concurrency code, which statement about what actually happens right after `t.cancel()` is **correct**?\n\n```swift\nlet t = Task {\n    var sum = 0\n    for i in 0..<1_000_000_000 { sum &+= i }\n    try Task.checkCancellation()\n    try await Task.sleep(for: .seconds(5))\n    return sum\n}\nt.cancel()\n```","source":{"kind":"original"},"since":"Swift 5.5"},{"id":"CONC-022","type":"short","category":"concurrency","difficulty":4,"topic":"Designing a dispatch queue","tags":["design","queue","thread-pool","condition-variable","serial","concurrent"],"question":"Design a `MyQueue` of your own without GCD. Submitting a closure with `async(_:)` should run it on a background thread pool, it should support serial and concurrent modes, and it should offer `sync(_:)` too. Can you walk me through the core data structures and how the synchronization works?","source":{"kind":"company","company":"Amazon"}},{"id":"CONC-023","type":"short","category":"concurrency","difficulty":3,"topic":"Async network client design","tags":["design","network-client","async","cancellation","retry","deduplication"],"question":"Design the API of an async network client that several screens use at the same time. It must never block the main thread, and it needs deduplication of identical requests, cancellation, and retries. Can you walk me through the interface and the internal concurrency structure?","source":{"kind":"community","company":"Snap"},"since":"Swift 5.5"},{"id":"CONC-024","type":"mcq","category":"concurrency","difficulty":1,"topic":"await vs async let","tags":["async-await","async-let","parallel","sequential","task"],"question":"In Swift Concurrency, if `fetchProfile()` and `fetchFeed()` each take 1 second, which statement about the total time of these two snippets is **correct**?\n\n```swift\n// A\nlet p = await fetchProfile()\nlet f = await fetchFeed()\n\n// B\nasync let p = fetchProfile()\nasync let f = fetchFeed()\nlet (profile, feed) = await (p, f)\n```","source":{"kind":"original"},"since":"Swift 5.5"},{"id":"CONC-025","type":"short","category":"concurrency","difficulty":2,"topic":"Run loop modes","tags":["runloop","timer","main-thread","runloop-mode","scrolling"],"question":"While the user scrolls, an on-screen countdown `Timer` stops, and when scrolling ends it catches up all at once. From the run loop's point of view, what's the cause?","source":{"kind":"community"}},{"id":"CONC-026","type":"mcq","category":"concurrency","difficulty":1,"topic":"iOS concurrency tools","tags":["thread","gcd","operationqueue","async-await","overview"],"question":"Which of the following are appropriate ways to run work in the background (concurrency) on iOS? **Select all that apply.**","source":{"kind":"community"}},{"id":"CONC-027","type":"short","category":"concurrency","difficulty":4,"topic":"Real-time pipeline","tags":["realtime","video","60fps","backpressure","buffer-pool","pipeline"],"question":"You're building an app that applies real-time filters to the camera preview. It has to hold 60fps while staying memory safe (no buffer leaks, no contention). What thread and queue structure would you design for the capture, process, render pipeline?","source":{"kind":"community"}},{"id":"CONC-028","type":"short","category":"concurrency","difficulty":3,"topic":"Canceling delayed work","tags":["dispatchworkitem","asyncafter","cancellation","task-sleep","debounce"],"question":"You scheduled `DispatchQueue.main.asyncAfter(deadline: .now() + 2) { showTooltip() }`, and if the user leaves the screen within 2 seconds it has to be canceled. How would you do that with GCD?","source":{"kind":"community"},"since":"Swift 5.5"},{"id":"CONC-029","type":"short","category":"concurrency","difficulty":2,"topic":"class vs actor","tags":["actor","mainactor","isolation","class","swift-concurrency"],"question":"In Swift, what's the difference between a class and an actor?","source":{"kind":"community","company":"Walmart"},"since":"Swift 5.5"},{"id":"CONC-030","type":"short","category":"concurrency","difficulty":3,"topic":"Completion handlers to async","tags":["async-await","continuation","migration","cancellation","legacy"],"question":"You have an old networking layer built on completion handlers, called from hundreds of places across the app. How would you move it to async/await without breaking all the call sites at once?","source":{"kind":"company","company":"PayPal"},"since":"Swift 5.5"},{"id":"CONC-031","type":"short","category":"concurrency","difficulty":2,"topic":"Combine zip vs combineLatest","tags":["combine","zip","combinelatest","network","async-let"],"question":"Write a Combine pipeline that sends two different network requests (user profile, account list) at the same time and emits a result once, **only when both have completed**. Would you use `zip` or `combineLatest`, and why?","source":{"kind":"company","company":"Capital One"},"since":"iOS 13"},{"id":"CONC-032","type":"short","category":"concurrency","difficulty":3,"topic":"Ordered concurrent downloads","tags":["taskgroup","structured-concurrency","ordering","cancellation","images"],"question":"You're given an array of image ids `[3, 1, 2]`. Download each image **concurrently**, but display them on screen in id order (1, 2, 3). How would you do that with Swift Concurrency?","source":{"kind":"company","company":"PhonePe"},"since":"Swift 5.5"},{"id":"CONC-033","type":"mcq","category":"concurrency","difficulty":3,"topic":"Nested queue output","tags":["gcd","main-queue","sync","deadlock","output-prediction"],"question":"You run this GCD code on the main thread. What's the output?\n\n```swift\nprint(\"A\")\nDispatchQueue.main.async {\n    print(\"B\")\n    DispatchQueue.main.async { print(\"C\") }\n    DispatchQueue.global().sync {\n        print(\"D\")\n        DispatchQueue.main.sync { print(\"E\") }\n    }\n    print(\"F\")\n}\nprint(\"G\")\n```","source":{"kind":"company","company":"Zomato"}},{"id":"CONC-034","type":"mcq","category":"concurrency","difficulty":3,"topic":"Serial vs concurrent sync","tags":["gcd","serial","concurrent","sync","timing"],"question":"You call this function, which takes a GCD queue, from the main thread. About how many seconds until it returns? Answer for (1) a serial `queue` and (2) a concurrent `queue`.\n\n```swift\nfunc run(on queue: DispatchQueue) {\n    queue.async { Thread.sleep(forTimeInterval: 5) }\n    queue.sync  { Thread.sleep(forTimeInterval: 3) }\n}\n```","source":{"kind":"company","company":"Kuaishou"}},{"id":"CONC-035","type":"mcq","category":"concurrency","difficulty":3,"topic":"Lock-free increment range","tags":["race-condition","data-race","atomicity","lock","threads"],"question":"Five threads each run `count += 1` 20 times on a shared variable `count` (initially 0), with no lock. When they've all finished, what range of values can `count` have? (Assume the increment is three steps, read, add, write, and another thread can cut in between any two steps.)","source":{"kind":"company","company":"NetEase"}},{"id":"CONC-036","type":"short","category":"concurrency","difficulty":3,"topic":"Multi-reader single-writer queue","tags":["gcd","barrier","reader-writer","objective-c","actor"],"question":"You want a property that several threads can read at the same time while writes happen one at a time. Back in the Objective-C days there was a pattern of `dispatch_sync` in the getter and `dispatch_barrier_async` in the setter, and the interviewer asks: \"If the getter is `sync`, that's synchronous, so how can several reads happen at once?\" How would you explain that?","source":{"kind":"company","company":"ByteDance"}},{"id":"CONC-037","type":"mcq","category":"concurrency","difficulty":2,"topic":"Concurrent queue self-sync","tags":["gcd","concurrent","sync","thread-pool","output-prediction"],"question":"What does this GCD code print? And does every call to `queue.async` create a new thread?\n\n```swift\nlet queue = DispatchQueue(label: \"xyz\", attributes: .concurrent)\nprint(1)\nqueue.async {\n    print(2)\n    queue.sync { print(3) }\n}\nprint(4)\n```","source":{"kind":"company","company":"Xiaohongshu"}},{"id":"CONC-038","type":"short","category":"concurrency","difficulty":2,"topic":"Dependent work, priority inversion","tags":["dispatchgroup","barrier","operationqueue","async-let","priority-inversion"],"question":"You have independent pieces of work A, B, and C. C must run only after both A and B have finished, the order of A and B doesn't matter, and they don't nest inside each other. Tell me every way you know to implement that, with the pros and cons.","source":{"kind":"company","company":"Didi"}},{"id":"CONC-039","type":"short","category":"concurrency","difficulty":2,"topic":"Search debounce","tags":["debounce","dispatchworkitem","task","cancellation","search"],"question":"Calling the API on every keystroke in a search field floods it with requests. Can you implement a debounce with GCD yourself, so the call only fires when there's been no further input for 300ms after the last keystroke?","source":{"kind":"company","company":"Flipkart"}},{"id":"CONC-040","type":"short","category":"concurrency","difficulty":2,"topic":"Leaving a loading screen","tags":["cancellation","task","weak-self","timeout","ui-state"],"question":"When the user enters the detail screen, it calls an API like this and shows the data.\n\n```swift\nfinal class DetailViewController: UIViewController {\n    override func viewDidLoad() {\n        super.viewDidLoad()\n        api.fetchDetail(id: id) { result in\n            self.render(result)\n        }\n    }\n}\n```\n\nThe interviewer asks: \"What happens if the user taps back before the response arrives?\" Explain the problems this code can cause, and how you'd keep the request for a screen the user left from going to waste.","source":{"kind":"company","company":"CRED"}},{"id":"CONC-041","type":"short","category":"concurrency","difficulty":4,"topic":"Swift 6 singleton build","tags":["swift6","strict-concurrency","sendable","singleton","actor"],"question":"The take-home app you submitted has a singleton `ImageCache` created with `static let shared` (with `var storage: [URL: UIImage]` inside) that several screens read and write from background queues. The interviewer asks: \"What happens if you build this project in Swift 6 language mode?\"","source":{"kind":"community"},"since":"Swift 6"},{"id":"CONC-042","type":"short","category":"concurrency","difficulty":3,"topic":"Dictionary cache thread safety","tags":["thread-safety","dictionary","nscache","lock","actor"],"question":"In a message list screen, each cell downloads its profile image asynchronously and caches it in a `[String: UIImage]` dictionary. With several threads reading and writing at once, it crashes now and then. Why does it crash?","source":{"kind":"company","company":"Microsoft"}},{"id":"CONC-043","type":"short","category":"concurrency","difficulty":1,"topic":"Choosing concurrency tools","tags":["swift-concurrency","async-await","actor","mainactor"],"question":"A new iOS feature needs a network result shared across several screens, and the UI has to update too. What role would you give each of Swift Concurrency's `async/await`, `Task`, and `actor`?","source":{"kind":"community","company":"Oracle"},"since":"Swift 5.5"},{"id":"CONC-044","type":"short","category":"concurrency","difficulty":2,"topic":"Offloading the main thread","tags":["mainactor","background-work","uikit","threading"],"question":"A UIKit screen with image conversion and API response handling stutters while scrolling. Which work would you move off the main actor?","source":{"kind":"community","company":"Grindr"},"since":"Swift 5.5"},{"id":"CONC-045","type":"short","category":"concurrency","difficulty":2,"topic":"Shared cache data race","tags":["actor","data-race","cache","inflight"],"question":"Several image requests read and write the same in-memory cache dictionary at the same time. It crashes now and then, and the logs show the same URL downloaded twice. If you fixed it with an actor instead of a lock, which state would you put inside the actor?","source":{"kind":"community","company":"Zalando"},"since":"Swift 5.5"},{"id":"CONC-046","type":"short","category":"concurrency","difficulty":2,"topic":"Structured cancellation","tags":["cancellation","structured-concurrency","task-group","search"],"question":"When the search query changes, the previous search's network, decoding, and image work all have to stop. How would you structure the task tree using cancellation propagation from parent Task to child Tasks?","source":{"kind":"company","company":"Square"},"since":"Swift 5.5"},{"id":"CONC-047","type":"short","category":"concurrency","difficulty":2,"topic":"Latest response wins","tags":["stale-response","cancellation","state","concurrency"],"question":"On a tax summary screen, changing the filter quickly makes several API requests finish almost at once. To make sure only the result for the last filter chosen ends up on screen, how would you manage the requests and the state changes?","source":{"kind":"community","company":"Intuit"},"since":"Swift 5.5"},{"id":"CONC-048","type":"short","category":"concurrency","difficulty":2,"topic":"async let vs TaskGroup","tags":["async-let","taskgroup","fanout","error-handling"],"question":"A banking app's home screen has to fetch independent account, card, and notification data at the same time. Between `async let` and TaskGroup, which would you pick, and on what basis?","source":{"kind":"community","company":"HSBC"},"since":"Swift 5.5"},{"id":"CONC-049","type":"short","category":"concurrency","difficulty":3,"topic":"Merging same-URL downloads","tags":["actor","image-download","deduplication","task"],"question":"In a photo grid, several cells request the same photo URL at the same time, but the network download must happen only once. How would you keep in-flight Tasks inside an actor to merge the requests?","source":{"kind":"company","company":"Dropbox"},"since":"Swift 5.5"},{"id":"CONC-050","type":"short","category":"concurrency","difficulty":2,"topic":"DispatchGroup fan-out","tags":["dispatchgroup","callbacks","fanout","errors"],"question":"In a callback-based payments app, you have to build a payment summary after three independent APIs have all finished. Where would you put `DispatchGroup`'s enter and leave so they pair up?","source":{"kind":"company","company":"Razorpay"}},{"id":"CS-001","type":"short","category":"cs-fundamentals","difficulty":1,"topic":"Stacks and queues","tags":["stack","queue","data-structure","navigation","operationqueue"],"question":"What's the difference between a stack and a queue?","source":{"kind":"community","company":"Apple"}},{"id":"CS-002","type":"mcq","category":"cs-fundamentals","difficulty":1,"topic":"Array vs linked list","tags":["array","linked-list","complexity"],"question":"You're picking a data structure for the message list on a chat screen. Which is the **most accurate** reason a Swift `Array` beats a linked list here?","source":{"kind":"community","company":"Snap"}},{"id":"CS-003","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Array insert cost","tags":["array","complexity","prepend","deque","cow"],"question":"A live feed calls `posts.insert(newPost, at: 0)` every time a new post arrives. What goes wrong once 50,000 posts have piled up?","source":{"kind":"original"}},{"id":"CS-004","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Hash maps and Dictionary","tags":["hashmap","dictionary","hashable","collision","open-addressing"],"question":"If you had to implement a hash map yourself, how would you build it?","source":{"kind":"community","company":"Meta"}},{"id":"CS-005","type":"mcq","category":"cs-fundamentals","difficulty":2,"topic":"Hashable consistency","tags":["hashable","equatable","set","bug"],"question":"What problem does this type cause when you put it in a `Set`?\n\n```swift\nstruct User: Hashable {\n    let id: Int\n    var name: String\n    static func == (a: User, b: User) -> Bool { a.id == b.id }\n    func hash(into h: inout Hasher) { h.combine(id); h.combine(name) }\n}\n```","source":{"kind":"original"}},{"id":"CS-006","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"LRU cache","tags":["lru","cache","linked-list","dictionary","nscache","image-cache"],"question":"You need to write an in-memory image cache with LRU eviction yourself. Which data structures give you O(1) get and put?","source":{"kind":"community"}},{"id":"CS-007","type":"mcq","category":"cs-fundamentals","difficulty":2,"topic":"Bit operations and OptionSet","tags":["bitwise","optionset","bitmask","enum"],"question":"Given this code, which statements about `OptionSet` and bit operations are correct? **Select all that apply.**\n\n```swift\nstruct Perm: OptionSet {\n    let rawValue: UInt8\n    static let read  = Perm(rawValue: 1 << 0)\n    static let write = Perm(rawValue: 1 << 1)\n    static let exec  = Perm(rawValue: 1 << 2)\n}\nlet p: Perm = [.read, .write]\n```","source":{"kind":"original"}},{"id":"CS-008","type":"short","category":"cs-fundamentals","difficulty":4,"topic":"Diff algorithms","tags":["diffable-data-source","diff","myers","heckel","hashable","collectionview"],"question":"When you apply a new snapshot to `UICollectionViewDiffableDataSource`, how does it compute the inserts, deletes, and moves? And why do item identifiers have to be `Hashable`?","source":{"kind":"original"},"since":"iOS 15"},{"id":"CS-009","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Choosing a search algorithm","tags":["binary-search","linear-search","dictionary","trie","search"],"question":"You're building name search over a list of 10,000 contacts. How do linear search and sort-then-binary-search compare, and what would you actually use in a shipping app?","source":{"kind":"community"}},{"id":"CS-010","type":"mcq","category":"cs-fundamentals","difficulty":1,"topic":"Swift collection complexity","tags":["complexity","array","set","dictionary","big-o"],"question":"Which of these Swift collection operations have **O(1)** average time complexity? **Select all that apply.**","source":{"kind":"original"}},{"id":"CS-011","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Processes and threads","tags":["process","thread","os","extension","main-thread"],"question":"What's the difference between a process and a thread? What do threads share, and what does each one keep to itself?","source":{"kind":"community"}},{"id":"CS-012","type":"mcq","category":"cs-fundamentals","difficulty":2,"topic":"Thread explosion","tags":["thread-explosion","gcd","concurrent-queue","semaphore"],"question":"Running this code, which downloads 200 URLs with GCD, sends the system thread count past 60 and freezes the app. What's the most accurate cause?\n\n```swift\nfor url in urls { // 200 URLs\n    DispatchQueue.global().async {\n        let sema = DispatchSemaphore(value: 0)\n        download(url) { _ in sema.signal() }\n        sema.wait()\n        process()\n    }\n}\n```","source":{"kind":"original"}},{"id":"CS-013","type":"short","category":"cs-fundamentals","difficulty":4,"topic":"Topological sort of dependencies","tags":["graph","topological-sort","dependency","cycle-detection","modularization","di"],"question":"In an app split into 30 modules, the DI container initializes services in an order someone maintains by hand, and it crashed with \"A needs B and B needs A.\" What algorithm gives you a safe initialization order from the dependency graph?","source":{"kind":"original"}},{"id":"CS-014","type":"short","category":"cs-fundamentals","difficulty":1,"topic":"TCP vs UDP","tags":["tcp","udp","network","urlsession","quic"],"question":"What's the difference between TCP and UDP? When a packet is lost, what happens under each one?","source":{"kind":"company","company":"카카오"}},{"id":"CS-015","type":"mcq","category":"cs-fundamentals","difficulty":3,"topic":"Floating point and Decimal","tags":["floating-point","decimal","ieee754","currency","precision"],"question":"In payment amount math, `0.1 + 0.2 == 0.3` came back `false` and a test failed. Which statements about floating point and `Decimal` are correct? **Select all that apply.**","source":{"kind":"original"}},{"id":"CS-016","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"QUIC and mobile networks","tags":["quic","http3","tcp","connection-migration","0-rtt","urlsession"],"question":"A user on the subway keeps bouncing between Wi-Fi and LTE, and your app's requests keep dropping. How do HTTP/2 over TCP and HTTP/3 over QUIC each handle that?","source":{"kind":"original"},"since":"iOS 15"},{"id":"CS-017","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"First request latency","tags":["dns","tls","handshake","latency","urlsessiontaskmetrics","preconnect"],"question":"On a cold start, your app's first API response takes 800ms and every one after that takes 120ms. Can you walk me through what happens in the network stack in between, step by step?","source":{"kind":"original"}},{"id":"CS-018","type":"mcq","category":"cs-fundamentals","difficulty":1,"topic":"Image formats","tags":["png","jpeg","heic","webp","image-format"],"question":"Which statements about image formats are correct? **Select all that apply.**","source":{"kind":"community"},"since":"iOS 14"},{"id":"CS-019","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Sorting and Swift sort","tags":["sort","stable-sort","merge-sort","quick-sort","timsort","introsort"],"question":"Can you compare merge sort and quicksort: how each works, and their time and space complexity?","source":{"kind":"community","company":"Snap"},"since":"Swift 5"},{"id":"CS-020","type":"mcq","category":"cs-fundamentals","difficulty":2,"topic":"Stable sorting","tags":["sort","stable-sort","ui"],"question":"You take a contacts array already sorted by name and re-sort it with `contacts.sort { $0.isFavorite && !$1.isFavorite }`, and the names inside the favorites group stay in order. Why is that guaranteed?","source":{"kind":"original"}},{"id":"CS-021","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"View hierarchy tree search","tags":["bfs","dfs","tree","view-hierarchy","recursion"],"question":"You're given a specific `UIView` instance in an original view hierarchy, plus a copy of that hierarchy with the same structure. How would you design a function that finds the corresponding view in the copy?","source":{"kind":"community","company":"Meta"}},{"id":"CS-022","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"Recursion and stack limits","tags":["recursion","iteration","stack-overflow","thread-stack","merge-sort","json"],"question":"You're recursively walking a nested JSON document thousands of levels deep, and it crashes only on a background thread. What's the cause?","source":{"kind":"company","company":"TikTok"}},{"id":"CS-023","type":"mcq","category":"cs-fundamentals","difficulty":3,"topic":"Cache locality","tags":["cache-locality","struct","class","memory-layout","performance"],"question":"You iterate over 100,000 coordinates and sum distances. Between these two versions, what's the **main** reason A is noticeably faster than B?\n\n```swift\nstruct P { var x, y: Double }   // A: [P]\nfinal class Q { var x, y: Double } // B: [Q]\n```","source":{"kind":"community"}},{"id":"CS-024","type":"short","category":"cs-fundamentals","difficulty":4,"topic":"Trie based autocomplete","tags":["trie","autocomplete","memory","search","top-k"],"question":"You need search autocomplete that works offline: 500,000 candidate words, and on every keystroke you return the top 10 within 16ms. How do you design the data structure?","source":{"kind":"community"}},{"id":"CS-025","type":"short","category":"cs-fundamentals","difficulty":4,"topic":"Prefix sum binary search","tags":["prefix-sum","binary-search","layout","scroll","collectionview"],"question":"You're writing a custom vertical layout (a UICollectionViewLayout subclass) where every cell has a different height. `layoutAttributesForElements(in rect:)` gets called on every scroll, and iterating 20,000 cells each time stutters. Which data structure and algorithm find the visible cell range in O(log n)?","source":{"kind":"original"}},{"id":"CS-026","type":"mcq","category":"cs-fundamentals","difficulty":2,"topic":"Pure functions","tags":["pure-function","functional","side-effect","swiftui"],"question":"Which of these are **pure functions** (same output for the same input, no side effects)? **Select all that apply.**","source":{"kind":"community"}},{"id":"CS-027","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"O(1) max stack","tags":["stack","max-stack","protocol","xctest","amortized"],"question":"You want a stack, like an editor's undo stack, that returns the \"current maximum\" of the pushed values in O(1). First define the interface as a Swift protocol, then explain the implementation idea.\n\n```swift\nprotocol MaxStack {\n    associatedtype Element: Comparable\n    mutating func push(_ x: Element)\n    mutating func pop() -> Element?\n    func peekMax() -> Element?\n}\n```","source":{"kind":"company","company":"Apple"},"estimatedMinutes":5},{"id":"CS-028","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Streaming moving average","tags":["ring-buffer","sliding-window","moving-average","fps","stream"],"question":"Frame times arrive as a stream, one per frame. Design a type that returns \"the average of the last k frames\" instantly whenever asked. It's called 60 times a second, so the math has to stay light. Explain the data structure, how you update it, and the complexity.","source":{"kind":"company","company":"Meta"},"estimatedMinutes":4},{"id":"CS-029","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"K nearest places","tags":["k-nearest","heap","quickselect","geo","map"],"question":"You have tens of thousands of places with an id and coordinates (latitude, longitude). Given the user's current location, design a function that finds the 10 nearest places and returns their center coordinate. Which algorithm and data structure do you use, and what's the complexity?","source":{"kind":"company","company":"Google"},"estimatedMinutes":5},{"id":"CS-030","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Anchored two-way lookup","tags":["binary-search","sorted-array","pagination","anchor","dedupe"],"question":"Chat messages sit in an array sorted by id ascending. When the user taps a push notification to jump to a specific message, how would you write a function that returns that id plus up to 5 messages on each side, at most 11 in total, in ascending order?","source":{"kind":"company","company":"Reddit"},"estimatedMinutes":4},{"id":"CS-031","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"LRU cache with TTL","tags":["lru","ttl","cache","expiry","linked-list","hashmap"],"question":"You've implemented an LRU cache and the interviewer follows up: \"Now make each entry expire a fixed time after it's stored. What gets more expensive?\" Explain the cheapest way to check expiry and what that approach costs you.","source":{"kind":"company","company":"PayPal"},"estimatedMinutes":5},{"id":"CS-032","type":"mcq","category":"cs-fundamentals","difficulty":2,"topic":"Sliding window preconditions","tags":["sliding-window","two-pointers","prefix-sum","monotonic"],"question":"You solved \"longest contiguous run of transaction amounts whose sum stays at or under a limit L\" in O(n) with a two-pointer sliding window. The interviewer asks, \"What if refunds show up as negative amounts?\" What's the problem?","source":{"kind":"company","company":"PayPal"}},{"id":"CS-033","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Rearranging without adjacent duplicates","tags":["greedy","heap","priority-queue","feed","diversity"],"question":"You have a list of posts for a feed and need to reorder them so that no two posts by the same author appear back to back. What algorithm do you use, and what's the time complexity?","source":{"kind":"company","company":"Audible"},"estimatedMinutes":4},{"id":"CS-034","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Parsing corrupted logs","tags":["parsing","validation","log","top-k","streaming","robustness"],"question":"Your app writes a network log file. Each line has the format `userID(4 digits) pageName startTime(hh:mm:ss) endTime(hh:mm:ss)`, but some lines are corrupted. How would you design a function that keeps only valid lines and finds the 2 pages that loaded slowest? How do you handle the broken lines?","source":{"kind":"company","company":"Mastercard"},"estimatedMinutes":4},{"id":"CS-035","type":"mcq","category":"cs-fundamentals","difficulty":2,"topic":"Time window anomaly detection","tags":["hashmap","time-window","stream","fraud","sorting"],"question":"A list of transactions (card number, country, time) arrives sorted by time ascending. What's the most efficient way to detect \"the same card used in two different countries within 5 minutes\"?","source":{"kind":"company","company":"JPMorgan"}},{"id":"CS-036","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"Connected components, recursion limits","tags":["flood-fill","bfs","dfs","matrix","connected-components","space-complexity"],"question":"An image mask comes as an N×M grid where 1 is foreground and 0 is background. How would you write a function that returns an array with the size of each blob of 1s connected up, down, left, and right? Assume you're processing a 4000×3000 mask on an iPhone.","source":{"kind":"company","company":"Microsoft"},"estimatedMinutes":5},{"id":"CS-037","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"Purpose of virtual memory","tags":["virtual-memory","paging","mmap","jetsam","address-space","os"],"question":"Someone asks you, \"If a device has plenty of physical memory, why do we even need virtual memory?\" How would you answer?","source":{"kind":"company","company":"Shopee"},"estimatedMinutes":5},{"id":"CS-038","type":"mcq","category":"cs-fundamentals","difficulty":1,"topic":"Interval overlap","tags":["range","interval","overlap","nsrange"],"question":"You're writing a function that decides whether two text highlight ranges overlap. For two half-open ranges `a = [a.lower, a.upper)` and `b = [b.lower, b.upper)`, which condition correctly says they **overlap**?","source":{"kind":"company","company":"Zomato"}},{"id":"CS-039","type":"short","category":"cs-fundamentals","difficulty":3,"topic":"Deduplicating beyond memory","tags":["external-memory","hash-partition","bloom-filter","dedupe","streaming","sqlite"],"question":"You have a 1TB log file with one URL per line and need to remove duplicate URLs, but you only have 1GB of memory. How do you do it?","source":{"kind":"company","company":"Alibaba"},"estimatedMinutes":5},{"id":"CS-040","type":"mcq","category":"cs-fundamentals","difficulty":2,"topic":"Luhn checksum","tags":["luhn","checksum","validation","card-number","fintech"],"question":"On a card number entry screen you want to validate the number with the Luhn algorithm before sending it to the server. Which statements about Luhn validation are correct? **Select all that apply.**","source":{"kind":"community","company":"Capital One"}},{"id":"CS-041","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Infinite scroll cursors","tags":["pagination","cursor","infinite-scroll","deduplication"],"question":"In an endless iOS list like a pin board, you want to stop the same item showing twice or the next page going missing. If you use a cursor instead of an offset, what state would you store alongside it?","source":{"kind":"community","company":"Pinterest"}},{"id":"CS-042","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Inventory domain design","tags":["object-oriented-design","inventory","invariant","domain-model"],"question":"You're designing a Swift inventory system that processes receive, reserve, sell, and cancel operations in sequence. What domain type protects the invariants on stock quantities?","source":{"kind":"company","company":"Square"}},{"id":"CS-043","type":"short","category":"cs-fundamentals","difficulty":1,"topic":"Linked list intersection","tags":["linked-list","two-pointers","identity","algorithm"],"question":"Two singly linked lists may share their tail nodes. How do you find the first node they actually share (the same instance, not a node with an equal value) in O(n) time and O(1) extra space?","source":{"kind":"company","company":"Zoom"}},{"id":"CS-044","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Base-36 string addition","tags":["string","base36","carry","arithmetic"],"question":"You need to add two base-36 strings made of digits and letters without converting them to integers (so no overflow) and return the result as a string. How do you implement the per-digit conversion, carry handling, and leading zero removal?","source":{"kind":"company","company":"Bilibili"}},{"id":"CS-045","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"O(1) LRU cache","tags":["lru-cache","hash-map","linked-list","data-structure"],"question":"You're designing an LRU cache that keeps only recently used items. To make `get` and `put` average O(1), what does the HashMap do and what does the doubly linked list do?","source":{"kind":"community","company":"Deloitte"}},{"id":"CS-046","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"Shortest path with BFS","tags":["graph","bfs","visited-set","shortest-path"],"question":"A home decor recommender follows a graph of room-to-room connections to find the minimum number of moves. When every edge costs the same, why does BFS guarantee the shortest path?","source":{"kind":"company","company":"오늘의집"}},{"id":"CS-047","type":"short","category":"cs-fundamentals","difficulty":2,"topic":"HashMap vs Set","tags":["hashmap","set","complexity","swift"],"question":"In a one-hour coding test you have to find duplicates in a list of customer IDs and also count how often each ID appears. When would you use Swift's `Set` and when `Dictionary`?","source":{"kind":"community","company":"N26"}},{"id":"CS-048","type":"short","category":"cs-fundamentals","difficulty":1,"topic":"Balanced brackets","tags":["stack","brackets","string","algorithm"],"question":"A Swift string mixes `()[]{}` and you're checking with a stack whether they nest correctly. When you hit a closing bracket, what comparison do you make?","source":{"kind":"community","company":"Zalando"}},{"id":"MEM-001","type":"short","category":"memory-arc","difficulty":1,"topic":"ARC basics","tags":["arc","reference-counting","retain","release","lifetime"],"question":"What is ARC, and why do we need it?","source":{"kind":"company","company":"카카오"}},{"id":"MEM-002","type":"mcq","category":"memory-arc","difficulty":1,"topic":"strong / weak / unowned","tags":["weak","unowned","strong","optional"],"question":"Which of the following statements about `weak` references are **correct**? Select all that apply.","source":{"kind":"community"}},{"id":"MEM-003","type":"short","category":"memory-arc","difficulty":2,"topic":"Diagnosing reference cycles","tags":["retain-cycle","leak","memory-graph","deinit","weak"],"question":"A view controller doesn't seem to leave memory after you close its screen. How would you confirm there's actually a reference cycle?","source":{"kind":"community"}},{"id":"MEM-004","type":"mcq","category":"memory-arc","difficulty":2,"topic":"Closure capture and leaks","tags":["closure","capture","weak-self","retain-cycle"],"question":"Which of these two snippets **creates** a reference cycle?\n\n```swift\n// (A)\nfinal class VM {\n    var onChange: (() -> Void)?\n    func bind() { onChange = { self.reload() } }\n}\n// (B)\nfinal class VC {\n    func load() { DispatchQueue.global().async { self.parse() } }\n}\n```","source":{"kind":"community"}},{"id":"MEM-005","type":"short","category":"memory-arc","difficulty":2,"topic":"Choosing weak vs unowned","tags":["weak","unowned","lifetime","crash"],"question":"When would you use `unowned` instead of `weak`?","source":{"kind":"community"}},{"id":"MEM-006","type":"short","category":"memory-arc","difficulty":2,"topic":"Delegates and weak references","tags":["delegate","weak","anyobject","protocol"],"question":"You try to declare `weak var delegate: MyDelegate?` and the compiler rejects it. Why, and how do you fix it?","source":{"kind":"community"}},{"id":"MEM-007","type":"mcq","category":"memory-arc","difficulty":2,"topic":"When cycles happen","tags":["retain-cycle","timer","notification","closure","task"],"question":"Which of the following (with no extra measures) create a reference cycle or a permanent leak? Select all that apply.","source":{"kind":"community"}},{"id":"MEM-008","type":"short","category":"memory-arc","difficulty":3,"topic":"Core Foundation and ARC","tags":["core-foundation","unmanaged","toll-free-bridging","takeretainedvalue","cfrelease"],"question":"When you handle a Core Foundation object returned by a C API like `SecItemCopyMatching` or `CGImageSource` in Swift, when do you use `Unmanaged`, `takeRetainedValue()`, and `takeUnretainedValue()`? Tie it to the Create/Get rule.","source":{"kind":"original"}},{"id":"MEM-009","type":"short","category":"memory-arc","difficulty":2,"topic":"Retain cycle vs memory leak","tags":["retain-cycle","leak","abandoned-memory"],"question":"Are \"reference cycle\" and \"memory leak\" the same thing?","source":{"kind":"community"}},{"id":"MEM-010","type":"mcq","category":"memory-arc","difficulty":1,"topic":"Stack and heap","tags":["stack","heap","allocation","struct","class"],"question":"Which statement about the stack and the heap is **correct**?","source":{"kind":"community"}},{"id":"MEM-011","type":"short","category":"memory-arc","difficulty":3,"topic":"How closure capture works","tags":["closure","capture","capture-list","box","heap"],"question":"What actually happens in memory when a closure captures an outside variable? Using the output of the code below, explain the difference between using a capture list `[x]` and not using one.\n\n```swift\nvar count = 0\nlet a = { print(count) }\nlet b = { [count] in print(count) }\ncount = 10\na(); b()\n```","source":{"kind":"community"}},{"id":"MEM-012","type":"mcq","category":"memory-arc","difficulty":2,"topic":"Capture lists","tags":["closure","capture-list","value-capture"],"question":"What does this code print?\n\n```swift\nfinal class Counter { var n = 0 }\nlet c = Counter()\nvar tag = \"A\"\nlet f = { [c, tag] in print(c.n, tag) }\nc.n = 5\ntag = \"B\"\nf()\n```","source":{"kind":"original"}},{"id":"MEM-013","type":"short","category":"memory-arc","difficulty":4,"topic":"How weak works at runtime","tags":["weak","side-table","refcount","runtime","performance"],"question":"Why is it true that \"weak is slower than strong\"? Explain it with the Swift runtime's reference count layout: the inline refcount and the side table.","source":{"kind":"community"}},{"id":"MEM-014","type":"short","category":"memory-arc","difficulty":2,"topic":"MRC and autorelease","tags":["mrc","retain","release","autorelease","autoreleasepool","objective-c"],"question":"Before ARC, Objective-C code called `retain`, `release`, and `autorelease` directly. What did each one do, and what did ARC change?","source":{"kind":"community"}},{"id":"MEM-015","type":"mcq","category":"memory-arc","difficulty":2,"topic":"Using autoreleasepool","tags":["autoreleasepool","peak-memory","loop","uiimage"],"question":"This code spikes memory and gets the app killed. What's the most appropriate fix?\n\n```swift\nfor url in imageURLs {   // 5,000 of them\n    let data = try Data(contentsOf: url)\n    let image = UIImage(data: data)\n    let thumb = image?.preparingThumbnail(of: size)\n    save(thumb)\n}\n```","source":{"kind":"community"}},{"id":"MEM-016","type":"short","category":"memory-arc","difficulty":2,"topic":"Shallow vs deep copy","tags":["shallow-copy","deep-copy","nscopying","struct","class"],"question":"In `struct Order { var items: [Item]; let customer: Customer }`, `Item` is a struct and `Customer` is a class. After `var copy = order`, what happens to the original if you change `copy.customer.name`?","source":{"kind":"community"}},{"id":"MEM-017","type":"short","category":"memory-arc","difficulty":3,"topic":"iOS memory and Jetsam","tags":["virtual-memory","jetsam","memory-warning","background","footprint"],"question":"Sometimes an app you sent to the background comes back and starts from scratch. Explain this using how iOS manages memory: virtual memory, compression, and Jetsam.","source":{"kind":"community"}},{"id":"MEM-018","type":"mcq","category":"memory-arc","difficulty":3,"topic":"Class performance and ARC traffic","tags":["final","private","dispatch","arc-traffic","performance"],"question":"Which of these **actually improve** the performance of class-based code (dispatch and ARC cost)? Select all that apply.","source":{"kind":"community"}},{"id":"MEM-019","type":"short","category":"memory-arc","difficulty":3,"topic":"unowned crash scenario","tags":["unowned","crash","lifetime","closure","async"],"question":"This code, which loads an image asynchronously in a UITableView cell, crashes now and then. Under what condition does it crash, and why?\n\n```swift\nfinal class ImageCell: UITableViewCell {\n    func load(_ url: URL) {\n        loader.fetch(url) { [unowned self] image in\n            self.imageView?.image = image\n        }\n    }\n}\n```","source":{"kind":"original"}},{"id":"MEM-020","type":"short","category":"memory-arc","difficulty":4,"topic":"Memory layout","tags":["memorylayout","size","stride","alignment","existential","enum-layout"],"question":"What are `MemoryLayout<T>.size`, `stride`, and `alignment`, and why can the three differ? Use the struct below as your example.\n\n```swift\nstruct A { var a: Bool; var b: Int64; var c: Bool }\n```","source":{"kind":"original"}},{"id":"MEM-021","type":"mcq","category":"memory-arc","difficulty":2,"topic":"Objective-C property attributes","tags":["objective-c","copy","strong","nsstring","property-attribute"],"question":"In Objective-C, why do you use `copy` instead of `strong` for an `NSString` property, as in `@property (nonatomic, copy) NSString *name;`? Pick the best reason.","source":{"kind":"community"}},{"id":"MEM-022","type":"short","category":"memory-arc","difficulty":3,"topic":"Memory cost of value types","tags":["value-type","cow","arc-traffic","struct","existential","performance"],"question":"How far is it true that \"using a struct means no ARC cost\"?","source":{"kind":"community"}},{"id":"MEM-023","type":"mcq","category":"memory-arc","difficulty":3,"topic":"Judging unowned","tags":["unowned","weak","closure","lifetime"],"question":"In which of the following is a `[unowned self]` capture **safe**? Select all that apply.","source":{"kind":"original"}},{"id":"MEM-024","type":"short","category":"memory-arc","difficulty":4,"topic":"Advanced leak hunting","tags":["leak","instruments","malloc-stack","vm-tracker","cgimage","abandoned-memory"],"question":"Both the Leaks instrument and Memory Graph are clean, yet every time you go back and forth to a certain screen, memory on a real device grows by 30MB. What could be the cause in a case like this?","source":{"kind":"original"}},{"id":"MEM-025","type":"short","category":"memory-arc","difficulty":1,"topic":"Impact of memory leaks","tags":["leak","memory-warning","jetsam","user-impact"],"question":"What is a memory leak?","source":{"kind":"community"}},{"id":"MEM-026","type":"mcq","category":"memory-arc","difficulty":1,"topic":"When deinit runs","tags":["deinit","reference-count","lifetime"],"question":"What does this code print?\n\n```swift\nfinal class Session { deinit { print(\"bye\") } }\nvar a: Session? = Session()\nvar b = a\na = nil\nprint(\"1\")\nb = nil\nprint(\"2\")\n```","source":{"kind":"original"}},{"id":"MEM-027","type":"short","category":"memory-arc","difficulty":3,"topic":"Task and self capture","tags":["task","swift-concurrency","weak-self","capture","cancellation"],"question":"After moving to Swift Concurrency, your team is arguing about whether you always need `[weak self]` inside `Task { }`. When is it unnecessary, and in which Tasks is it required?","source":{"kind":"original"},"since":"Swift 5.5"},{"id":"MEM-028","type":"mcq","category":"memory-arc","difficulty":4,"topic":"Ownership modifiers and ~Copyable","tags":["ownership","borrowing","consuming","noncopyable","swift-5.9"],"question":"Which statement about Swift 5.9's ownership features (`borrowing`/`consuming` parameters, `~Copyable` types) is **correct**?","source":{"kind":"original"},"since":"Swift 5.9"},{"id":"MEM-029","type":"short","category":"memory-arc","difficulty":3,"topic":"Subscription lifetime","tags":["combine","cancellable","closure","weak-self","subscription"],"question":"In a live coding session you're handed the following Combine ViewModel. Add a feature that subscribes to the price stream and reflects it in `priceText`, and explain, with code, how you'd handle unsubscribing.\n\n```swift\nfinal class ProductViewModel {\n    @Published var priceText = \"\"\n    private let priceStream: AnyPublisher<Decimal, Never>\n    init(priceStream: AnyPublisher<Decimal, Never>) {\n        self.priceStream = priceStream\n    }\n}\n```","source":{"kind":"company","company":"쿠팡"},"since":"iOS 13"},{"id":"MEM-030","type":"mcq","category":"memory-arc","difficulty":2,"topic":"Spotting leak patterns","tags":["leak","timer","notificationcenter","closure","delegate"],"question":"Which of the following snippets keep a `ViewController` from being deallocated after it leaves the screen (that is, cause a leak)? Select all that apply. Each snippet runs in `viewDidLoad`, and `self` is a `UIViewController`.","source":{"kind":"company","company":"하이퍼커넥트"}},{"id":"MEM-031","type":"short","category":"memory-arc","difficulty":1,"topic":"weak vs strong","tags":["weak","strong","arc","reference-counting","optional"],"question":"Can you explain the difference between `weak` and `strong`?","source":{"kind":"company","company":"이베이코리아"}},{"id":"MEM-032","type":"short","category":"memory-arc","difficulty":3,"topic":"ARC follow-up drill","tags":["arc","retain-release","value-type","ownership","compiler"],"question":"Starting from \"explain ARC,\" the follow-ups keep coming. First: who inserts retain and release, and when?","source":{"kind":"company","company":"네이버웹툰"}},{"id":"MEM-033","type":"short","category":"memory-arc","difficulty":3,"topic":"ARC deallocation steps","tags":["arc","deinit","weak","unowned","lifecycle"],"question":"From the moment an object's last strong reference goes away until the memory is actually returned, what does ARC do? Walk me through it step by step.","source":{"kind":"company","company":"PayPal"}},{"id":"MEM-034","type":"mcq","category":"memory-arc","difficulty":2,"topic":"Rules of ARC and weak","tags":["arc","weak","compile-time","enum","value-type"],"question":"Which of the following statements about ARC and `weak` are **correct**? Select all that apply.","source":{"kind":"company","company":"Zomato"}},{"id":"MEM-035","type":"short","category":"memory-arc","difficulty":3,"topic":"Struct copies and COW buffers","tags":["struct","cow","array","memory-address","copy"],"question":"```swift\nstruct Example { var a: Int; var tags: [String] }\nlet s1 = Example(a: 1, tags: [\"x\"])\nvar s2 = s1\ns2.a = 9\n```\nAfter `s2.a = 9`, are the addresses where `s1.a` and `s2.a` are stored the same or different, and what about the buffer address of the `tags` array?","source":{"kind":"company","company":"Flipkart"}},{"id":"MEM-036","type":"short","category":"memory-arc","difficulty":3,"topic":"autorelease buildup in loops","tags":["autoreleasepool","runloop","foundation","bridging","peak-memory"],"question":"A for loop that runs fine on up to 5,000 records crashes after a memory warning above that. Inside the loop you slice and concatenate strings and repeatedly convert with `String(format:)` and `NSData`. The hint is 'autorelease'. Explain the cause.","source":{"kind":"company","company":"Microsoft"}},{"id":"MEM-037","type":"mcq","category":"memory-arc","difficulty":3,"topic":"atomic properties and increments","tags":["objective-c","atomic","thread-safety","race-condition","lock"],"question":"In Objective-C you declare `@property (atomic) int a;` and run `self.a = self.a + 1` a combined 10,000 times from several threads. Is `a` 10,000 at the end? And how do you get the same guarantee in Swift? Select all that apply.","source":{"kind":"company","company":"ByteDance"}},{"id":"MEM-038","type":"short","category":"memory-arc","difficulty":3,"topic":"Dangling pointers and Zombie Objects","tags":["dangling-pointer","zombie","exc-bad-access","asan","objective-c"],"question":"In what situations does a dangling (wild) pointer, one that touches a deallocated object, arise under ARC?","source":{"kind":"company","company":"Xiaohongshu"}},{"id":"MEM-039","type":"short","category":"memory-arc","difficulty":3,"topic":"ARC vs garbage collection","tags":["arc","garbage-collection","deterministic","design-rationale","jetsam"],"question":"iOS manages memory with reference counting (ARC). If you had to implement automatic memory management without reference counts, what approach could you take?","source":{"kind":"company","company":"Shopee"}},{"id":"MEM-040","type":"short","category":"memory-arc","difficulty":2,"topic":"Proving a leak fix","tags":["leak","memory-graph","instruments","regression-test","deinit"],"question":"Think of a memory leak you actually ran into. How did you find it, how did you pin down the cause, and how did you prove it was fixed?","source":{"kind":"company","company":"CRED"}},{"id":"MEM-041","type":"short","category":"memory-arc","difficulty":2,"topic":"Retain cycle example","tags":["retain-cycle","closure","singleton","weak-self","lifetime"],"question":"Give me a concrete code example that creates a retain cycle, and fix it.","source":{"kind":"community","company":"DoorDash"}},{"id":"MEM-042","type":"short","category":"memory-arc","difficulty":2,"topic":"Closure capture cycles","tags":["closures","retain-cycle","weak-self","arc"],"question":"A messaging app's ViewModel keeps a completion closure in a property for a long time, and inside it updates `self.messages`. What reference graph creates the retain cycle?","source":{"kind":"community","company":"Slack"}},{"id":"MEM-043","type":"short","category":"memory-arc","difficulty":1,"topic":"ARC ownership and deallocation timing","tags":["arc","ownership","deinit","strong-reference"],"question":"In an iOS app written in Swift, how does ARC manage the lifetime of a class instance?","source":{"kind":"community","company":"Teladoc Health"}},{"id":"MEM-044","type":"short","category":"memory-arc","difficulty":2,"topic":"Deep copy, shallow copy, and COW","tags":["copy","cow","value-semantics","memory"],"question":"In Swift you assign a large array to another variable with `var b = a` and then modify only `b`. Is what happens a shallow copy or a deep copy? Explain it together with Copy-on-Write.","source":{"kind":"company","company":"Xiaomi"}},{"id":"MEM-045","type":"short","category":"memory-arc","difficulty":3,"topic":"Stored closures and self lifetime","tags":["closure","retain-cycle","completion","lifetime"],"question":"A UIKit ViewController keeps an upload completion block in a property, and the block changes one of the ViewController's labels. After the upload finishes the closure is still sitting in that property. How would you break the loop between it and self?","source":{"kind":"company","company":"JD.com"}},{"id":"MEM-046","type":"short","category":"memory-arc","difficulty":2,"topic":"Finding who holds a view controller","tags":["memory-graph","viewcontroller","timer","observer"],"question":"You closed a UIKit screen but its ViewController stays in memory. Without just trusting the `deinit` log, how would you find who's holding it?","source":{"kind":"community","company":"Zillow"}},{"id":"MEM-047","type":"short","category":"memory-arc","difficulty":1,"topic":"unowned access risk","tags":["unowned","weak","runtime-trap","arc"],"question":"A coworker wants to declare every delegate `unowned` instead of `weak` because unwrapping optionals is a hassle. Why isn't an unowned reference optional?","source":{"kind":"community","company":"Deloitte"}},{"id":"MEM-048","type":"short","category":"memory-arc","difficulty":3,"topic":"Shared references inside value types","tags":["struct","class","value-semantics","reference"],"question":"A webtoon app's `Episode` struct has an `ImageCache` property of class type. If you copy the struct and change the cache on one side, what state is shared with the other?","source":{"kind":"company","company":"네이버웹툰"}},{"id":"NET-001","type":"short","category":"networking","difficulty":1,"topic":"URLSession structure","tags":["urlsession","urlsessionconfiguration","task","shared"],"question":"You've inherited an app that does all its networking through `URLSession.shared`. Can you walk me through the objects involved when URLSession handles one request (session, configuration, task) and what each one is responsible for?","source":{"kind":"community"}},{"id":"NET-002","type":"mcq","category":"networking","difficulty":1,"topic":"Background transfers","tags":["background-session","downloadtask","uploadtask"],"question":"In an app that uses URLSession, you want a large file download to keep going after the user sends the app to the Home screen, and to be handled correctly when it finishes. Select **all** the conditions you need.","source":{"kind":"original"}},{"id":"NET-003","type":"short","category":"networking","difficulty":1,"topic":"Codable JSON decoding","tags":["codable","decodable","jsondecoder","serialization"],"question":"The server responds with something like `{\"user_id\": 3, \"created_at\": \"2026-09-11T02:00:00Z\"}`. Can you walk me through how that response gets mapped onto a Swift model with Codable?","source":{"kind":"community"}},{"id":"NET-004","type":"short","category":"networking","difficulty":2,"topic":"Unstable response schemas","tags":["codable","optional","decodeifpresent","schema"],"question":"You're decoding responses into the model below with Codable, but the server includes the `nickname` field in some responses and leaves it out of others entirely. What happens with the current code?\n\n```swift\nstruct Profile: Decodable {\n    let id: Int\n    let nickname: String\n    let tags: [String]\n}\n```","source":{"kind":"community"}},{"id":"NET-005","type":"mcq","category":"networking","difficulty":2,"topic":"Predicting a Codable decode","tags":["codable","decodable","optional","null"],"question":"What happens when you run this Codable decoding code?\n\n```swift\nstruct Item: Decodable {\n    let id: Int\n    let name: String?\n    let price: Double\n}\nlet json = #\"{\"id\": 1, \"name\": null, \"price\": \"9.99\"}\"#\nlet item = try JSONDecoder().decode(Item.self, from: Data(json.utf8))\n```","source":{"kind":"original"}},{"id":"NET-006","type":"short","category":"networking","difficulty":2,"topic":"API error design","tags":["error-handling","result","typed-throws","http-status"],"question":"You've found network-layer code that collapses every failure into `completion(nil)`. As a senior engineer, how would you model API errors and carry them all the way to the screen?","source":{"kind":"community"},"since":"Swift 6"},{"id":"NET-007","type":"short","category":"networking","difficulty":2,"topic":"Retry strategy","tags":["retry","exponential-backoff","jitter","idempotency"],"question":"A payment confirmation API times out now and then. A junior engineer opened a PR that says \"if it fails, send it three more times.\" What would you point out?","source":{"kind":"community"}},{"id":"NET-008","type":"mcq","category":"networking","difficulty":2,"topic":"What to retry","tags":["retry","http-status","transient-error"],"question":"An idempotent GET request failed. Select **all** the failures where an automatic retry (with backoff) is appropriate.","source":{"kind":"original"}},{"id":"NET-009","type":"short","category":"networking","difficulty":2,"topic":"Response caching and memory cache","tags":["urlcache","nscache","http-cache","memory-warning"],"question":"An image-heavy feed app keeps getting memory warnings. How should the response cache have been set up?","source":{"kind":"community"}},{"id":"NET-010","type":"mcq","category":"networking","difficulty":2,"topic":"NSCache traits","tags":["nscache","dictionary","cache"],"question":"Select **all** the statements that correctly describe how `NSCache` differs from `Dictionary`.","source":{"kind":"community"}},{"id":"NET-011","type":"short","category":"networking","difficulty":4,"topic":"Network metrics and request priority","tags":["urlsessiontaskmetrics","priority","http2","connection-coalescing","circuit-breaker","observability"],"question":"A report says the app is slow only for users in one region, but the server metrics look normal. What would you measure in the app's network layer to split the cause into DNS, connect, TLS, server wait, and transfer?","source":{"kind":"original"},"since":"iOS 10"},{"id":"NET-012","type":"short","category":"networking","difficulty":3,"topic":"HTTPS and TLS","tags":["https","tls","certificate","ats","handshake"],"question":"When the app sends a request to `https://api.example.com`, what happens at the TLS level before the first byte comes back?","source":{"kind":"community"}},{"id":"NET-013","type":"short","category":"networking","difficulty":3,"topic":"Image upload pipeline","tags":["multipart","upload","heic","photokit","background-upload"],"question":"Say you're building a feature that uploads several profile photos. What does the multipart request that a library builds for you actually look like?","source":{"kind":"community"}},{"id":"NET-014","type":"mcq","category":"networking","difficulty":1,"topic":"URLComponents and URL encoding","tags":["urlcomponents","percent-encoding","query","url"],"question":"You want to send the search term `\"café & bar\"` as the query parameter `q` to `https://api.example.com/search`. Select **all** the correct statements about building the URL.","source":{"kind":"original"}},{"id":"NET-015","type":"mcq","category":"networking","difficulty":2,"topic":"HTTP/1.1 vs HTTP/2","tags":["http2","multiplexing","hpack","urlsession"],"question":"Select **all** the statements that correctly describe HTTP/2 compared with HTTP/1.1.","source":{"kind":"community"}},{"id":"NET-016","type":"short","category":"networking","difficulty":2,"topic":"Handling connectivity state","tags":["nwpathmonitor","waitsforconnectivity","reachability","connectivity","offline"],"question":"There's code that checks Reachability at launch so it can show a \"No internet connection\" popup. What's the problem with that approach?","source":{"kind":"original"},"since":"iOS 12"},{"id":"NET-017","type":"short","category":"networking","difficulty":3,"topic":"WebSocket connection management","tags":["websocket","urlsessionwebsockettask","reconnect","ping","background"],"question":"You've got a bug report that the chat app's WebSocket connection drops often and the app is slow to notice. How would you detect a dropped connection promptly on iOS?","source":{"kind":"community"},"since":"iOS 13"},{"id":"NET-018","type":"mcq","category":"networking","difficulty":1,"topic":"HTTP methods and idempotency","tags":["rest","http-method","idempotent"],"question":"In a REST API, select **all** the methods that are idempotent, meaning sending the same request several times leaves the server in the same state as sending it once.","source":{"kind":"community"}},{"id":"NET-019","type":"short","category":"networking","difficulty":3,"topic":"Diagnosing one network environment","tags":["debugging","wifi","captive-portal","proxy","ipv6","nwpathmonitor"],"question":"A report says image uploads work on cellular but fail only on the office Wi-Fi. What causes would you suspect?","source":{"kind":"community"}},{"id":"NET-020","type":"short","category":"networking","difficulty":2,"topic":"Synchronous requests and moving to async/await","tags":["async-await","urlsession","nsurlconnection","main-thread","semaphore"],"question":"The legacy code has a function that waits on a URLSession response with `DispatchSemaphore` to make it \"synchronous,\" and older spots still use `NSURLConnection.sendSynchronousRequest`. Why is that a problem?","source":{"kind":"community"},"since":"iOS 15"},{"id":"NET-021","type":"mcq","category":"networking","difficulty":3,"topic":"Canceling an async URLSession request","tags":["async-await","cancellation","task","urlerror"],"question":"In this Swift Concurrency code that sends a URLSession request, `task.cancel()` runs before the network response arrives. What happens?\n\n```swift\nlet task = Task {\n    do {\n        let (data, _) = try await URLSession.shared.data(from: url)\n        print(\"received \\(data.count)\")\n    } catch {\n        print(\"error: \\(error)\")\n    }\n}\ntask.cancel()\n```","source":{"kind":"original"},"since":"iOS 15"},{"id":"NET-022","type":"short","category":"networking","difficulty":3,"topic":"Token refresh concurrency","tags":["auth","token-refresh","actor","401","race-condition"],"question":"Five API calls go out at once when a screen appears, the access token has expired, and all five get a 401. Right now each request calls refresh on its own, so the server invalidates the refresh token and the user gets logged out. How would you fix it?","source":{"kind":"original"},"since":"Swift 5.5"},{"id":"NET-023","type":"short","category":"networking","difficulty":4,"topic":"Priorities in an API-to-list exercise","tags":["live-coding","architecture","error-handling","pagination","testing"],"question":"In a one-hour exercise you're asked to build an app that calls a public API and shows the results in a list, and you'll be graded on architecture, error handling, and UI performance. As a senior engineer, what would you build, in what order?","source":{"kind":"community","company":"PayPal"},"since":"iOS 17"},{"id":"NET-024","type":"mcq","category":"networking","difficulty":3,"topic":"URLSessionConfiguration options","tags":["urlsessionconfiguration","waitsforconnectivity","timeout"],"question":"In an app that uses URLSession, a user on the subway loses the connection for a moment. Instead of failing immediately, you want the request to wait until the connection comes back and then proceed on its own. Which setting fits best?","source":{"kind":"original"}},{"id":"NET-025","type":"short","category":"networking","difficulty":4,"topic":"Background session completion","tags":["background-session","handleeventsforbackgroundurlsession","downloadtask","delegate"],"question":"A large file is downloading through a background `URLSession` and the app gets terminated completely (by the system, not a swipe up). When the download finishes, what exactly has to happen in the app, in what order, so you don't lose the file?","source":{"kind":"original"}},{"id":"NET-026","type":"mcq","category":"networking","difficulty":4,"topic":"HTTP cache revalidation","tags":["urlcache","etag","cache-control","304"],"question":"A server response came with `Cache-Control: max-age=60` and `ETag: \"abc\"` and was stored in `URLCache`. With the default cache policy (`.useProtocolCachePolicy`), if you send the same GET **90 seconds later**, what does URLSession do?","source":{"kind":"original"}},{"id":"NET-027","type":"short","category":"networking","difficulty":3,"topic":"Image downloader and cache (request coalescing)","tags":["image-cache","nscache","actor","in-flight","cancellation","live-coding"],"question":"In a coding interview you're asked to build, in 30 minutes, an `ImageManager` that fetches an image by URL and returns it from cache if it's been fetched before. How would you handle several cells requesting the same URL at the same time?","source":{"kind":"company","company":"Apple"}},{"id":"NET-028","type":"mcq","category":"networking","difficulty":2,"topic":"Image download without third parties","tags":["urlsession","datatask","downloadtask","main-thread","cell-reuse"],"question":"At an onsite whiteboard you're asked to download images from a list of URLs and show them in list cells, without a library like Kingfisher. Select **all** the correct statements.","source":{"kind":"company","company":"Google"}},{"id":"NET-029","type":"short","category":"networking","difficulty":2,"topic":"Provided completion code and choosing an async style","tags":["async-await","continuation","combine","dependency-injection","live-coding"],"question":"In a coding screen the company hands you completion-handler-based networking code and a JSON file, asks for a list screen, and says you can use async/await, Combine, or completion handlers. Which would you choose, and how would you connect the provided code?","source":{"kind":"company","company":"DoorDash"},"since":"Swift 5.5"},{"id":"NET-030","type":"short","category":"networking","difficulty":3,"topic":"Search debounce, cancellation, and out-of-order responses","tags":["search","debounce","task-cancellation","race-condition","async-await"],"question":"You're asked to build, without third parties, a screen that calls a server search API on every keystroke in a search bar and refreshes the results list. How would you solve the problems a fast typist causes, using async/await?","source":{"kind":"company","company":"DoorDash"},"since":"Swift 5.5"},{"id":"NET-031","type":"short","category":"networking","difficulty":3,"topic":"Idempotency keys for transfers","tags":["idempotency","retry","payments","reliability","post"],"question":"The user taps the send money button, and the signal drops right after the request goes out. What should the app do?","source":{"kind":"company","company":"PayPal"}},{"id":"NET-032","type":"mcq","category":"networking","difficulty":3,"topic":"Handling a payment request timeout","tags":["timeout","idempotency","retry","urlsessionconfiguration","payments"],"question":"A payment confirmation request, `POST /payments`, failed with `URLError.timedOut`. Select **all** the correct statements.","source":{"kind":"community","company":"Revolut"}},{"id":"NET-033","type":"short","category":"networking","difficulty":2,"topic":"How HTTPS capture works and defending against it","tags":["https","mitm","proxy","certificate-pinning","charles","debugging"],"question":"How can tools like Charles and Proxyman show app traffic that's encrypted with HTTPS in plain text?","source":{"kind":"company","company":"ByteDance"}},{"id":"NET-034","type":"short","category":"networking","difficulty":3,"topic":"Resuming large downloads and integrity","tags":["range-request","resume-data","download-task","integrity","background-session"],"question":"You're downloading an audio file of several hundred MB, and the app gets terminated or the network drops. You want to resume instead of starting over. Which HTTP headers are involved?","source":{"kind":"company","company":"NetEase"}},{"id":"NET-035","type":"short","category":"networking","difficulty":2,"topic":"URLSession redirect handling","tags":["redirect","urlsession-delegate","authorization-header","302","307"],"question":"After login, a request sent with an `Authorization` header gets a `302` from the server to a different host, and then a `401` comes back. Why did that `401` happen?","source":{"kind":"company","company":"Tencent"}},{"id":"NET-036","type":"short","category":"networking","difficulty":2,"topic":"What HTTPDNS is for and its side effects","tags":["dns","httpdns","sni","cdn","server-trust"],"question":"There are reports that API access is slow, or lands on the wrong server, only for users on certain carriers and in certain regions, and a senior teammate says \"let's add HTTPDNS.\" What problem with regular DNS is HTTPDNS aimed at?","source":{"kind":"company","company":"Alibaba"}},{"id":"NET-037","type":"mcq","category":"networking","difficulty":3,"topic":"TLS 1.3 vs 1.2","tags":["tls","tls13","handshake","forward-secrecy","0-rtt"],"question":"The server team moved to TLS 1.3 and says app connections got faster. Select **all** the statements that correctly describe what changed from TLS 1.2 to 1.3.","source":{"kind":"company","company":"Meituan"}},{"id":"NET-038","type":"mcq","category":"networking","difficulty":1,"topic":"HTTP status codes","tags":["http","status-code","401","403","429"],"question":"Select **all** the correct statements about HTTP response status codes.","source":{"kind":"company","company":"카카오"}},{"id":"NET-039","type":"mcq","category":"networking","difficulty":2,"topic":"Sending JSON POST with URLRequest","tags":["urlrequest","post","content-type","status-code","code-review"],"question":"For a take-home assignment you wrote this code that POSTs JSON with `URLRequest`. Select **all** the statements that correctly describe problems with it.\n\n```swift\nfunc submit(_ body: Order) async throws -> Receipt {\n    var request = URLRequest(url: url)\n    request.httpMethod = \"POST\"\n    request.httpBody = try JSONEncoder().encode(body)\n    let (data, _) = try await URLSession.shared.data(for: request)\n    return try JSONDecoder().decode(Receipt.self, from: data)\n}\n```","source":{"kind":"company","company":"토스"}},{"id":"NET-040","type":"short","category":"networking","difficulty":2,"topic":"REST from the client's side","tags":["rest","http-method","idempotent","api-design","status-code"],"question":"The interviewer says \"explain what a RESTful API is.\" Going beyond the textbook definition, from the point of view of someone building an iOS client, how does the difference between an API designed RESTfully and one that isn't show up in the client code?","source":{"kind":"company","company":"이베이코리아"}},{"id":"NET-041","type":"short","category":"networking","difficulty":2,"topic":"Designing a networking layer on URLSession","tags":["networking-layer","endpoint","generic","error-handling","urlsession"],"question":"In a phone screen you're asked to design a simple networking layer in Swift. Without third parties, what types would you put on top of `URLSession`, and what is each one responsible for?","source":{"kind":"community","company":"Citi"}},{"id":"NET-042","type":"short","category":"networking","difficulty":2,"topic":"Fetching, sorting, and showing a JSON list (live coding)","tags":["json","codable","sorting","live-coding","date-decoding"],"question":"This is a senior iOS virtual onsite, live coding. You have to build, without searching, an app that fetches a list of content from a public JSON API, parses it, and shows it sorted by title or by date. With the sort requirement, what do you have to pay special attention to about the sort key's type and string comparison?","source":{"kind":"company","company":"Calm"}},{"id":"NET-043","type":"short","category":"networking","difficulty":2,"topic":"Parsing XML and a display transform layer","tags":["xml","xmlparser","parsing","take-home","presentation-layer"],"question":"A take-home assignment asks you to download an XML feed from the company's API, show it as a list, and add a feature that swaps the English strings for made-up \"Martian.\" How would you parse XML, rather than JSON, into a model in Swift without third parties?","source":{"kind":"community","company":"The New York Times"}},{"id":"NET-044","type":"mcq","category":"networking","difficulty":3,"topic":"Downloading large media","tags":["download-task","background-session","media","resume-data","discretionary"],"question":"You're building a feature that downloads video and audio files (hundreds of MB to GB) for offline playback. Select **all** the correct statements about a `URLSession`-based implementation.","source":{"kind":"community","company":"Sony"}},{"id":"NET-045","type":"mcq","category":"networking","difficulty":1,"topic":"Transport protocols and data link basics","tags":["tcp","udp","arp","osi","network-basics"],"question":"In a first-round iOS interview you get a networking fundamentals question: \"What protocols are in the transport layer, and what are frames and ARP in the data link layer?\" Select **all** the correct statements below.","source":{"kind":"company","company":"SAP"}},{"id":"NET-046","type":"short","category":"networking","difficulty":3,"topic":"REST snapshot plus WebSocket delta consistency","tags":["websocket","snapshot","sequence-number","orderbook","consistency"],"question":"This is an exchange app's order book and ticker screen. The design fetches the current snapshot over REST first and then applies only the changes (deltas) that arrive over WebSocket, but now and then the order book on screen drifts from reality. In what order, and by what rules, do you combine the snapshot and the delta stream so consistency doesn't break?","source":{"kind":"community","company":"코인원"}},{"id":"NET-047","type":"mcq","category":"networking","difficulty":3,"topic":"Live broadcast: HLS and WebSocket roles","tags":["hls","websocket","streaming","live","latency"],"question":"In a live audio broadcast app, the broadcast audio plays over HLS and chat goes over WebSocket. Select **all** the correct statements about the two protocols' characteristics and why each was chosen.","source":{"kind":"community","company":"스푼라디오"}},{"id":"NET-048","type":"short","category":"networking","difficulty":3,"topic":"FairPlay key exchange on HLS","tags":["hls","fairplay","drm","avcontentkeysession","offline-playback"],"question":"A music and video streaming app plays paid content over HLS and has to add FairPlay Streaming (DRM) for copyright protection. On top of the HLS playback flow, how does the FairPlay key exchange happen, in terms of the roles of the app, the key server, and AVFoundation?","source":{"kind":"community","company":"카카오엔터테인먼트"},"since":"iOS 11"},{"id":"PERF-001","type":"short","category":"performance","difficulty":1,"topic":"Xcode debugging features","tags":["xcode","debugging","breakpoint","lldb","view-debugger"],"question":"Once you've reproduced a bug, which Xcode debugging features do you actually reach for, beyond print statements? And when do you pull out each one?","source":{"kind":"community"}},{"id":"PERF-002","type":"mcq","category":"performance","difficulty":1,"topic":"Breakpoints","tags":["xcode","breakpoint","debugging"],"question":"Which of these can you do with Xcode breakpoints **without changing any code**? Select all that apply.","source":{"kind":"community"}},{"id":"PERF-003","type":"short","category":"performance","difficulty":2,"topic":"Instruments profiling","tags":["instruments","time-profiler","allocations","profiling"],"question":"All you've got is vague feedback that \"the app is slow.\" How do you approach that with Instruments?","source":{"kind":"community","company":"Apple"}},{"id":"PERF-004","type":"mcq","category":"performance","difficulty":1,"topic":"Picking an Instruments template","tags":["instruments","time-profiler"],"question":"Tapping a certain button freezes the screen for about a second. To see which function on the main thread is eating the time, which Instruments template do you open first?","source":{"kind":"original"}},{"id":"PERF-005","type":"short","category":"performance","difficulty":2,"topic":"Crash investigation process","tags":["crash","crashlytics","organizer","triage"],"question":"You get an alert that crashes spiked in the version you shipped yesterday. What do you do, and in what order?","source":{"kind":"community"}},{"id":"PERF-006","type":"short","category":"performance","difficulty":2,"topic":"Crash log symbolication","tags":["crash","dsym","symbolication","crash-log"],"question":"A user sends you a crash log and it only has hex addresses instead of function names. What do you need to make it readable?","source":{"kind":"community","company":"Apple"}},{"id":"PERF-007","type":"mcq","category":"performance","difficulty":2,"topic":"Identifying crash types","tags":["crash","exc_breakpoint","sigtrap","swift-runtime"],"question":"A crash report shows `EXC_BREAKPOINT (SIGTRAP)`. In a Swift app, which of these situations produce this type? Select **all** that apply.","source":{"kind":"original"}},{"id":"PERF-008","type":"short","category":"performance","difficulty":3,"topic":"Detecting OOM terminations","tags":["oom","jetsam","metrickit","memory","crashlytics"],"question":"Users say \"the app just closes,\" but Crashlytics has nothing. If you suspect out-of-memory (OOM) terminations, how do you confirm it and gather data?","source":{"kind":"company","company":"TikTok"},"since":"iOS 14"},{"id":"PERF-009","type":"short","category":"performance","difficulty":3,"topic":"Responding to memory warnings","tags":["memory-warning","image","nscache","downsampling","memory"],"question":"A photo editing app gets frequent memory warnings and sometimes gets killed. In what order would you track down the cause?","source":{"kind":"community"}},{"id":"PERF-010","type":"short","category":"performance","difficulty":2,"topic":"os_signpost intervals","tags":["os_signpost","logger","instruments","points-of-interest","measurement"],"question":"Someone reports that search results take too long to appear. Instead of printing timestamps, what would you use to measure each stage?","source":{"kind":"original"},"since":"iOS 12"},{"id":"PERF-011","type":"mcq","category":"performance","difficulty":2,"topic":"Causes of scroll stutter","tags":["scroll","main-thread","offscreen-rendering","autolayout"],"question":"You inherit an app whose UICollectionView stutters while scrolling. Which of these **can cause the stutter**? Select all that apply.","source":{"kind":"original"}},{"id":"PERF-012","type":"short","category":"performance","difficulty":3,"topic":"App launch time","tags":["launch-time","dyld","pre-main","app-launch","cold-start"],"question":"You take over an app whose cold start takes more than 3 seconds. How would you split up and measure the launch time?","source":{"kind":"original"}},{"id":"PERF-013","type":"mcq","category":"performance","difficulty":3,"topic":"Pre-main optimization","tags":["launch-time","dyld","pre-main","mergeable-libraries"],"question":"Which of these actually reduce the **pre-main** part of app launch (before `main()` is called)? Select all that apply.","source":{"kind":"original"},"since":"Xcode 15"},{"id":"PERF-014","type":"short","category":"performance","difficulty":2,"topic":"Navigation stack optimization","tags":["uinavigationcontroller","memory","view-controller","navigation"],"question":"Because of deep links or state restoration you have to push dozens of view controllers onto a UINavigationController in a row. What goes wrong if you just do that?","source":{"kind":"community","company":"Google"}},{"id":"PERF-015","type":"short","category":"performance","difficulty":3,"topic":"Memory bug diagnosis tools","tags":["memory","leaks","zombies","memory-graph","address-sanitizer","debugging"],"question":"Besides retain cycle leaks, what other kinds of memory bugs do you run into on iOS? And if one took you a long time to track down, which kind was it?","source":{"kind":"company","company":"TikTok"}},{"id":"PERF-016","type":"mcq","category":"performance","difficulty":2,"topic":"Matching a diagnostic tool","tags":["zombies","exc_bad_access","debugging"],"question":"An app you're debugging in Xcode throws an intermittent `EXC_BAD_ACCESS`, and you don't know which object is being accessed after it was deallocated. Which diagnostic option most directly tells you \"which class's instance received the message\"?","source":{"kind":"original"}},{"id":"PERF-017","type":"short","category":"performance","difficulty":3,"topic":"Diagnosing hangs","tags":["hang","main-thread","metrickit","thread-performance-checker","responsiveness"],"question":"Users report that a certain screen occasionally freezes for about a second, but you can't reproduce it in development. How do you narrow down the cause?","source":{"kind":"original"},"since":"iOS 16"},{"id":"PERF-018","type":"mcq","category":"performance","difficulty":1,"topic":"Data structure choice and performance","tags":["array","set","complexity","hash"],"question":"With the same 100,000 elements stored in each, which operations are **clearly faster** on a `Set` (NSSet) than on an `Array`? Select all that apply.","source":{"kind":"community"}},{"id":"PERF-019","type":"short","category":"performance","difficulty":2,"topic":"Approach to code optimization","tags":["optimization","measurement","algorithm","profiling"],"question":"You're asked to \"optimize this function, it's slow.\" What do you do before you touch the code?","source":{"kind":"company","company":"TikTok"}},{"id":"PERF-020","type":"mcq","category":"performance","difficulty":1,"topic":"Performance measurement conditions","tags":["measurement","release","device","profiling"],"question":"You want to measure app performance as the basis for optimization. Which are **correct measurement practices**? Select all that apply.","source":{"kind":"community","company":"Apple"}},{"id":"PERF-021","type":"short","category":"performance","difficulty":3,"topic":"App size optimization","tags":["app-size","app-thinning","asset-catalog","on-demand-resources","binary-size"],"question":"Your app's download size is over 200MB and users get the cellular download warning. How do you analyze where the size comes from?","source":{"kind":"original"}},{"id":"PERF-022","type":"mcq","category":"performance","difficulty":3,"topic":"Reading Animation Hitches","tags":["hitch","animation-hitches","instruments","commit","render","promotion"],"question":"You recorded scrolling with the Instruments **Animation Hitches** template. Which statements about reading the result are **correct**? Select all that apply.","source":{"kind":"original"},"since":"iOS 14"},{"id":"PERF-023","type":"short","category":"performance","difficulty":4,"topic":"Reading the Time Profiler call tree","tags":["time-profiler","call-tree","instruments","sampling"],"question":"You run Time Profiler and 80% of main thread time lands in `CA::Transaction::commit` or UIKit internals. Your own code doesn't show up. How do you read this result?","source":{"kind":"original"}},{"id":"PERF-024","type":"short","category":"performance","difficulty":4,"topic":"ARC traffic optimization","tags":["arc","swift_retain","time-profiler","borrowing","existential","optimization"],"question":"In Time Profiler, the top entries on the scrolling hot path are `swift_retain`, `swift_release`, and `swift_bridgeObjectRetain`. Why does this happen?","source":{"kind":"original"},"since":"Swift 5.9"},{"id":"PERF-025","type":"mcq","category":"performance","difficulty":4,"topic":"MetricKit","tags":["metrickit","diagnostics","hang","crash","launch-time"],"question":"Which of these can an app **actually receive** through MetricKit (`MXMetricManager`)? Select all that apply.","source":{"kind":"original"},"since":"iOS 14"},{"id":"PERF-026","type":"short","category":"performance","difficulty":4,"topic":"Investigating unreproducible production bugs","tags":["debugging","oslog","observability","feature-flag","production"],"question":"You have a production bug that affects 0.1% of users and never reproduces in development. How do you approach it?","source":{"kind":"community","company":"Apple"}},{"id":"PERF-027","type":"short","category":"performance","difficulty":2,"topic":"Spotting memory leaks and crashes in production","tags":["memory-leak","production","crash","metrickit","organizer"],"question":"A hiring manager asks: \"How do you find out there's a memory leak in an app that's **already shipped**, not one you're developing?\" Answer separately for local tools and production signals.","source":{"kind":"company","company":"Walmart"},"since":"iOS 14"},{"id":"PERF-028","type":"short","category":"performance","difficulty":2,"topic":"Where to start on scroll stutter","tags":["scroll","hitch","time-profiler","main-thread","image-decoding"],"question":"On a phone screen the interviewer asks: \"A user reports that scrolling stutters. Where would you start?\" Walk through the diagnostic order and what you look at in each step.","source":{"kind":"company","company":"PayPal"}},{"id":"PERF-029","type":"mcq","category":"performance","difficulty":3,"topic":"Post-main launch optimization","tags":["launch-time","post-main","first-frame","didfinishlaunching"],"question":"You want to cut app startup time. Which of these actually shorten the **post-main** stage, from `main()` to the first frame? Select all that apply.","source":{"kind":"company","company":"Microsoft"}},{"id":"PERF-030","type":"short","category":"performance","difficulty":3,"topic":"Memory pressure from large images","tags":["image","downsampling","imageio","memory","nscache"],"question":"You need to show a single 50MB photo on screen. If you just load it with `UIImage(contentsOfFile:)`, how much memory does it take?","source":{"kind":"company","company":"Trip.com"}},{"id":"PERF-031","type":"mcq","category":"performance","difficulty":2,"topic":"Computing decoded image memory","tags":["image","memory","bitmap","png","decoding"],"question":"You decode a 100×100 pixel RGBA PNG (3KB on disk) to draw it on screen. Which value is **closest** to the memory the bitmap takes?","source":{"kind":"company","company":"Kuaishou"}},{"id":"PERF-032","type":"short","category":"performance","difficulty":3,"topic":"Building an in-app hang monitor","tags":["hang","runloop","watchdog","main-thread","monitoring"],"question":"You want to add a feature to your in-house APM that captures a stack whenever the main thread stalls past a threshold. How would you detect jank from inside the app?","source":{"kind":"company","company":"Tencent"}},{"id":"PERF-033","type":"short","category":"performance","difficulty":3,"topic":"CPU vs GPU bottlenecks in dropped frames","tags":["frame-drop","gpu","cpu","offscreen-rendering","core-animation"],"question":"Can you explain the causes of dropped frames, split into the CPU side and the GPU side?","source":{"kind":"company","company":"Meituan"}},{"id":"PERF-034","type":"short","category":"performance","difficulty":4,"topic":"Designing a crash reporting system","tags":["crash-reporting","signal","mach-exception","dsym","symbolication"],"question":"You can't use third-party SDKs, so you have to **design your own crash log collection**. How do you catch and record a crash inside the app?","source":{"kind":"company","company":"Kuaishou"}},{"id":"PERF-035","type":"mcq","category":"performance","difficulty":2,"topic":"Crash collection for shipped apps","tags":["crash","production","organizer","metrickit","testflight"],"question":"For an app already on the App Store, which of these are **ways to detect and collect crashes**? Select all that apply.","source":{"kind":"company","company":"Didi"},"since":"iOS 14"},{"id":"PERF-036","type":"short","category":"performance","difficulty":2,"topic":"Using system resources efficiently","tags":["energy","battery","memory","network","resource-efficiency"],"question":"A phone screen question: \"When you design an iOS app, what do you keep in mind to use system resources (CPU, memory, network, battery, disk) efficiently?\" Give concrete criteria for each resource.","source":{"kind":"company","company":"Meta"}},{"id":"PERF-037","type":"mcq","category":"performance","difficulty":3,"topic":"Finding where the main thread is blocked","tags":["hang","main-thread","deadlock","debugging","backtrace"],"question":"After a certain action the app freezes completely (no input response). Which of these are valid ways to find **where the main thread is blocked**? Select all that apply.","source":{"kind":"company","company":"Xiaohongshu"}},{"id":"PERF-038","type":"short","category":"performance","difficulty":3,"topic":"Battery optimization for navigation apps","tags":["battery","energy","location","core-location","background"],"question":"Map and navigation apps use a lot of battery. How would you design one to minimize battery drain while keeping location tracking accurate?","source":{"kind":"community","company":"티맵모빌리티"}},{"id":"PERF-039","type":"short","category":"performance","difficulty":3,"topic":"Adopting and running app monitoring (APM)","tags":["monitoring","sentry","crashlytics","release-health","alerting"],"question":"If you were introducing monitoring like Sentry or Firebase Crashlytics to a team for the first time, which metrics would you define?","source":{"kind":"community","company":"밀리의서재"}},{"id":"PERF-040","type":"short","category":"performance","difficulty":3,"topic":"Instrumenting a 5 second screen load","tags":["performance","signpost","time-profiler","loading"],"question":"The account detail screen in a banking app takes 5 seconds to first display. To avoid fixing on gut feeling, into which stages would you split and measure those 5 seconds?","source":{"kind":"community","company":"HSBC"}},{"id":"PERF-041","type":"short","category":"performance","difficulty":2,"topic":"Finding the cause of freezes","tags":["hang","main-thread","metrickit","profiling"],"question":"Reviews of your shipped iOS app say it occasionally stops responding to touch for a few seconds. When it won't reproduce in the office, how do you get your hands on the stack from the moment the main thread stalled?","source":{"kind":"company","company":"Xiaomi"}},{"id":"PERF-042","type":"short","category":"performance","difficulty":2,"topic":"Leak investigation with Instruments","tags":["instruments","leaks","allocations","memory-graph"],"question":"Opening and closing a certain screen repeatedly makes the app's memory keep growing. In what order would you use Leaks, Allocations, and the Memory Graph?","source":{"kind":"community","company":"Comcast"}},{"id":"PERF-043","type":"short","category":"performance","difficulty":3,"topic":"Large image pipeline","tags":["images","downsampling","memory","imageio"],"question":"An iOS feature that edits and saves photos of tens of MB gets killed after a memory warning. From decoding to saving, how would you lower the memory peak?","source":{"kind":"community","company":"네이버"}},{"id":"PERF-044","type":"short","category":"performance","difficulty":2,"topic":"Baselines for performance improvements","tags":["performance","baseline","p95","regression"],"question":"You're reviewing a PR that claims the search results screen got 40% faster. It looks like it mixes the author's laptop simulator numbers with QA's real device numbers. How would you set the baseline and the metrics to verify the claim?","source":{"kind":"community","company":"마이리얼트립"}},{"id":"PERF-045","type":"short","category":"performance","difficulty":3,"topic":"Analyzing scroll hitches","tags":["scrolling","core-animation","prefetch","performance"],"question":"A photo feed collection view stutters while scrolling. How do you use Instruments to tell whether the cause is image decoding, layout computation, or cell setup?","source":{"kind":"community","company":"더스윙"}},{"id":"PERF-046","type":"short","category":"performance","difficulty":2,"topic":"Correlating crashes with performance","tags":["crash","symbolication","performance","observability"],"question":"Reviews of a secondhand marketplace app keep saying \"it gets slow and then closes.\" How do you connect crash logs with performance traces to decide which problem to fix first?","source":{"kind":"community","company":"중고나라"}},{"id":"PERF-047","type":"short","category":"performance","difficulty":2,"topic":"React Native performance boundaries","tags":["react-native","bridge","profiling","ios"],"question":"A chat screen built with React Native is slow on iOS. How do you separate whether the bottleneck is JavaScript rendering, calls across the native boundary, or a native module?","source":{"kind":"company","company":"뤼튼"}},{"id":"DATA-001","type":"short","category":"persistence","difficulty":1,"topic":"UserDefaults scope and limits","tags":["userdefaults","plist","storage"],"question":"A teammate's PR stores the access token, the profile image `Data`, and an array of 5,000 recently viewed products all in `UserDefaults`. What would you raise in review?","source":{"kind":"community"}},{"id":"DATA-002","type":"mcq","category":"persistence","difficulty":1,"topic":"Atomic file writes","tags":["filemanager","data-write","atomic","documents","file"],"question":"A notes app saves `Data` to `Documents/notes.json`. **Select all** the correct statements about file writes.\n\n```swift\ntry data.write(to: url, options: [.atomic])\n```","source":{"kind":"original"}},{"id":"DATA-003","type":"short","category":"persistence","difficulty":1,"topic":"Picking a local store","tags":["storage-choice","userdefaults","keychain","filemanager","swiftdata","core-data"],"question":"A new iOS project has to store a favorites list, the login session, downloaded PDFs, and display settings locally. Which store would you pick for each?","source":{"kind":"community"}},{"id":"DATA-004","type":"mcq","category":"persistence","difficulty":1,"topic":"Keychain characteristics","tags":["keychain","security","userdefaults"],"question":"Compared with `UserDefaults`, **select all** the correct characteristics of the Keychain.","source":{"kind":"community"}},{"id":"DATA-005","type":"short","category":"persistence","difficulty":2,"topic":"Choosing Core Data","tags":["core-data","swiftdata","sqlite","storage-choice"],"question":"Which requirements push you to Core Data (or SwiftData) instead of UserDefaults or a plain file?","source":{"kind":"community"}},{"id":"DATA-006","type":"short","category":"persistence","difficulty":2,"topic":"Core Data stack setup","tags":["core-data","nspersistentcontainer","nsmanagedobjectcontext","nsfetchrequest","nsfetchedresultscontroller"],"question":"You have a bug where a screen backed by Core Data adds an item but the list never updates. Where is that bug most likely coming from?","source":{"kind":"community"}},{"id":"DATA-007","type":"mcq","category":"persistence","difficulty":2,"topic":"Context threading rules","tags":["core-data","threading","nsmanagedobjectid","background-context"],"question":"This is a news app on Core Data. You fetched an `Article` on a background context (`container.newBackgroundContext()`), handed the object straight to a view on the main thread, and read `article.title`. Which statement is correct?","source":{"kind":"community"}},{"id":"DATA-008","type":"short","category":"persistence","difficulty":2,"topic":"Core Data vs SQLite","tags":["core-data","sqlite","grdb","realm"],"question":"A teammate says \"Core Data is heavy and hard to understand, let's use SQLite directly (or GRDB).\" What's the real difference between the two approaches?","source":{"kind":"community"}},{"id":"DATA-009","type":"short","category":"persistence","difficulty":3,"topic":"Core Data migration","tags":["core-data","migration","lightweight-migration","mapping-model"],"question":"You shipped an update to a Core Data app and crash reports are pouring in. The log says \"The model used to open the store is incompatible with the one used to create the store.\" What happened?","source":{"kind":"community"}},{"id":"DATA-010","type":"mcq","category":"persistence","difficulty":3,"topic":"Lightweight migration scope","tags":["core-data","migration","lightweight-migration"],"question":"**Select all** the changes Core Data handles with **lightweight migration**, with no mapping model.","source":{"kind":"community"}},{"id":"DATA-011","type":"short","category":"persistence","difficulty":2,"topic":"Archiving and plists","tags":["nscoding","nssecurecoding","nskeyedarchiver","plist","codable"],"question":"Legacy code saves model objects to a file with `NSKeyedArchiver`, and on recent OS versions unarchiving started warning and crashing. What's the difference between `NSCoding` and `NSSecureCoding`?","source":{"kind":"community"}},{"id":"DATA-012","type":"mcq","category":"persistence","difficulty":2,"topic":"Relational vs object DB","tags":["sqlite","nosql","realm","rdbms"],"question":"**Select all** the **sound** reasons to pick a SQLite-backed relational store (Core Data, SwiftData, GRDB) over a document or object database such as Realm for an iOS app's local storage.","source":{"kind":"community"}},{"id":"DATA-013","type":"short","category":"persistence","difficulty":3,"topic":"Faulting and save","tags":["core-data","faulting","nsmanagedobject","save","row-cache"],"question":"You fetched 10,000 objects from Core Data and memory barely moved, and then it grows a little as you scroll the list. Explain what's going on inside.","source":{"kind":"community"}},{"id":"DATA-014","type":"mcq","category":"persistence","difficulty":2,"topic":"NSFetchedResultsController","tags":["core-data","nsfetchedresultscontroller","uitableview"],"question":"On a Core Data list screen, what does `NSFetchedResultsController` do, most precisely?","source":{"kind":"community"}},{"id":"DATA-015","type":"short","category":"persistence","difficulty":2,"topic":"SwiftData building blocks","tags":["swiftdata","model","modelcontainer","modelcontext","query"],"question":"Say you're building a to-do app with SwiftData. What do `@Model`, `ModelContainer`, `ModelContext`, and `@Query` each do?","source":{"kind":"original"},"since":"iOS 17"},{"id":"DATA-016","type":"mcq","category":"persistence","difficulty":2,"topic":"SwiftData facts","tags":["swiftdata","model","core-data"],"question":"**Select all** the correct statements about SwiftData.","source":{"kind":"original"},"since":"iOS 17"},{"id":"DATA-017","type":"short","category":"persistence","difficulty":3,"topic":"SwiftData schema migration","tags":["swiftdata","migration","versionedschema","schemamigrationplan"],"question":"You shipped a SwiftData app and now want to add a `priority` field to `Todo` and clean up existing `title` values by trimming whitespace. Which change happens automatically, and which one needs `VersionedSchema` and `SchemaMigrationPlan`?","source":{"kind":"original"},"since":"iOS 17"},{"id":"DATA-018","type":"short","category":"persistence","difficulty":2,"topic":"Sandbox directories and backup","tags":["filemanager","documents","caches","tmp","backup","sandbox"],"question":"Users complain that the app takes up 2GB of their iCloud backup, and review flagged you on the offline data storage guideline. Walk me through the app sandbox directories and the backup and cleanup policy for each.","source":{"kind":"original"}},{"id":"DATA-019","type":"mcq","category":"persistence","difficulty":1,"topic":"Choosing a directory","tags":["filemanager","caches","documents"],"question":"You want to store a few thousand thumbnail images locally that you can download again at any time. Which directory fits best?","source":{"kind":"original"}},{"id":"DATA-020","type":"short","category":"persistence","difficulty":3,"topic":"Data Protection classes","tags":["data-protection","file-protection","encryption","background","keychain-accessibility"],"question":"You have logs where the app, woken by a background push while the screen is locked, fails to open its local database. What is file protection (Data Protection) on iOS?","source":{"kind":"original"}},{"id":"DATA-021","type":"short","category":"persistence","difficulty":3,"topic":"Background saves and merging","tags":["core-data","background-context","merge","automaticallymergeschangesfromparent","performbackgroundtask"],"question":"You have two complaints: data saved on a background context doesn't refresh the main screen, and the other way around, values being edited on main get overwritten. How should you set up the background save to main flow in Core Data?","source":{"kind":"original"}},{"id":"DATA-022","type":"mcq","category":"persistence","difficulty":3,"topic":"Merge policy behavior","tags":["core-data","mergepolicy","conflict"],"question":"This is a notes app on Core Data. A background context changed `note.body` to the server's value and finished saving first. The main context, which doesn't know that, edited only `note.title` and called `save()`. With the main context's `mergePolicy` set to `NSMergeByPropertyObjectTrumpMergePolicy`, what's the result?","source":{"kind":"original"}},{"id":"DATA-023","type":"short","category":"persistence","difficulty":4,"topic":"CloudKit sync constraints","tags":["cloudkit","nspersistentcloudkitcontainer","swiftdata","sync","conflict"],"question":"You want to add iCloud sync across devices to a SwiftData/Core Data app that has been local only. What do you have to change in the schema and the design before you turn on `NSPersistentCloudKitContainer` (or SwiftData's `cloudKitDatabase`)?","source":{"kind":"original"}},{"id":"DATA-024","type":"short","category":"persistence","difficulty":4,"topic":"Bulk insert performance","tags":["core-data","nsbatchinsertrequest","performance","memory","autoreleasepool"],"question":"An initial sync saves 100,000 records into Core Data, memory climbs to 1GB and the app gets killed, and the UI freezes the whole time. What do you think the causes are?","source":{"kind":"original"},"since":"iOS 13"},{"id":"DATA-025","type":"mcq","category":"persistence","difficulty":4,"topic":"Store sharing with extensions","tags":["app-group","widget","sqlite","persistent-history","multi-process"],"question":"You want a widget extension to read the main app's SwiftData/Core Data store. **Select all** the correct statements.","source":{"kind":"original"},"since":"iOS 11"},{"id":"DATA-026","type":"short","category":"persistence","difficulty":4,"topic":"Server sync design","tags":["sync","delta-sync","tombstone","offline","conflict"],"question":"You need to sync a notes app's local database with the server. Downloading everything each time is slow and burns data. How would you design a delta sync protocol?","source":{"kind":"original"}},{"id":"DATA-027","type":"short","category":"persistence","difficulty":1,"topic":"Persistence tools you've used","tags":["userdefaults","keychain","swiftdata","file-storage","take-home"],"question":"This is a written question on a take-home: \"Which tools have you used to persist data so far?\" Answer with what data you used each tool for and why, not with a list of names.","source":{"kind":"company","company":"Headspace"},"since":"iOS 17"},{"id":"DATA-028","type":"short","category":"persistence","difficulty":2,"topic":"Server and local models","tags":["dto","domain-model","swiftdata","schema-evolution","mapper"],"question":"A phone screen asked how you design data models on the backend and how you handle them on mobile. If you use the server's response JSON structure as your local database entity as is, what goes wrong when the response format changes later?","source":{"kind":"company","company":"Bloomberg"},"since":"iOS 17"},{"id":"DATA-029","type":"short","category":"persistence","difficulty":2,"topic":"Keychain access groups","tags":["keychain","access-group","entitlements","app-group","security"],"question":"Two payment apps from the same team, the main app and a merchant app, have to share one login token. UserDefaults and files are out, so on what conditions and how do you share it through the Keychain?","source":{"kind":"company","company":"PhonePe"}},{"id":"DATA-030","type":"mcq","category":"persistence","difficulty":3,"topic":"Contexts for parallel downloads","tags":["core-data","managed-object-context","background-context","merge","threading"],"question":"You're downloading image metadata in parallel on four threads and saving it to Core Data. **Select all** the correct statements about how many `NSManagedObjectContext`s you need and how to set them up.","source":{"kind":"company","company":"PhonePe"}},{"id":"DATA-031","type":"short","category":"persistence","difficulty":3,"topic":"Key-value store with expiry","tags":["userdefaults","ttl","sqlite","index","cache","live-coding"],"question":"You're given 15 minutes to design a key-value store whose values carry an expiry time. `set(key, value, ttl)` and `get(key)` must never hand back an expired value, and starting with UserDefaults is fine. How would you design it?","source":{"kind":"company","company":"Zomato"}},{"id":"DATA-032","type":"short","category":"persistence","difficulty":2,"topic":"NSCache vs custom LRU","tags":["nscache","lru","linked-list","image-cache","memory"],"question":"NSCache exists, so why do image libraries write their own LRU cache?","source":{"kind":"company","company":"ByteDance"}},{"id":"DATA-033","type":"mcq","category":"persistence","difficulty":2,"topic":"LRU behavior and structure","tags":["lru","cache","hit-rate","linked-list","hashmap"],"question":"You picked LRU for an image cache. **Select all** the correct statements about LRU.","source":{"kind":"company","company":"Shopee"}},{"id":"DATA-034","type":"short","category":"persistence","difficulty":2,"topic":"ObjC runtime model mapping","tags":["objective-c","runtime","kvc","codable","nssecurecoding","yymodel"],"question":"In the Objective-C days, YYModel and MJExtension turned JSON into models and even handled NSCoding archiving from nothing but the class definition. Which runtime feature made that possible?","source":{"kind":"company","company":"Alibaba"},"since":"Swift 4"},{"id":"DATA-035","type":"short","category":"persistence","difficulty":3,"topic":"Offline chat storage design","tags":["offline-first","chat","outbox","sync","swiftdata","idempotency"],"question":"Chat in a secondhand marketplace app has to work for reading and writing on the subway. Design the local database schema and the sync flow so that messages sent offline reach the server later and order, duplicates, and read state stay straight.","source":{"kind":"community","company":"당근"},"since":"iOS 17"},{"id":"DATA-036","type":"short","category":"persistence","difficulty":2,"topic":"Realm vs Apple stack","tags":["realm","swiftdata","core-data","threading","migration","swift6"],"question":"A legacy app leans on Realm heavily. As the new hire you're asked whether to stay on Realm or move to SwiftData/Core Data. How do Realm's threading and object model differ from the Apple stack?","source":{"kind":"community","company":"왓챠"},"since":"iOS 17"},{"id":"DATA-037","type":"mcq","category":"persistence","difficulty":3,"topic":"LFU cache characteristics","tags":["lfu","lru","cache","eviction","algorithm"],"question":"Someone proposes moving the image cache from LRU to LFU. **Select all** the correct statements about LFU.","source":{"kind":"company","company":"Pinduoduo"}},{"id":"DATA-038","type":"mcq","category":"persistence","difficulty":2,"topic":"Matching stores to requirements","tags":["storage","userdefaults","keychain","caches","app-group","swiftdata"],"question":"**Select all** the pairs where a finance app's storage requirement is matched with the right store.","source":{"kind":"community","company":"Capital One"}},{"id":"SEC-001","type":"short","category":"security","difficulty":1,"topic":"Code signing and integrity","tags":["code-signing","integrity","entitlements","provisioning","security"],"question":"Why does an iOS app have to be code signed before it runs? Focus on what the signature guarantees from a security point of view.","source":{"kind":"original"}},{"id":"SEC-002","type":"mcq","category":"security","difficulty":1,"topic":"Keychain accessibility","tags":["keychain","accessibility","backup"],"question":"You want a Keychain item that never moves to another device through a backup restore and can only be read while the device is unlocked. Which `kSecAttrAccessible` value do you use?","source":{"kind":"original"}},{"id":"SEC-003","type":"short","category":"security","difficulty":2,"topic":"App Transport Security","tags":["ats","https","tls","info-plist"],"question":"A legacy partner API still supports only HTTP, so your app's requests fail. What is ATS, the policy blocking them?","source":{"kind":"community"}},{"id":"SEC-004","type":"short","category":"security","difficulty":3,"topic":"Certificate pinning","tags":["ssl-pinning","certificate","public-key","urlsession","mitm"],"question":"How would you implement certificate pinning (SSL pinning) on iOS?","source":{"kind":"community"}},{"id":"SEC-005","type":"mcq","category":"security","difficulty":2,"topic":"Certificate pinning","tags":["ssl-pinning","rotation"],"question":"An app pins by hardcoding the SHA-256 hash of the leaf certificate. What happens first when the server renews that certificate?","source":{"kind":"original"}},{"id":"SEC-006","type":"short","category":"security","difficulty":2,"topic":"Biometric authentication","tags":["localauthentication","faceid","touchid","biometrics","secaccesscontrol"],"question":"This code sets `isUnlocked = true` when Face ID succeeds and opens the transfer screen. What's the security weakness in this approach?\n\n```swift\nlet ctx = LAContext()\nctx.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics,\n                   localizedReason: \"Confirm transfer\") { ok, _ in\n    if ok { self.isUnlocked = true }\n}\n```","source":{"kind":"community"}},{"id":"SEC-007","type":"mcq","category":"security","difficulty":2,"topic":"Jailbreak detection","tags":["jailbreak","detection"],"question":"Which heuristics are actually used to guess whether a device is jailbroken? Pick **all** that apply.","source":{"kind":"community"}},{"id":"SEC-008","type":"short","category":"security","difficulty":1,"topic":"Jailbroken devices","tags":["jailbreak","threat-model","policy"],"question":"What does your app lose on a jailbroken device?","source":{"kind":"community"}},{"id":"SEC-009","type":"short","category":"security","difficulty":3,"topic":"Security versus convenience","tags":["fintech","ux","threat-model","session"],"question":"In a financial app, how do you decide when a security requirement conflicts with user convenience? Say, session length, how often you re-authenticate, or blocking screenshots.","source":{"kind":"community"}},{"id":"SEC-010","type":"mcq","category":"security","difficulty":1,"topic":"Hardcoded secrets","tags":["api-key","secrets","hardcoding"],"question":"Which statement about the security problem in this code from an iOS app's source is most accurate?\n\n```swift\nenum API {\n    static let key = \"sk_live_9f8a7b6c5d4e\"\n    static let base = URL(string: \"https://api.example.com\")!\n}\n```","source":{"kind":"original"}},{"id":"SEC-011","type":"short","category":"security","difficulty":1,"topic":"Cryptography basics","tags":["cryptokit","aes","rsa","hash","symmetric","asymmetric"],"question":"In cryptography, when do you use symmetric keys, asymmetric keys, and hashes?","source":{"kind":"company","company":"카카오"},"since":"iOS 13"},{"id":"SEC-012","type":"mcq","category":"security","difficulty":2,"topic":"CryptoKit AEAD","tags":["cryptokit","aead","aes-gcm","chachapoly"],"question":"Which CryptoKit APIs are AEAD, encrypting and detecting tampering at the same time? Pick **all** that apply.","source":{"kind":"community"},"since":"iOS 13"},{"id":"SEC-013","type":"short","category":"security","difficulty":3,"topic":"OAuth login flow","tags":["oauth","pkce","aswebauthenticationsession","wkwebview","sso"],"question":"A PR handles social login by loading the login page inside a `WKWebView`. Why isn't that approach recommended?","source":{"kind":"original"},"since":"iOS 12"},{"id":"SEC-014","type":"short","category":"security","difficulty":3,"topic":"Token lifetime","tags":["access-token","refresh-token","keychain","401","race"],"question":"Your app keeps the access and refresh tokens in the Keychain and refreshes when it gets a 401. How do you stop duplicate refreshes when several requests get a 401 at the same time?","source":{"kind":"original"},"since":"Swift 5.5"},{"id":"SEC-015","type":"mcq","category":"security","difficulty":3,"topic":"Privacy Manifest","tags":["privacy-manifest","required-reason-api","app-tracking-transparency","privacy","app-store"],"question":"App Store review sent you an `ITMS-91053: Missing API declaration` warning. Which statements about the Privacy Manifest, Required Reason APIs, and ATT are correct? Pick **all** that apply.","source":{"kind":"original"},"since":"iOS 17"},{"id":"SEC-016","type":"short","category":"security","difficulty":2,"topic":"Hiding the screen","tags":["snapshot","app-switcher","screenshot","screen-recording","privacy"],"question":"QA reports that the balance is still visible in the app switcher after you leave the account screen for the home screen. How do you handle it?","source":{"kind":"community"}},{"id":"SEC-017","type":"mcq","category":"security","difficulty":2,"topic":"WKWebView bridge","tags":["wkwebview","javascript-bridge","xss","webview"],"question":"You built a bridge with `WKScriptMessageHandler` so a web page can call native functions, such as reading a token or opening checkout. Which measures do you need to run it safely? Pick **all** that apply.","source":{"kind":"original"},"since":"iOS 14"},{"id":"SEC-018","type":"short","category":"security","difficulty":4,"topic":"Reverse engineering","tags":["obfuscation","reverse-engineering","symbols","anti-tamper","strings"],"question":"There's a report that a competitor decompiled your app and copied the API call format and the promotion logic outright. What can you do to make reverse engineering an iOS app harder?","source":{"kind":"community"}},{"id":"SEC-019","type":"short","category":"security","difficulty":4,"topic":"App Attest","tags":["app-attest","devicecheck","attestation","secure-enclave","bot"],"question":"Bots call your API directly and clear out the coupons. How do you use App Attest so the server accepts only requests from your real App Store app?","source":{"kind":"original"},"since":"iOS 14"},{"id":"SEC-020","type":"mcq","category":"security","difficulty":3,"topic":"Secure Enclave","tags":["secure-enclave","cryptokit","private-key"],"question":"Which statements about a key created with CryptoKit's `SecureEnclave.P256.Signing.PrivateKey` are correct? Pick **all** that apply.","source":{"kind":"original"},"since":"iOS 13"},{"id":"SEC-021","type":"short","category":"security","difficulty":2,"topic":"Security checklist","tags":["best-practices","checklist","owasp-masvs"],"question":"If you were writing up iOS app security best practices in priority order for a team starting a new project, what would you put in it?","source":{"kind":"community","company":"Apple"}},{"id":"SEC-022","type":"short","category":"security","difficulty":4,"topic":"Deep link security","tags":["deep-link","universal-link","url-scheme","open-redirect","input-validation"],"question":"A feature opens the transfer screen from a deep link on the `myapp://pay` scheme with `to=<account>&amount=<amount>` parameters. What attacks does that allow?","source":{"kind":"original"}},{"id":"SEC-023","type":"mcq","category":"security","difficulty":1,"topic":"What HTTPS covers","tags":["https","tls","threat-model"],"question":"If an app does all its communication over HTTPS, which of these is **not** guaranteed by that alone?","source":{"kind":"community"}},{"id":"SEC-024","type":"short","category":"security","difficulty":3,"topic":"Log and SDK leaks","tags":["logging","pii","crashlytics","analytics","privacy-manifest","oslog"],"question":"Going through crash reports you find user emails and tokens printed straight into log messages. How would you design against personal data leaking through logging, crash, and analytics SDKs?","source":{"kind":"original"},"since":"iOS 17"},{"id":"SEC-025","type":"short","category":"security","difficulty":4,"topic":"Assessing intercepted traffic","tags":["mitm","proxy","charles","pinning","threat-model","risk"],"question":"QA reports that with a Charles proxy in place they see every API request and response from your app in the clear. How do you decide whether that's a real security problem?","source":{"kind":"original"}},{"id":"SEC-026","type":"mcq","category":"security","difficulty":2,"topic":"Keychain data left behind","tags":["keychain","reinstall","logout","first-launch"],"question":"Someone reported a bug where a user deletes the app, reinstalls it, and gets signed in automatically with the old account. What's the cause and the standard fix?","source":{"kind":"community"}},{"id":"SEC-027","type":"short","category":"security","difficulty":3,"topic":"Login across sibling apps","tags":["keychain","access-group","session","logout","shared-login","objective-c"],"question":"Several apps from one company (the main app, a payments app, a cloud app) should share login state once the user signs in to any of them. How do you implement that on iOS?","source":{"kind":"company","company":"Alibaba"},"estimatedMinutes":5},{"id":"SEC-028","type":"short","category":"security","difficulty":3,"topic":"Hijacked web pages","tags":["hijacking","dns","https","wkwebview","ats","httpdns"],"question":"Users report that the campaign page you load in an in-app WKWebView shows carrier or router ads injected into it, or jumps to an unrelated site. What kind of attack is this?","source":{"kind":"company","company":"Alibaba"},"estimatedMinutes":5},{"id":"SEC-029","type":"short","category":"security","difficulty":3,"topic":"Session token lifetime","tags":["token","session","replay","device-binding","app-attest","expiry"],"question":"Your app puts the token the server returned at login into the header of every request. An interviewer asks when that token is created and when it expires, so how do you answer?","source":{"kind":"company","company":"Ant Group"},"estimatedMinutes":5},{"id":"SEC-030","type":"short","category":"security","difficulty":3,"topic":"Request signing","tags":["hmac","signature","nonce","timestamp","integrity","replay"],"question":"If you designed the protocol between your app and the server yourself, how would you let the server notice that the contents changed in transit? Assume you already use HTTPS.","source":{"kind":"company","company":"Baidu"},"estimatedMinutes":5},{"id":"SEC-031","type":"mcq","category":"security","difficulty":2,"topic":"Hybrid encryption","tags":["https","tls","rsa","aes","hybrid-encryption","key-exchange"],"question":"Why doesn't HTTPS (TLS) encrypt all the data with the server's public key (RSA/ECC), instead exchanging a symmetric key and sending the data with a symmetric cipher such as AES? Pick the most accurate explanation.","source":{"kind":"company","company":"Tencent"}},{"id":"SEC-032","type":"short","category":"security","difficulty":3,"topic":"Pinning and key rotation","tags":["pinning","certificate","public-key","rotation","spki","backup-pin"],"question":"Your app pins the server's public key, and your security policy rotates the server certificate and key on a schedule. How does the client learn the new public key, so users on the old app version aren't all cut off right after a rotation?","source":{"kind":"company","company":"Meituan"},"estimatedMinutes":5},{"id":"SEC-033","type":"mcq","category":"security","difficulty":2,"topic":"Proxies decrypting HTTPS","tags":["charles","proxy","mitm","certificate","pinning","ats","objective-c"],"question":"What conditions have to hold before a tool like Charles or Proxyman can show an app's HTTPS request bodies in the clear? Pick **all** that apply.","source":{"kind":"company","company":"ByteDance"}},{"id":"SEC-034","type":"short","category":"security","difficulty":3,"topic":"Limits of HTTPS","tags":["https","tls","attack","dns","downgrade","pinning","defense-in-depth"],"question":"Why can't you call communication absolutely safe just because you use HTTPS, and which well-known attacks still work there?","source":{"kind":"company","company":"Shopee"},"estimatedMinutes":5},{"id":"SEC-035","type":"mcq","category":"security","difficulty":2,"topic":"Keychain sharing between apps","tags":["keychain","access-group","entitlements","app-group","team-id"],"question":"Two iOS apps want to read and write each other's Keychain data. What does that require? Pick **all** that apply.","source":{"kind":"company","company":"PhonePe"}},{"id":"SEC-036","type":"short","category":"security","difficulty":3,"topic":"Secrets left in memory","tags":["memory","sensitive-data","zeroing","string","secure-enclave","fintech"],"question":"A security audit says card numbers, passwords, and PINs stay in process memory after they're entered and processed, so they can leak through a memory dump or a crash log. How far can you solve that in Swift and iOS?","source":{"kind":"community","company":"스노우온카드"},"estimatedMinutes":5},{"id":"SEC-037","type":"short","category":"security","difficulty":2,"topic":"In-app purchase flow","tags":["storekit","iap","receipt","verification","jws","fraud"],"question":"In a mobile game, what does an in-app purchase go through from the user's tap to the item being granted on the server?","source":{"kind":"community","company":"넥슨"},"since":"iOS 15","estimatedMinutes":4},{"id":"SEC-038","type":"mcq","category":"security","difficulty":2,"topic":"Where credentials go","tags":["keychain","credentials","token","storage","data-protection"],"question":"You need to keep the API token and user credentials you received after login on the device. Which storage approaches are acceptable from a security point of view? Pick **all** that apply.","source":{"kind":"community","company":"JPMorgan"}},{"id":"SEC-039","type":"short","category":"security","difficulty":3,"topic":"Layered defense for transfers","tags":["security","banking","tls","keychain"],"question":"You're designing the transfer feature of an iOS banking app. Which layers of defense would you put on the client and the server to protect a single transfer request?","source":{"kind":"community","company":"Barclays"}},{"id":"SEC-040","type":"short","category":"security","difficulty":3,"topic":"Verifying purchases","tags":["storekit","in-app-purchase","receipt","entitlement"],"question":"A webtoon app unlocks paid episodes through in-app purchase. What's wrong with a design where the client saves a \"purchased\" flag in UserDefaults after a successful payment and unlocks from that?","source":{"kind":"community","company":"레진엔터테인먼트"}},{"id":"SWIFT-001","type":"short","category":"swift-language","difficulty":2,"topic":"Value vs reference types","tags":["struct","class","value-type","cow"],"question":"In Swift, what's the fundamental difference between a struct and a class?","source":{"kind":"community","company":"Apple"}},{"id":"SWIFT-002","type":"mcq","category":"swift-language","difficulty":1,"topic":"Optional unwrapping","tags":["optional","unwrap"],"question":"Which of these unwrap an optional safely? Pick **all** that apply.","source":{"kind":"original"}},{"id":"SWIFT-003","type":"short","category":"swift-language","difficulty":2,"topic":"Escaping closures","tags":["closure","escaping","non-escaping","capture"],"question":"This code doesn't compile. What is the compiler asking for?\n\n```swift\nfinal class Loader {\n    var handlers: [() -> Void] = []\n    func register(_ handler: () -> Void) {\n        handlers.append(handler)\n    }\n}\n```","source":{"kind":"community"}},{"id":"SWIFT-004","type":"mcq","category":"swift-language","difficulty":1,"topic":"Value semantics","tags":["struct","class","value-semantics","let"],"question":"What does this code print?\n\n```swift\nstruct Point { var x = 0 }\nfinal class Box { var x = 0 }\nvar p1 = Point(); var p2 = p1; p2.x = 5\nlet b1 = Box();  let b2 = b1;  b2.x = 5\nprint(p1.x, b1.x)\n```","source":{"kind":"community"}},{"id":"SWIFT-005","type":"short","category":"swift-language","difficulty":3,"topic":"Opaque vs existential types","tags":["some","any","existential","opaque","generic","dispatch"],"question":"From the caller's side, what's the difference between `func make() -> some Shape` and `func make() -> any Shape`?","source":{"kind":"original"},"since":"Swift 5.7"},{"id":"SWIFT-006","type":"mcq","category":"swift-language","difficulty":2,"topic":"Access control","tags":["access-control","open","public","module"],"question":"In a framework module, what's the difference between declaring `open class` and `public class`? Pick **all** correct statements.","source":{"kind":"community"}},{"id":"SWIFT-007","type":"short","category":"swift-language","difficulty":2,"topic":"Protocol-oriented design","tags":["protocol","pop","oop","protocol-extension","composition"],"question":"A teammate wants to create a `BaseViewModel` class and have every screen inherit from it. If you proposed a protocol-oriented alternative, how would you design it?","source":{"kind":"community"}},{"id":"SWIFT-008","type":"mcq","category":"swift-language","difficulty":4,"topic":"Protocol extension dispatch","tags":["protocol","extension","dispatch","witness-table"],"question":"What does this code print?\n\n```swift\nprotocol Greeter { func hello() -> String }\nextension Greeter {\n    func hello() -> String { \"proto hello\" }\n    func bye() -> String { \"proto bye\" }\n}\nstruct Bot: Greeter {\n    func hello() -> String { \"bot hello\" }; func bye() -> String { \"bot bye\" }\n}\nlet g: any Greeter = Bot()\nprint(g.hello(), g.bye())\n```","source":{"kind":"original"}},{"id":"SWIFT-009","type":"short","category":"swift-language","difficulty":3,"topic":"Generics and type erasure","tags":["generic","associatedtype","type-erasure","any","primary-associated-type"],"question":"You have an `Iterator` protocol with `getNext()` and `hasNext()`, and you want to change it from `Int`-only to generic with `associatedtype Element`. After the change, building an `[Iterator]` array no longer compiles. Why?","source":{"kind":"company","company":"Uber"},"since":"Swift 5.7"},{"id":"SWIFT-010","type":"mcq","category":"swift-language","difficulty":1,"topic":"Type casting","tags":["type-casting","as","downcast","optional"],"question":"Given `let view: UIView = UILabel()`, which of these casts **can crash at runtime**?","source":{"kind":"community"}},{"id":"SWIFT-011","type":"short","category":"swift-language","difficulty":2,"topic":"mutating and value types","tags":["mutating","struct","value-semantics","inout"],"question":"Which line in this code fails to compile, and why?\n\n```swift\nstruct Counter {\n    var value = 0\n    func increment() { value += 1 }\n}\nlet c = Counter()\nc.increment()\n```","source":{"kind":"community"}},{"id":"SWIFT-012","type":"mcq","category":"swift-language","difficulty":2,"topic":"defer ordering","tags":["defer","scope","cleanup"],"question":"What's the output order when you call this function?\n\n```swift\nfunc run() {\n    defer { print(\"A\") }\n    do {\n        defer { print(\"B\") }\n        print(\"C\")\n    }\n    defer { print(\"D\") }\n    print(\"E\")\n}\n```","source":{"kind":"community"}},{"id":"SWIFT-013","type":"short","category":"swift-language","difficulty":2,"topic":"Any, AnyObject, NSObject","tags":["any","anyobject","nsobject","existential","objc"],"question":"What can `Any`, `AnyObject`, and `NSObject` each hold?","source":{"kind":"community"}},{"id":"SWIFT-014","type":"mcq","category":"swift-language","difficulty":2,"topic":"Enum rules","tags":["enum","associated-value","raw-value","pattern-matching"],"question":"Which statements about Swift `enum` are correct? Pick **all** that apply.","source":{"kind":"community"}},{"id":"SWIFT-015","type":"short","category":"swift-language","difficulty":3,"topic":"Error handling","tags":["error","throws","result","typed-throws","async"],"question":"When designing a network layer, which would you make the default: `throws` functions, returning `Result<T, E>`, or Swift 6 typed throws (`throws(NetworkError)`)?","source":{"kind":"community"},"since":"Swift 6"},{"id":"SWIFT-016","type":"short","category":"swift-language","difficulty":3,"topic":"Codable decoding strategies","tags":["codable","decodable","codingkeys","json","date"],"question":"The server's JSON uses snake_case keys, and dates come as strings like `\"2026-09-11T10:00:00Z\"`. What would you set up on the decoder to decode this response with `Codable`?","source":{"kind":"community"}},{"id":"SWIFT-017","type":"mcq","category":"swift-language","difficulty":2,"topic":"Higher-order functions","tags":["map","compactmap","flatmap","higher-order-function"],"question":"What does this code print?\n\n```swift\nlet raw = [\"1\", \"x\", \"3\"]\nlet a = raw.map { Int($0) }\nlet b = raw.compactMap { Int($0) }\nlet c = [[1, 2], [3]].flatMap { $0 }\nprint(a.count, b.count, c.count)\n```","source":{"kind":"community"}},{"id":"SWIFT-018","type":"short","category":"swift-language","difficulty":3,"topic":"String internals","tags":["string","unicode","grapheme","index","performance"],"question":"Why can't you index a String with an integer like `text[3]`, and why is `text.count` O(n)?","source":{"kind":"community"}},{"id":"SWIFT-019","type":"mcq","category":"swift-language","difficulty":2,"topic":"lazy properties","tags":["lazy","stored-property","initialization","thread-safety"],"question":"Which statements about a `lazy var` stored property are correct? Pick **all** that apply.","source":{"kind":"community"}},{"id":"SWIFT-020","type":"short","category":"swift-language","difficulty":3,"topic":"Method dispatch","tags":["dispatch","static-dispatch","dynamic-dispatch","vtable","final","wmo"],"question":"In Swift, which method calls use static, table, and message dispatch?","source":{"kind":"company","company":"TikTok"}},{"id":"SWIFT-021","type":"short","category":"swift-language","difficulty":4,"topic":"Implementing copy-on-write","tags":["cow","copy-on-write","isknownuniquelyreferenced","value-semantics","performance"],"question":"You need a `struct ImageBuffer` that wraps a large pixel buffer, keeps value semantics, and avoids needless copies. If you implemented copy-on-write yourself, what would the code skeleton and the key API be?","source":{"kind":"community"}},{"id":"SWIFT-022","type":"mcq","category":"swift-language","difficulty":3,"topic":"Property wrappers","tags":["property-wrapper","projectedvalue","wrappedvalue"],"question":"What does this code print?\n\n```swift\n@propertyWrapper struct Clamped {\n    private var v = 0\n    var wrappedValue: Int {\n        get { v } set { v = min(max(newValue, 0), 10) }\n    }\n    var projectedValue: Bool { v == 10 }\n}\nstruct Volume { @Clamped var level: Int }\nvar vol = Volume(); vol.level = 42\nprint(vol.level, vol.$level)\n```","source":{"kind":"community"}},{"id":"SWIFT-023","type":"short","category":"swift-language","difficulty":3,"topic":"Initialization rules","tags":["initializer","designated","convenience","two-phase","failable","required"],"question":"Why doesn't this code compile? Can you explain it using the two-phase initialization rules?\n\n```swift\nclass Base { let id: Int; init(id: Int) { self.id = id } }\nclass Child: Base {\n    let name: String\n    init(name: String) {\n        super.init(id: name.count)\n        self.name = name\n    }\n}\n```","source":{"kind":"community"}},{"id":"SWIFT-024","type":"short","category":"swift-language","difficulty":1,"topic":"Why optionals exist","tags":["optional","enum","nil","safety"],"question":"Why does Swift have optionals?","source":{"kind":"community"}},{"id":"SWIFT-025","type":"mcq","category":"swift-language","difficulty":1,"topic":"Collection types","tags":["array","set","dictionary","hashable","collection"],"question":"You have tens of thousands of user IDs and need to check repeatedly whether a given ID is among them. Which collection fits best?","source":{"kind":"community"}},{"id":"SWIFT-026","type":"short","category":"swift-language","difficulty":2,"topic":"KeyPath values","tags":["keypath","writablekeypath","referencewritablekeypath","kvo","functional"],"question":"In Swift, what exactly does a KeyPath like `\\.name` represent as a value?","source":{"kind":"original"},"since":"Swift 5.2"},{"id":"SWIFT-027","type":"short","category":"swift-language","difficulty":4,"topic":"Objective-C interop","tags":["objc","bridging","interop","dynamic","nsstring","runtime"],"question":"A Swift module has to call into legacy Objective-C code and be called from it. How do you set up bridging in both directions?","source":{"kind":"community"}},{"id":"SWIFT-028","type":"short","category":"swift-language","difficulty":4,"topic":"ABI and library evolution","tags":["abi","library-evolution","frozen","inlinable","resilience","binary-framework"],"question":"You're about to ship an internal shared module as an XCFramework binary. What do Swift ABI stability and Library Evolution (`BUILD_LIBRARY_FOR_DISTRIBUTION`) each guarantee?","source":{"kind":"community"},"since":"Swift 5.1"},{"id":"SWIFT-029","type":"short","category":"swift-language","difficulty":3,"topic":"ContiguousArray vs Array","tags":["array","contiguousarray","performance","bridging","stdlib"],"question":"Say your resume claims \"`ContiguousArray` is faster than `Array`.\" In a pre-interview the interviewer asks, \"Then why don't developers use `ContiguousArray` much in practice?\" How would you answer?","source":{"kind":"company","company":"네이버웹툰"}},{"id":"SWIFT-030","type":"short","category":"swift-language","difficulty":2,"topic":"Serialization model types","tags":["struct","class","codable","serialization","value-type"],"question":"When you build model types to serialize and deserialize a server's JSON response, should you use a class or a struct? Give your reasons.","source":{"kind":"company","company":"라인플러스"}},{"id":"SWIFT-031","type":"mcq","category":"swift-language","difficulty":2,"topic":"Recursive value types","tags":["struct","class","recursive","memory-layout","indirect"],"question":"What happens when you compile this code? And if you change the same definition to `class Person`?\n\n```swift\nstruct Person {\n    let name: String\n    let father: Person\n}\n```","source":{"kind":"company","company":"Meesho"}},{"id":"SWIFT-032","type":"mcq","category":"swift-language","difficulty":1,"topic":"Optionals and IUOs","tags":["optional","iuo","implicitly-unwrapped","nil"],"question":"Which of these three lines compile? Pick **all** that apply.\n\n```swift\nlet a: String = nil\nlet b: String? = nil\nlet c: String! = nil\n```","source":{"kind":"company","company":"Meesho"}},{"id":"SWIFT-033","type":"mcq","category":"swift-language","difficulty":2,"topic":"Swift type rules","tags":["initializer","deinit","access-control","closure","hashable"],"question":"Which of these statements about Swift language rules are correct? Pick **all** that apply.","source":{"kind":"company","company":"Zomato"}},{"id":"SWIFT-034","type":"short","category":"swift-language","difficulty":2,"topic":"private vs fileprivate","tags":["access-control","private","fileprivate","extension","se-0169"],"question":"In one file you have `class A { fileprivate func secret() {} }` and `class B`. Can B call `A().secret()`, and what changes if you switch it to `private`?","source":{"kind":"company","company":"Gojek"},"since":"Swift 4"},{"id":"SWIFT-035","type":"short","category":"swift-language","difficulty":1,"topic":"Combining higher-order functions","tags":["higher-order","map","enumerated","reversed","functional"],"question":"Take `[\"a\", \"b\", \"c\"]` as input and produce `[\"c-0\", \"b-1\", \"a-2\"]`. You can't use a `for` loop, only higher-order functions. Which functions would you combine, and in what order?","source":{"kind":"company","company":"Capital One"}},{"id":"SWIFT-036","type":"short","category":"swift-language","difficulty":2,"topic":"Implementing compactMap","tags":["generics","rethrows","extension","compactmap","optional"],"question":"Extend `Array` with a `myCompactMap` that behaves like the standard library's `compactMap`. How would you write the generic signature?","source":{"kind":"company","company":"Walmart"}},{"id":"SWIFT-037","type":"short","category":"swift-language","difficulty":2,"topic":"Extending Optional","tags":["optional","extension","enum","pattern-matching","equatable"],"question":"Extend `Optional` so that any optional can be asked for its nil status, like `someOptional.isNil`. How would you implement it?","source":{"kind":"company","company":"Swiggy"}},{"id":"SWIFT-038","type":"mcq","category":"swift-language","difficulty":2,"topic":"Init and observer rules","tags":["deinit","required","property-observer","set","optional-chaining"],"question":"Which of these statements about class initialization, deinitialization, and property observers in Swift are correct? Pick **all** that apply.","source":{"kind":"company","company":"Didi"}},{"id":"SWIFT-039","type":"short","category":"swift-language","difficulty":3,"topic":"An iterator of iterators","tags":["iteratorprotocol","sequence","flatten","generics","lazy"],"question":"Given a 'collection of collections' like `[[1, 2], [], [3], [4, 5, 6]]`, how would you design an iterator that hands out elements one at a time in flat order (1, 2, 3, 4, 5, 6)? It has to work directly in `for-in`.","source":{"kind":"company","company":"Airbnb"}},{"id":"SWIFT-040","type":"short","category":"swift-language","difficulty":3,"topic":"Extensions and stored properties","tags":["extension","stored-property","memory-layout","associated-object","objective-c"],"question":"You want to add a property to an existing type with an extension. Computed properties work, so why not stored properties?","source":{"kind":"company","company":"Xiaohongshu"}},{"id":"SWIFT-041","type":"short","category":"swift-language","difficulty":3,"topic":"Large collections in structs","tags":["cow","dictionary","value-type","performance","inout"],"question":"You need to put a very large `Dictionary`, hundreds of thousands of entries, into a struct property and pass that struct around by value. What's the 'fastest' way to store and pass it?","source":{"kind":"community","company":"Verizon"}},{"id":"SWIFT-042","type":"short","category":"swift-language","difficulty":2,"topic":"Generics vs Any","tags":["generics","any","specialization","type-safety","overloading"],"question":"During code review you find the same logic overloaded per type: `func larger(_ a: Int, _ b: Int) -> Int`, `larger(_ a: Double, _ b: Double) -> Double`, `larger(_ a: String, ...)`. You want to propose one generic function instead. How is taking a generic parameter different from taking `Any`?","source":{"kind":"community","company":"IBM"}},{"id":"SWIFT-043","type":"mcq","category":"swift-language","difficulty":2,"topic":"inout parameters","tags":["inout","copy-in-copy-out","exclusivity","value-type"],"question":"Which statements about Swift's `inout` parameters (`func bump(_ x: inout Int)`) are correct? Pick **all** that apply.","source":{"kind":"community","company":"Tinder"}},{"id":"SWIFT-044","type":"short","category":"swift-language","difficulty":3,"topic":"Designing a custom Optional","tags":["optional","enum","generics","map","flatmap","monad"],"question":"Suppose there were no question-mark optional syntax and no standard `Optional`. If you had to design a type in Swift that expresses 'a value or nothing,' how would you define it?","source":{"kind":"community","company":"Grab"}},{"id":"SWIFT-045","type":"short","category":"swift-language","difficulty":1,"topic":"Tuples: uses and limits","tags":["tuple","struct","multiple-return","destructuring"],"question":"When is it appropriate to use a tuple in Swift?","source":{"kind":"company","company":"Adobe"}},{"id":"SWIFT-046","type":"mcq","category":"swift-language","difficulty":1,"topic":"Choosing a struct","tags":["struct","class","value-type","reference-type","design"],"question":"In which of these cases is a **struct the right choice** over a class in Swift? Pick **all** that apply.","source":{"kind":"company","company":"Oura"}},{"id":"SWIFT-047","type":"short","category":"swift-language","difficulty":2,"topic":"Protecting the original","tags":["reference-type","deep-copy","shallow-copy","nscopying","value-semantics"],"question":"You passed a class instance to a function, changed a property inside it, and the caller's original changed too. How do you protect the original?","source":{"kind":"company","company":"SAP"}},{"id":"SWIFT-048","type":"short","category":"swift-language","difficulty":2,"topic":"How Swift enums differ","tags":["enum","associated-values","sum-type","exhaustive-switch","state-modeling"],"question":"A colleague who mostly writes Java or C asks whether a Swift enum is just a list of constants in the end. What's fundamentally different about a Swift enum compared with enums in other languages?","source":{"kind":"company","company":"JD.com"}},{"id":"SWIFT-049","type":"short","category":"swift-language","difficulty":2,"topic":"How optional chaining behaves","tags":["optional-chaining","optional","short-circuit","flatten","void-optional"],"question":"When you chain several optional accesses like this and hit `nil` partway through, what happens?\n\n```swift\nlet city = user?.address?.city\n```","source":{"kind":"community","company":"Capgemini"}},{"id":"SWIFT-050","type":"mcq","category":"swift-language","difficulty":1,"topic":"guard statement rules","tags":["guard","early-exit","optional-binding","control-flow"],"question":"Which statements about Swift's `guard` statement are correct? Pick **all** that apply.","source":{"kind":"community","company":"Infosys"}},{"id":"SWIFT-051","type":"short","category":"swift-language","difficulty":2,"topic":"Type inference cost","tags":["type-inference","compile-time","let","var","immutability","type-checker"],"question":"Swift has type inference, so you rarely have to write types, yet your team convention says \"annotate types on complex expressions and public APIs.\" How does type inference work that led to this rule?","source":{"kind":"community","company":"Cognizant"}},{"id":"SWIFT-052","type":"short","category":"swift-language","difficulty":3,"topic":"Using a C++ library","tags":["cpp-interop","objective-c++","bridging","ownership","swift-5.9"],"question":"You need to use a C++ video-processing library from a Swift app. Would you go with the old approach (an Objective-C++ wrapper) or Swift 5.9's C++ interop?","source":{"kind":"community","company":"야놀자"},"since":"Swift 5.9"},{"id":"SWIFT-053","type":"short","category":"swift-language","difficulty":1,"topic":"Force unwrap rule","tags":["optional","force-unwrap","iuo","code-review","crash"],"question":"Your team's code review rules include \"no force unwrapping (`!`).\" Why have a rule like that?","source":{"kind":"community","company":"브랜디"}},{"id":"SUI-001","type":"short","category":"swiftui","difficulty":1,"topic":"SwiftUI vs UIKit rendering","tags":["swiftui","uikit","declarative","rendering","diffing"],"question":"How is the way SwiftUI draws the screen fundamentally different from UIKit?","source":{"kind":"community"}},{"id":"SUI-002","type":"short","category":"swiftui","difficulty":2,"topic":"View as a struct","tags":["view","struct","value-type","protocol","identity"],"question":"UIView is a class, so why was SwiftUI's View designed as a struct?","source":{"kind":"community"}},{"id":"SUI-003","type":"mcq","category":"swiftui","difficulty":1,"topic":"@State and @Binding","tags":["state","binding","data-flow","source-of-truth"],"question":"You're building a SwiftUI settings screen. A child view `SettingsRow` with a toggle needs to read **and change** an `isOn` value the parent owns. Which property declaration in the child is correct?","source":{"kind":"community"}},{"id":"SUI-004","type":"short","category":"swiftui","difficulty":1,"topic":"Diagnosing @State updates","tags":["state","update","debugging","observable","main-actor"],"question":"A junior asks you why the screen doesn't update after they change a @State value in SwiftUI. Start by explaining what @State is.","source":{"kind":"community"}},{"id":"SUI-005","type":"mcq","category":"swiftui","difficulty":2,"topic":"@StateObject vs @ObservedObject","tags":["stateobject","observedobject","observableobject","lifetime","combine"],"question":"In this SwiftUI view, `ItemListView`'s data resets every time the parent view is re-evaluated. What's the cause, and what's the right fix?\n\n```swift\nstruct ItemListView: View {\n    @ObservedObject var vm = ItemListViewModel()\n    var body: some View { List(vm.items) { Text($0.name) } }\n}\n```","source":{"kind":"community"},"since":"iOS 14"},{"id":"SUI-006","type":"short","category":"swiftui","difficulty":3,"topic":"Observation framework","tags":["observable","observation","observableobject","published","performance"],"question":"In SwiftUI, what does the iOS 17 `@Observable` macro give you over the older `ObservableObject` plus `@Published` approach? Ground it in how the two work internally.","source":{"kind":"community"},"since":"iOS 17"},{"id":"SUI-007","type":"mcq","category":"swiftui","difficulty":2,"topic":"Observation migration","tags":["observable","migration","bindable","environment","state"],"question":"You're moving a SwiftUI app's `ObservableObject` code to `@Observable`. Select **all** the correct migrations.","source":{"kind":"original"},"since":"iOS 17"},{"id":"SUI-008","type":"short","category":"swiftui","difficulty":2,"topic":"Data flow design","tags":["data-flow","source-of-truth","binding","environment","single-source"],"question":"Using the single source of truth principle in SwiftUI, how do you decide which view should own a given piece of state?","source":{"kind":"community"}},{"id":"SUI-009","type":"mcq","category":"swiftui","difficulty":2,"topic":"Environment injection","tags":["environment","environmentobject","injection","crash","sheet"],"question":"In a SwiftUI app you injected `.environment(session)` at an intermediate view (`HomeView`) as shown below. `ProfileView`, which uses `@Environment(Session.self) var session`, works fine when pushed inside the NavigationStack but crashes at runtime when presented from `HomeView`'s `.sheet`. What's the most likely cause?\n\n```swift\nNavigationStack {\n    HomeView()          // presents .sheet { ProfileView() } internally\n}\n.environment(session)   // assume it's injected here, not at the root\n```","source":{"kind":"community"},"since":"iOS 17"},{"id":"SUI-010","type":"short","category":"swiftui","difficulty":2,"topic":"SwiftUI view lifecycle","tags":["lifecycle","onappear","task","body","identity"],"question":"SwiftUI views have no viewDidLoad or viewWillAppear like UIKit. How does a view actually get created, appear, update, and disappear? Center your answer on how the lifetime of the view struct differs from the lifetime of its state (@State).","source":{"kind":"community"},"since":"iOS 15"},{"id":"SUI-011","type":"short","category":"swiftui","difficulty":3,"topic":"View identity","tags":["identity","structural-identity","explicit-identity","id","state-reset"],"question":"In the code below, toggling `isCompact` wipes whatever was typed in the text field. Can you explain why using SwiftUI's concept of identity?\n\n```swift\nvar body: some View {\n    if isCompact {\n        SearchField().padding(4)\n    } else {\n        SearchField().padding(16)\n    }\n}\n```","source":{"kind":"original"}},{"id":"SUI-012","type":"mcq","category":"swiftui","difficulty":3,"topic":"ForEach identifiers","tags":["foreach","identifiable","id","list","animation"],"question":"In this SwiftUI to-do list, inserting an item at the front makes every row flicker instead of animating the insertion, and each row's toggle state shifts down by one. What's the cause?\n\n```swift\nForEach(items.indices, id: \\.self) { i in\n    TodoRow(item: items[i])\n}\n```","source":{"kind":"original"}},{"id":"SUI-013","type":"short","category":"swiftui","difficulty":2,"topic":"Embedding SwiftUI in UIKit","tags":["uiviewrepresentable","uihostingcontroller","interop","coordinator","bridge"],"question":"How do you put a SwiftUI screen into a UIKit app?","source":{"kind":"community"}},{"id":"SUI-014","type":"mcq","category":"swiftui","difficulty":2,"topic":"UIViewRepresentable behavior","tags":["uiviewrepresentable","coordinator","updateuiview","interop"],"question":"Select **all** the correct statements about SwiftUI's `UIViewRepresentable`.","source":{"kind":"original"}},{"id":"SUI-015","type":"short","category":"swiftui","difficulty":1,"topic":"App entry point","tags":["main","app-protocol","scene","windowgroup","appdelegate"],"question":"In a SwiftUI app, what does `@main` mean?","source":{"kind":"community"},"since":"iOS 14"},{"id":"SUI-016","type":"mcq","category":"swiftui","difficulty":1,"topic":"Presenting a sheet","tags":["sheet","modal","presentation","item","ispresented"],"question":"In a SwiftUI list, tapping an item should present that item's detail in a sheet. With many items, what's the most appropriate approach?","source":{"kind":"community"}},{"id":"SUI-017","type":"short","category":"swiftui","difficulty":3,"topic":"SwiftUI layout algorithm","tags":["layout","proposal","size","frame","geometryreader"],"question":"Can you walk me through the three steps that determine a SwiftUI layout?","source":{"kind":"original"}},{"id":"SUI-018","type":"mcq","category":"swiftui","difficulty":2,"topic":"Stack and Spacer layout","tags":["hstack","spacer","frame","maxwidth","layout"],"question":"Select **all** the correct statements about the layout result of this SwiftUI view.\n\n```swift\nHStack {\n    Text(\"Title\")\n    Spacer()\n    Button(\"Save\") {}\n}\n.frame(maxWidth: .infinity)\n.background(Color.yellow)\n```","source":{"kind":"original"}},{"id":"SUI-019","type":"short","category":"swiftui","difficulty":4,"topic":"SwiftUI performance diagnosis","tags":["performance","body","printchanges","instruments","observable","equatable"],"question":"On a dashboard screen built in SwiftUI, the whole screen stutters on every character typed into a text field. What's your hypothesis for what's going on?","source":{"kind":"original"},"since":"iOS 17"},{"id":"SUI-020","type":"short","category":"swiftui","difficulty":2,"topic":"Reusable component design","tags":["viewmodifier","reusable","viewbuilder","style","component"],"question":"You're building a design system's card component in SwiftUI to reuse across many screens. When would you use each approach (a custom View, a ViewModifier, a Style protocol, and so on), and by what criteria?","source":{"kind":"community"}},{"id":"SUI-021","type":"short","category":"swiftui","difficulty":3,"topic":"MVVM in SwiftUI","tags":["mvvm","viewmodel","observable","mainactor","testing"],"question":"If you apply MVVM to a SwiftUI screen, how do you define the ViewModel and how does the view own it?","source":{"kind":"community"},"since":"iOS 17"},{"id":"SUI-022","type":"short","category":"swiftui","difficulty":1,"topic":"NavigationStack navigation","tags":["navigationstack","navigationpath","navigationlink","deep-link","navigationview"],"question":"How do you implement navigation between screens in SwiftUI?","source":{"kind":"community"},"since":"iOS 16"},{"id":"SUI-023","type":"mcq","category":"swiftui","difficulty":3,"topic":".task vs onAppear","tags":["task","onappear","cancellation","async","lifecycle"],"question":"In a SwiftUI view that loads data, what's the correct statement about how these two pieces of code behave differently?\n\n```swift\n// A\n.onAppear { Task { await vm.load() } }\n// B\n.task { await vm.load() }\n```","source":{"kind":"original"},"since":"iOS 15"},{"id":"SUI-024","type":"short","category":"swiftui","difficulty":3,"topic":"SwiftData and SwiftUI","tags":["swiftdata","coredata","query","modelcontainer","persistence"],"question":"For a new SwiftUI app's local storage you picked SwiftData over Core Data. How does SwiftData integrate with SwiftUI?","source":{"kind":"community"},"since":"iOS 17"},{"id":"SUI-025","type":"short","category":"swiftui","difficulty":4,"topic":"Finding SwiftUI defects","tags":["debugging","code-review","observedobject","foreach","onappear","state"],"question":"This is a SwiftUI live coding review. Find as many defects as you can in the feed screen code below, and for each one say why it's a problem and how you'd fix it.\n\n```swift\nstruct FeedView: View {\n    @ObservedObject var vm = FeedViewModel()\n    @State var items: [Post] = []\n    var body: some View {\n        List {\n            ForEach(0..<items.count) { i in\n                PostRow(post: items[i])\n                    .onAppear { if i == items.count - 1 { Task { await vm.loadMore() } } }\n            }\n        }\n        .onAppear { Task { items = await vm.fetch() } }\n    }\n}\n```","source":{"kind":"community","company":"PayPal"}},{"id":"SUI-026","type":"mcq","category":"swiftui","difficulty":4,"topic":"Observation tracking granularity","tags":["observable","observation","tracking","body","performance"],"question":"In this SwiftUI plus Observation code, when only `store.count` is incremented, select **all** the views whose body is re-evaluated.\n\n```swift\n@Observable final class Store { var count = 0; var name = \"\" }\n\nstruct A: View { let store: Store\n    var body: some View { Text(\"\\(store.count)\") } }\nstruct B: View { let store: Store\n    var body: some View { Text(store.name) } }\nstruct C: View { let store: Store\n    var body: some View { Button(\"tap\") { store.count += 1 } } }\nstruct D: View { let store: Store\n    var body: some View { Text(store.name + \" \\(store.count)\") } }\n```","source":{"kind":"original"},"since":"iOS 17"},{"id":"SUI-027","type":"short","category":"swiftui","difficulty":4,"topic":"Large list performance","tags":["list","lazyvstack","performance","anyview","scroll","identifiable"],"question":"A SwiftUI feed showing thousands of items stutters while scrolling. Based on the internal differences between `List` and `ScrollView + LazyVStack`, which do you choose?","source":{"kind":"original"}},{"id":"SUI-028","type":"mcq","category":"swiftui","difficulty":2,"topic":"@Published and view updates","tags":["published","observableobject","objectwillchange","combine","mainactor"],"question":"Select **all** the correct statements about how `ObservableObject`'s `@Published` updates SwiftUI views.","source":{"kind":"community"},"since":"iOS 13"},{"id":"SUI-029","type":"mcq","category":"swiftui","difficulty":2,"topic":"onChange vs onReceive","tags":["onchange","onreceive","combine","modifier","side-effect"],"question":"Select **all** the correct statements about SwiftUI's `onChange(of:)` and `onReceive(_:)`.","source":{"kind":"company","company":"Capital One"},"since":"iOS 17"},{"id":"SUI-030","type":"short","category":"swiftui","difficulty":3,"topic":"switchToLatest search pipeline","tags":["combine","switchtolatest","flatmap","debounce","search"],"question":"You're building a Combine pipeline for a SwiftUI search screen that calls the API as the user types. What's the difference between putting `switchToLatest()` after `map { query in api.search(query) }` versus using `flatMap`, and why is switchToLatest the right choice for search?","source":{"kind":"company","company":"Capital One"}},{"id":"SUI-031","type":"short","category":"swiftui","difficulty":3,"topic":"Combine list-detail live coding","tags":["combine","live-coding","navigationstack","observableobject","datataskpublisher"],"question":"This is a 20-minute live coding exercise. Using only Combine, build a two-screen SwiftUI app that fetches a list from an API, shows it, and navigates to a detail screen when an item is tapped. How do you set up the view model and state to start?","source":{"kind":"company","company":"Capital One"},"since":"iOS 16"},{"id":"SUI-032","type":"short","category":"swiftui","difficulty":2,"topic":"List scrolling diagnosis","tags":["list","lazyvstack","identifiable","performance","diagnosis"],"question":"You got a report that a SwiftUI `List` stutters while scrolling, and that row toggles and images change to the wrong ones or flicker. In what order do you suspect causes, and what do you fix them with?","source":{"kind":"company","company":"Samsung"}},{"id":"SUI-033","type":"mcq","category":"swiftui","difficulty":2,"topic":"Form validation state design","tags":["form","validation","alert","state","textfield","live-coding"],"question":"This is SwiftUI live coding. A sign-up screen has four fields (name, ID, password, password confirmation) and a submit button. If name or ID is empty, show a warning alert; if the passwords differ, show a warning alert; if everything passes, show a success message. Select **all** the correct state designs.","source":{"kind":"company","company":"Samsung"}},{"id":"SUI-034","type":"short","category":"swiftui","difficulty":2,"topic":"UIKit to SwiftUI migration","tags":["migration","uihostingcontroller","navigation","interop","adoption"],"question":"You want to move a service app built in UIKit over to SwiftUI. What strategy do you use to introduce it?","source":{"kind":"company","company":"Swiggy"}},{"id":"SUI-035","type":"short","category":"swiftui","difficulty":2,"topic":"State-driven view switch","tags":["state","conditional-view","stepper","animation","live-coding"],"question":"This is a 15-minute SwiftUI live coding exercise. Tapping an \"Add\" button should show a quantity stepper (minus/plus) in the same spot, and when the quantity hits 0 the stepper should disappear and the \"Add\" button should come back. How do you set up the state and structure the views?","source":{"kind":"company","company":"Zomato"}},{"id":"SUI-036","type":"short","category":"swiftui","difficulty":2,"topic":"Swift Charts implementation","tags":["swift-charts","chart","linemark","visualization","live-coding"],"question":"This is on-site coding. For a stock app, how would you build a Chart in Swift Charts that draws the last 30 days of closing prices as a line, with axes, range, and today's value highlighted?","source":{"kind":"company","company":"Robinhood"},"since":"iOS 16"},{"id":"SUI-037","type":"mcq","category":"swiftui","difficulty":1,"topic":"Modifier order","tags":["modifier","background","padding","modifier-order"],"question":"This is an interview where we look at SwiftUI code together and fix it. Which statement about the rendered result of these two lines is correct?\n\n```swift\n// A\nText(\"Pay\").padding().background(.blue)\n// B\nText(\"Pay\").background(.blue).padding()\n```","source":{"kind":"company","company":"PayPal"}},{"id":"SUI-038","type":"mcq","category":"swiftui","difficulty":1,"topic":"Choosing property wrappers","tags":["state","stateobject","observedobject","environmentobject","binding"],"question":"Select **all** the correctly matched pairs of situation and SwiftUI property wrapper. (Assume iOS 16 and ObservableObject.)","source":{"kind":"company","company":"Fidelity"}},{"id":"SUI-039","type":"short","category":"swiftui","difficulty":3,"topic":"@Observable ownership and passing","tags":["observation","observable","state","bindable","environment","ownership"],"question":"When working with an iOS 17 `@Observable` class in SwiftUI views, using \"who owns it\" and \"how is it passed\" as the criteria, when do you use `@State`, a plain property, `@Bindable`, and `@Environment`?","source":{"kind":"company","company":"크림"},"since":"iOS 17"},{"id":"SUI-040","type":"short","category":"swiftui","difficulty":3,"topic":"Search tab design","tags":["searchable","task-id","debounce","recent-searches","state-machine","take-home"],"question":"This is a take-home assignment. Build the App Store \"Search\" tab in SwiftUI using the iTunes Search API. You need recent search terms (stored locally), a results list, and a result detail screen, and third-party libraries are not allowed. To finish in 4 to 8 hours with \"concise code and a simple structure,\" how do you design the screen state and the search request handling (cancellation while typing, duplicates)?","source":{"kind":"company","company":"휴레이포지티브"},"since":"iOS 16"},{"id":"SUI-041","type":"short","category":"swiftui","difficulty":2,"topic":"WidgetKit and SwiftUI","tags":["widgetkit","widget","timeline","appintent","swiftui-only"],"question":"You've been assigned home screen widget development. Why can widgets only be built with SwiftUI and not UIKit?","source":{"kind":"company","company":"Alibaba"},"since":"iOS 14"},{"id":"SUI-042","type":"short","category":"swiftui","difficulty":2,"topic":"SwiftUI state ownership","tags":["swiftui","state","binding","observation"],"question":"In a SwiftUI product editing screen, the parent view owns the product model and a child view edits just the price field. Among `@State`, `@Binding`, and `@Observable`, which would you put where?","source":{"kind":"company","company":"Mercari"}},{"id":"SUI-043","type":"short","category":"swiftui","difficulty":2,"topic":"Choosing SwiftUI or UIKit","tags":["swiftui","uikit","integration","hosting-controller"],"question":"You're adding a new account detail screen to a banking app built in UIKit. By what criteria would you decide whether to build this screen in SwiftUI or UIKit?","source":{"kind":"community","company":"HSBC"}},{"id":"SUI-044","type":"short","category":"swiftui","difficulty":2,"topic":"Single state tally screen","tags":["swiftui","state","counter","single-source"],"question":"A counter screen built in SwiftUI has increment, decrement, and reset buttons plus a display of the current value. How would you arrange the state so the displayed number can never disagree with the actual value after a button press?","source":{"kind":"community","company":"Peloton"}},{"id":"SUI-045","type":"short","category":"swiftui","difficulty":2,"topic":"SwiftUI API loading state","tags":["swiftui","task","loading-state","api"],"question":"A SwiftUI list screen loads data from a hotel API. To handle loading, success, no results, and error on screen without missing one, how would you model the state?","source":{"kind":"community","company":"Expedia"}},{"id":"SUI-046","type":"short","category":"swiftui","difficulty":3,"topic":"Observation dependency tracking","tags":["observation","observable","swiftui","ios17"],"question":"In iOS 17 SwiftUI, when one property on an `@Observable` model changes, only some of the views using that model redraw, not all of them. What does SwiftUI use to decide which views to redraw?","source":{"kind":"company","company":"네이버웹툰"},"since":"iOS 17"},{"id":"SUI-047","type":"short","category":"swiftui","difficulty":2,"topic":"SwiftUI async MainActor state","tags":["swiftui","mainactor","async-await","error-state"],"question":"A SwiftUI order list ViewModel calls an async API and then changes the screen state with the result. Under Swift 6 strict concurrency, which part of this ViewModel would you isolate with `@MainActor`?","source":{"kind":"community","company":"요기요"}},{"id":"SUI-048","type":"short","category":"swiftui","difficulty":2,"topic":"List item identity","tags":["swiftui","list","identity","realtime"],"question":"In a SwiftUI `List` showing live prices, every price update makes rows flicker and reappear and the scroll position jumps. How should you define the model's `Identifiable` id?","source":{"kind":"community","company":"빗썸"}},{"id":"SUI-049","type":"short","category":"swiftui","difficulty":2,"topic":"Unidirectional state flow","tags":["swiftui","unidirectional","state","validation"],"question":"A used-goods listing screen built in SwiftUI has input fields, validation, submission, and error display all tangled together. If you reorganized it as a unidirectional state flow, in which direction would view events flow, and in which direction would state flow?","source":{"kind":"community","company":"중고나라"}},{"id":"SYS-001","type":"short","category":"system-design","difficulty":3,"topic":"News feed design","tags":["feed","pagination","cache","offline","image-loading","realtime"],"question":"Design an infinite-scroll feed screen like Twitter's from the iOS client's point of view. Walk me through where the data goes between the network response and the screen, and what the screen actually reads as its source.","source":{"kind":"community"},"estimatedMinutes":20},{"id":"SYS-002","type":"short","category":"system-design","difficulty":3,"topic":"Image loader and cache library","tags":["image-cache","lru","disk-cache","downsampling","deduplication","cancellation"],"question":"If you had to build an image loading library like SDWebImage or Kingfisher yourself, how would you structure the components and the cache layers?","source":{"kind":"community"},"estimatedMinutes":15},{"id":"SYS-003","type":"short","category":"system-design","difficulty":2,"topic":"Pagination strategy","tags":["pagination","cursor","offset","keyset","prefetch"],"question":"For a mobile feed, would you paginate by offset or by cursor (keyset)? Justify it with the differences between the two.","source":{"kind":"community"},"estimatedMinutes":10},{"id":"SYS-004","type":"mcq","category":"system-design","difficulty":2,"topic":"Pagination","tags":["pagination","offset","cursor"],"question":"You're loading a feed with offset pagination. While the user is reading page 2, 3 new posts get added at the top of the feed. What happens when you request page 3?","source":{"kind":"original"}},{"id":"SYS-005","type":"short","category":"system-design","difficulty":4,"topic":"1:1 chat app design","tags":["chat","websocket","message-ordering","offline-queue","media-upload","idempotency"],"question":"Design the iOS client for a 1:1 chat like WhatsApp. Focus on message ordering, duplicates, and the offline send queue.","source":{"kind":"company","company":"TikTok"},"estimatedMinutes":20},{"id":"SYS-006","type":"short","category":"system-design","difficulty":3,"topic":"Thumbnail grid to detail","tags":["grid","detail","image-loading","prefetch","page-size","cache-policy"],"question":"The first screen is a grid of photo thumbnails from an API, and tapping one opens a detail screen with comments, likes, sharing, and swipe left or right for the next photo. How would you lay out the classes and the data flow?","source":{"kind":"company","company":"TikTok"},"estimatedMinutes":15},{"id":"SYS-007","type":"short","category":"system-design","difficulty":2,"topic":"Notes app design","tags":["notes","offline-first","sync","conflict","swiftdata","cloudkit"],"question":"Design a simple notes app. Walk me through the architecture, how you store the data, and how it flows.","source":{"kind":"community","company":"Apple"},"estimatedMinutes":15},{"id":"SYS-008","type":"short","category":"system-design","difficulty":3,"topic":"Upload queue design","tags":["upload","background-urlsession","queue","retry","resumable","photos"],"question":"A user picks 50 photos to upload, and they all have to get there eventually, even if they close the app or lose the network. How would you design the upload queue? Cover retry, resume, ordering, progress display, and duplicate prevention.","source":{"kind":"original"},"estimatedMinutes":15},{"id":"SYS-009","type":"mcq","category":"system-design","difficulty":2,"topic":"Choosing a live update mechanism","tags":["realtime","websocket","sse","polling","push"],"question":"A stock app needs a watchlist screen (prices updating several times a second in the foreground) and a \"target price reached\" alert while the app is closed. Which combinations are appropriate? **Select all that apply.**","source":{"kind":"community"}},{"id":"SYS-010","type":"short","category":"system-design","difficulty":3,"topic":"Live price screen","tags":["realtime","websocket","throttle","diffable","battery","trading"],"question":"Design a portfolio and watchlist screen where hundreds of symbols change price dozens of times a second. Focus on how you control the UI refresh rate.","source":{"kind":"community","company":"Robinhood"},"estimatedMinutes":15},{"id":"SYS-011","type":"short","category":"system-design","difficulty":1,"topic":"Clarifying requirements","tags":["requirements","interview-process","scope","non-functional"],"question":"In a mobile system design interview you get \"design the Instagram feed.\" Before you start designing, what do you ask the interviewer and what do you pin down in the first 5 minutes?","source":{"kind":"community"},"estimatedMinutes":10},{"id":"SYS-012","type":"short","category":"system-design","difficulty":2,"topic":"Weather app design","tags":["weather","location","cache","widget","background-refresh","stale-while-revalidate"],"question":"Design an app that shows the weather for the current location and favorite cities. Focus on the components, the data sources, and the cache and refresh policy.","source":{"kind":"community","company":"Google"},"estimatedMinutes":10},{"id":"SYS-013","type":"short","category":"system-design","difficulty":3,"topic":"Online presence","tags":["presence","heartbeat","websocket","battery","contacts"],"question":"You're adding an online/offline/last seen indicator to a contact list. Given that the app might be force quit or lose its connection and never get to announce it's offline, how would you design the way the client reports its own status to the server?","source":{"kind":"community","company":"Meta"},"estimatedMinutes":15},{"id":"SYS-014","type":"short","category":"system-design","difficulty":2,"topic":"Offline-first architecture","tags":["offline-first","sync","repository","single-source-of-truth","outbox"],"question":"How is an \"offline-first\" app architecture different from the usual \"network first, fall back to cache\" approach?","source":{"kind":"community","company":"Meta"},"estimatedMinutes":15},{"id":"SYS-015","type":"mcq","category":"system-design","difficulty":1,"topic":"Cache layers","tags":["cache","memory","disk","network"],"question":"When the user enters the feed screen, which order of showing data is most appropriate?","source":{"kind":"original"}},{"id":"SYS-016","type":"short","category":"system-design","difficulty":4,"topic":"Large-scale app architecture","tags":["modularization","spm","feature-flags","observability","scalability","team"],"question":"Design the architecture for an iOS app with tens of millions of users built by 60 developers. Focus on the module structure and the boundaries between teams.","source":{"kind":"community","company":"Apple"},"estimatedMinutes":20},{"id":"SYS-017","type":"short","category":"system-design","difficulty":2,"topic":"Search feature design","tags":["search","debounce","cancellation","autocomplete","recent-searches","race"],"question":"Design the search screen of a music app: autocomplete while typing, a results list, and recent searches. Focus on how you keep a request from going out on every keystroke.","source":{"kind":"community","company":"Spotify"},"estimatedMinutes":10},{"id":"SYS-018","type":"short","category":"system-design","difficulty":3,"topic":"Stories feature design","tags":["stories","media","preload","video","viewed-state","expiry"],"question":"Design Instagram Stories: photos and short videos that vanish after 24 hours, tap left or right to advance, and a seen indicator. Focus on the media loading that makes the next story appear the instant you tap.","source":{"kind":"community","company":"Meta"},"estimatedMinutes":15},{"id":"SYS-019","type":"short","category":"system-design","difficulty":1,"topic":"Shared features across teams","tags":["shared-component","notifications","team","merge-conflict","modularization"],"question":"Several screens in the app (home, profile, settings) need the same \"notification center\" feature: an unread badge, a list, and mark as read. How would you design it so you don't rebuild it per screen, and marking as read on any screen updates the badge on all the others?","source":{"kind":"community"},"estimatedMinutes":10},{"id":"SYS-020","type":"short","category":"system-design","difficulty":4,"topic":"Native vs cross-platform","tags":["cross-platform","native","flutter","react-native","kmp","decision"],"question":"You're the CTO of a startup building new iOS and Android apps. Lay out your criteria for choosing between native, Flutter, React Native, and Kotlin Multiplatform, and tell me your decision.","source":{"kind":"community"},"estimatedMinutes":15},{"id":"SYS-021","type":"mcq","category":"system-design","difficulty":3,"topic":"Offline sync conflicts","tags":["sync","conflict","lww","crdt","tombstone"],"question":"In an offline-first to-do app, two devices edit the same item while offline and then sync. Which strategies are **sound** for handling this without losing data? **Select all that apply.**","source":{"kind":"original"}},{"id":"SYS-022","type":"short","category":"system-design","difficulty":3,"topic":"Performance and observability","tags":["observability","metrics","metrickit","hitch","tti","logging","experiments"],"question":"You're shipping a new feed feature. After launch, which client metrics and target values would you use to define \"it works well\"?","source":{"kind":"community","company":"Netflix"},"estimatedMinutes":15},{"id":"SYS-023","type":"short","category":"system-design","difficulty":2,"topic":"Photo sharing app storage","tags":["photos","storage","disk","thumbnail","photokit","cache-eviction"],"question":"Design the client storage system for a photo sharing app. Focus on where and how you store originals, thumbnails, and metadata.","source":{"kind":"community","company":"Meta"},"estimatedMinutes":15},{"id":"SYS-024","type":"mcq","category":"system-design","difficulty":1,"topic":"Image loading memory","tags":["image","downsampling","memory","cache-key"],"question":"You show 60 thumbnails of 4000×3000 JPEGs in a 3-column grid and memory jumps to several hundred MB. What's the most effective fix?","source":{"kind":"original"}},{"id":"SYS-025","type":"short","category":"system-design","difficulty":1,"topic":"When to load data","tags":["prefetch","loading-strategy","battery","bandwidth","memory","navigation"],"question":"A travel booking app goes list → detail → booking. For each screen, how do you decide whether to load its data when the screen appears or ahead of time from the previous screen?","source":{"kind":"community"},"estimatedMinutes":10},{"id":"SYS-026","type":"short","category":"system-design","difficulty":4,"topic":"Cross-screen state consistency","tags":["consistency","optimistic-update","single-source-of-truth","like","architecture","viper"],"question":"When the user double-taps to like a post in the Instagram detail screen, the same post in the feed, on the profile, and in search results all have to update immediately. Walk me through how that event flows through the architecture layers.","source":{"kind":"company","company":"Uber"},"estimatedMinutes":20},{"id":"SYS-027","type":"short","category":"system-design","difficulty":3,"topic":"Flight booking flow","tags":["booking","state-machine","idempotency","hold-expiry","checkout","offline"],"question":"Assume the backend already exists and design a flight booking iOS app. The flow runs search results → flight selection → seat and passenger entry → payment → confirmation. Focus on how you manage state across those screens.","source":{"kind":"company","company":"Meta"},"estimatedMinutes":15},{"id":"SYS-028","type":"short","category":"system-design","difficulty":3,"topic":"Image grid discovery screen","tags":["discover","infinite-scroll","image-loading","prefetch","concurrency","memory"],"question":"Design a discovery screen full of thumbnail tiles, like Snapchat Discover. It scrolls infinitely and every tile shows a network image. Focus on which thread does the image decoding and how you cap memory.","source":{"kind":"company","company":"Snap"},"estimatedMinutes":15},{"id":"SYS-029","type":"short","category":"system-design","difficulty":3,"topic":"Feature skeleton (DI, offline, experiments)","tags":["dependency-injection","offline","ab-testing","feature-flag","skeleton","protocol"],"question":"Sketch a single \"save bookmark\" feature as a Swift code skeleton. Instead of a whiteboard, work at the level of type and protocol signatures, and focus on how you inject dependencies to keep it testable.","source":{"kind":"company","company":"X (Twitter)"},"estimatedMinutes":15},{"id":"SYS-030","type":"short","category":"system-design","difficulty":3,"topic":"Transaction history screen","tags":["transaction-history","pagination","offline","realtime","low-end","source-of-truth"],"question":"Design the client for a money transfer app's transaction history screen. Requirements: infinite-scroll pagination, recent history available offline, new transactions appearing at the top in real time, and no flicker or duplicates on low-end devices with a flaky signal.","source":{"kind":"company","company":"PayPal"},"estimatedMinutes":15},{"id":"SYS-031","type":"short","category":"system-design","difficulty":3,"topic":"Offline-friendly finance feature","tags":["offline","freshness","cache","conflict","fintech","simplicity"],"question":"Design the \"this month's spending and remaining limit\" card in a credit card app. The screen has to open even on a flaky network, and the data has to feel fresh. Focus on what you cache and when you trust local data.","source":{"kind":"company","company":"CRED"},"estimatedMinutes":15},{"id":"SYS-032","type":"short","category":"system-design","difficulty":4,"topic":"BLE command serializing handler","tags":["ble","corebluetooth","serial-queue","timeout","continuation","actor","wearable"],"question":"Design the command handler for an app that talks to a wearable over BLE. Constraints: only one command can be in flight at a time, and the next command has to wait until the previous one gets a response or times out. Several screens send commands concurrently, and responses arrive asynchronously through CoreBluetooth delegate callbacks. Describe the type structure of this handler.","source":{"kind":"company","company":"Whoop"},"estimatedMinutes":20},{"id":"SYS-033","type":"short","category":"system-design","difficulty":4,"topic":"Timestamp-synced audiobook","tags":["avplayer","audio","timed-metadata","prefetch","capability","seek","background"],"question":"Design an \"enhanced playback\" feature for an audiobook app. For supported titles, the app has to show a specific image at set timestamps while the audio plays. How would you keep the audio clock and the image display in sync?","source":{"kind":"company","company":"Audible"},"estimatedMinutes":20},{"id":"SYS-034","type":"short","category":"system-design","difficulty":3,"topic":"Alarms that survive a reboot","tags":["alarm","local-notification","critical-alert","reboot","background","platform-constraint"],"question":"Design a wake-up alarm app for iOS that \"keeps ringing even after the user turns the phone off and on.\" The app doesn't auto-launch after a reboot and background execution is limited, so give me the most resilient design within those constraints.","source":{"kind":"company","company":"Microsoft"},"since":"iOS 15","estimatedMinutes":10},{"id":"SYS-035","type":"short","category":"system-design","difficulty":3,"topic":"Delivery rider app","tags":["delivery","rider","state-machine","location","offline-queue","api-design"],"question":"Design an app for delivery riders. The screen mockups are given: order list, order detail and accept, pickup, delivery complete. Walk me through the whole flow, focusing on the order state machine and how you keep it in step with the server.","source":{"kind":"company","company":"Deliveroo"},"estimatedMinutes":15},{"id":"SYS-036","type":"short","category":"system-design","difficulty":3,"topic":"In-app notification center","tags":["notification-center","unread","background-fetch","push-token","badge","pagination"],"question":"Design the \"notifications\" tab of a commerce app: a list of order, promotion, and shipping notifications, read/unread state, and a badge. Focus on local storage and syncing read state with the server.","source":{"kind":"company","company":"Flipkart"},"estimatedMinutes":15},{"id":"SYS-037","type":"short","category":"system-design","difficulty":3,"topic":"IM message reliability and local schema","tags":["im","chat","reliability","ack","sequence","sqlite","schema","outbox"],"question":"In a messenger app, what does the client have to guarantee so messages never get lost? Cover acks and resends in both directions, ordering, and deduplication.","source":{"kind":"company","company":"Tencent"},"estimatedMinutes":15},{"id":"SYS-038","type":"short","category":"system-design","difficulty":3,"topic":"Download manager","tags":["download","concurrency-limit","resume","urlsession","cache","lru","decoupling"],"question":"Design a shared download manager for the app. Requirements: tasks can run serially or in parallel with a cap on concurrency, and it must not be coupled to the calling modules.","source":{"kind":"company","company":"Kuaishou"},"estimatedMinutes":15},{"id":"SYS-039","type":"short","category":"system-design","difficulty":4,"topic":"Comment feed page","tags":["comments","ranking","pagination","cursor","collapse","persistence","animation"],"question":"Design the comment feed page for a community app. Constraints: comments are shown flat (no tree), globally sorted by an interaction weight (likes, reply count), and the first screen loads automatically. Given that the sort criterion keeps changing, how would you design the server data structure and the pagination?","source":{"kind":"company","company":"Xiaohongshu"},"estimatedMinutes":20},{"id":"SYS-040","type":"short","category":"system-design","difficulty":3,"topic":"Photo library","tags":["photos","grid","thumbnail","photokit","memory","backup","sync"],"question":"Design a photo library app that shows tens of thousands of photos in a grid and backs them up to the cloud. Focus on grid scroll performance: thumbnail generation, caching, and memory.","source":{"kind":"company","company":"Robinhood"},"estimatedMinutes":15},{"id":"SYS-041","type":"short","category":"system-design","difficulty":3,"topic":"Design system component","tags":["design-system","component","api-design","theming","accessibility","snapshot-test","coupang"],"question":"Design a \"toast\" component for a design system. With several apps and teams using it, how would you define the public API you expose to callers, the way it's called and the options?","source":{"kind":"company","company":"쿠팡"},"estimatedMinutes":15},{"id":"SYS-042","type":"mcq","category":"system-design","difficulty":2,"topic":"Spotting over-engineering","tags":["over-engineering","simplicity","architecture","two-screen"],"question":"The system design round is \"design an app with just two screens, a list and a detail.\" Which of these choices is the interviewer likely to judge as **over-engineering**? **Select all that apply.**","source":{"kind":"company","company":"Booking.com"}},{"id":"SYS-043","type":"mcq","category":"system-design","difficulty":3,"topic":"Client SDK design","tags":["sdk","api-design","integration","chat-sdk","versioning","threading"],"question":"You're designing an iOS client SDK for chat and calling that other companies' apps should be able to integrate easily. Which design principles lower integration difficulty and raise stability? **Select all that apply.**","source":{"kind":"community","company":"센드버드"}},{"id":"SYS-044","type":"short","category":"system-design","difficulty":3,"topic":"Large-scale photo feed pagination","tags":["feed","pagination","cursor","cache"],"question":"An iOS app implements infinite scroll for a photo feed seen by hundreds of millions of users. How would you design the page key so duplicates and gaps stay low even when the server's ranking changes?","source":{"kind":"community","company":"Roblox"}},{"id":"SYS-045","type":"short","category":"system-design","difficulty":3,"topic":"System scheduling for an alarm app","tags":["notifications","alarm","ios","scheduling"],"question":"You're designing an iPhone alarm app. When you have to guarantee the user is alerted at a set time, which system API do you use instead of an in-app Timer?","source":{"kind":"community","company":"Electronic Arts"}},{"id":"SYS-046","type":"short","category":"system-design","difficulty":3,"topic":"Ordering in a real-time news feed","tags":["websocket","realtime","sequence","feed"],"question":"A real-time social news feed receives incremental WebSocket events and an initial REST list. To make sure no events get lost during the initial sync, in what order do you wire up the two channels?","source":{"kind":"community","company":"Zynga"}},{"id":"SYS-047","type":"short","category":"system-design","difficulty":3,"topic":"Offline chat outbox","tags":["chat","offline","outbox","idempotency"],"question":"In an iOS chat app where the network drops often, messages the user sends must not be lost. How would you design the state transitions of the local outbox?","source":{"kind":"community","company":"Niantic"}},{"id":"SYS-048","type":"short","category":"system-design","difficulty":3,"topic":"News feed state model","tags":["state-management","feed","stale-response","reducer"],"question":"In a gaming news feed, refresh, pagination, and bookmarking all happen at the same time. What single state and event flow would you define so the screen doesn't overwrite one response with another?","source":{"kind":"community","company":"Riot Games"}},{"id":"SYS-049","type":"short","category":"system-design","difficulty":2,"topic":"Feature blueprint and requirements","tags":["requirements","blueprint","state-machine","feature-design"],"question":"You're designing an iOS audio bookmark feature on a whiteboard, no code. Which questions do you ask first to pin down the vague requirements?","source":{"kind":"company","company":"SoundCloud"}},{"id":"SYS-050","type":"short","category":"system-design","difficulty":3,"topic":"Mobile feature blueprint","tags":["banking","use-case","optimistic-ui","rollback"],"question":"You're explaining a card freeze feature for a banking app in a one-hour system design session. What interfaces would you use to separate the screen, the domain use case, the API, and analytics?","source":{"kind":"community","company":"Monzo"}},{"id":"SYS-051","type":"short","category":"system-design","difficulty":3,"topic":"File manager sync model","tags":["file-manager","sync","upload","metadata"],"question":"An iOS file manager shows a listing, offline files, and upload progress. How would you separate the storage of file metadata from the actual bytes?","source":{"kind":"community","company":"Hopper"}},{"id":"TEST-001","type":"short","category":"testing","difficulty":1,"topic":"Why unit tests","tags":["unit-test","xctest","why-test","regression"],"question":"A teammate says they'd rather build one more feature than spend the time writing tests. How would you make the case for unit tests?","source":{"kind":"community"}},{"id":"TEST-002","type":"mcq","category":"testing","difficulty":1,"topic":"XCTest discovery rules","tags":["xctest","xctestcase","test-discovery"],"question":"Which conditions does a method need before XCTest **recognizes and runs it as a test**? Select all that apply.","source":{"kind":"community"}},{"id":"TEST-003","type":"short","category":"testing","difficulty":1,"topic":"Test types and the pyramid","tags":["unit-test","integration-test","ui-test","test-pyramid"],"question":"What's the difference between unit tests, integration tests, and UI tests?","source":{"kind":"community"}},{"id":"TEST-004","type":"short","category":"testing","difficulty":2,"topic":"Arrange-Act-Assert","tags":["aaa","given-when-then","tdd","red-green-refactor"],"question":"Why do you split test code into Arrange-Act-Assert (Given-When-Then)?","source":{"kind":"community"}},{"id":"TEST-005","type":"short","category":"testing","difficulty":2,"topic":"Test doubles","tags":["test-double","mock","stub","fake","spy"],"question":"What is a test double?","source":{"kind":"community"}},{"id":"TEST-006","type":"short","category":"testing","difficulty":3,"topic":"Mocking the network","tags":["urlsession","urlprotocol","mock","network","dependency-injection"],"question":"You want to test a network layer that uses URLSession directly, with no real server. Can you give me at least two ways to do it?","source":{"kind":"community"}},{"id":"TEST-007","type":"short","category":"testing","difficulty":2,"topic":"Testing an API-backed screen","tags":["view-model","dependency-injection","stub","mvvm","testability"],"question":"This screen leans heavily on an API response. How would you change the code so you can test the screen, view model included, without a server request?","source":{"kind":"community"}},{"id":"TEST-008","type":"short","category":"testing","difficulty":2,"topic":"Testing private methods","tags":["private","testable","encapsulation","custom-view"],"question":"A private method inside a custom view holds complicated calculation logic and you want to test it. How would you test that private method, or should you leave it alone?","source":{"kind":"community"}},{"id":"TEST-009","type":"short","category":"testing","difficulty":3,"topic":"Replacing UI tests","tags":["ui-test","unit-test","presentation-logic","snapshot","architecture"],"question":"You have dozens of UI tests that are slow and break often. How would you restructure the code and the tests to replace most of them with unit tests?","source":{"kind":"community"}},{"id":"TEST-010","type":"short","category":"testing","difficulty":2,"topic":"Testing async code","tags":["async","xctestexpectation","async-await","swift-testing","confirmation"],"question":"How do you test an async/await API in a unit test?","source":{"kind":"community"},"since":"Xcode 13"},{"id":"TEST-011","type":"mcq","category":"testing","difficulty":2,"topic":"XCTest lifecycle","tags":["xctest","setup","teardown","lifecycle"],"question":"In the XCTestCase below, which order are the calls made in when `testA` and `testB` run?\n\n```swift\nfinal class CartTests: XCTestCase {\n    override class func setUp() { /* 1 */ }\n    override func setUp() { /* 2 */ }\n    override func tearDown() { /* 3 */ }\n    override class func tearDown() { /* 4 */ }\n    func testA() {}\n    func testB() {}\n}\n```","source":{"kind":"community"}},{"id":"TEST-012","type":"mcq","category":"testing","difficulty":3,"topic":"Flaky tests","tags":["flaky","determinism","shared-state","test-isolation"],"question":"Which of the following **cause** flaky tests that fail only sometimes on CI? Select all that apply.","source":{"kind":"community"}},{"id":"TEST-013","type":"mcq","category":"testing","difficulty":2,"topic":"Code coverage","tags":["coverage","xcode","metrics"],"question":"Which statements about code coverage are **correct**? Select all that apply.","source":{"kind":"community"}},{"id":"TEST-014","type":"short","category":"testing","difficulty":3,"topic":"Testing Core Data and SwiftData","tags":["core-data","swiftdata","in-memory","persistence-test"],"question":"How do you set up unit tests for a store layer that depends on Core Data (or SwiftData) so that nothing is left on disk?","source":{"kind":"community"},"since":"iOS 17"},{"id":"TEST-015","type":"short","category":"testing","difficulty":2,"topic":"Testing a view model","tags":["mvvm","view-model","observation","state","main-actor"],"question":"If you were testing `load()` on the view model below, which cases would you verify?\n\n```swift\n@MainActor @Observable\nfinal class FeedViewModel {\n    enum State { case idle, loading, loaded([Post]), failed(String) }\n    private(set) var state: State = .idle\n    private let repo: PostRepository\n    init(repo: PostRepository) { self.repo = repo }\n    func load() async {\n        state = .loading\n        do { state = .loaded(try await repo.fetch()) }\n        catch { state = .failed(error.localizedDescription) }\n    }\n}\n```","source":{"kind":"community"},"since":"iOS 17"},{"id":"TEST-016","type":"short","category":"testing","difficulty":3,"topic":"Swift Testing against XCTest","tags":["swift-testing","xctest","migration","macros"],"question":"How is Swift Testing different from XCTest?","source":{"kind":"original"},"since":"Xcode 16"},{"id":"TEST-017","type":"mcq","category":"testing","difficulty":2,"topic":"Swift Testing macros","tags":["swift-testing","expect","require","macros"],"question":"Which statements about Swift Testing's `#expect` and `#require` are **correct**? Select all that apply.","source":{"kind":"original"},"since":"Xcode 16"},{"id":"TEST-018","type":"mcq","category":"testing","difficulty":4,"topic":"Swift Testing execution model","tags":["swift-testing","parallel","serialized","shared-state"],"question":"In a suite written with Swift Testing, several tests write to and read from the same file path and fail intermittently. What's the **most fundamental** fix?","source":{"kind":"original"},"since":"Xcode 16"},{"id":"TEST-019","type":"short","category":"testing","difficulty":3,"topic":"Snapshot testing","tags":["snapshot-test","visual-regression","swift-snapshot-testing","ci"],"question":"You want to introduce snapshot testing to your team. What problem does snapshot testing solve?","source":{"kind":"original"}},{"id":"TEST-020","type":"short","category":"testing","difficulty":3,"topic":"Stabilizing UI tests","tags":["xcuitest","accessibility-identifier","launch-arguments","flaky"],"question":"A login flow test written in XCUITest fails about 30% of the time on CI. What would you change on the app side to stabilize it?","source":{"kind":"original"}},{"id":"TEST-021","type":"mcq","category":"testing","difficulty":1,"topic":"Telling test doubles apart","tags":["test-double","spy","stub","mock"],"question":"\"I want to replace the analytics event sender and check in the test which events the view model sent, with which arguments, and how many times.\" Which test double fits that purpose best?","source":{"kind":"community"}},{"id":"TEST-022","type":"mcq","category":"testing","difficulty":3,"topic":"Testing time-dependent code","tags":["clock","time","task-sleep","determinism"],"question":"The \"retry after three seconds\" logic uses `Task.sleep(for: .seconds(3))`, so the test really waits three seconds each time. Which are **correct approaches** for making the test fast and deterministic? Select all that apply.","source":{"kind":"original"},"since":"iOS 16"},{"id":"TEST-023","type":"short","category":"testing","difficulty":4,"topic":"Testing concurrent code","tags":["actor","sendable","data-race","thread-sanitizer","swift-concurrency"],"question":"How do you reproduce or detect a data race in concurrent code that uses actors and Tasks?","source":{"kind":"original"},"since":"Swift 5.5"},{"id":"TEST-024","type":"short","category":"testing","difficulty":4,"topic":"Test strategy at scale","tags":["test-plan","modularization","ci","parallel","selective-testing"],"question":"An app with 40 modules and 8,000 tests takes 40 minutes of CI tests. How would you change the test structure and the run strategy to get each PR under 10 minutes?","source":{"kind":"original"}},{"id":"TEST-025","type":"mcq","category":"testing","difficulty":4,"topic":"XCTestCase instance lifecycle","tags":["xctest","lifecycle","memory","setup"],"question":"Which are **problems** with the test class below? Select all that apply.\n\n```swift\nfinal class ImageCacheTests: XCTestCase {\n    let cache = ImageCache(directory: .temporaryDirectory, limitMB: 500)\n    func testStore() { /* uses cache */ }\n    func testEvict() { /* uses cache */ }\n    // ... 30 tests\n}\n```","source":{"kind":"original"}},{"id":"TEST-026","type":"mcq","category":"testing","difficulty":1,"topic":"@testable import","tags":["testable","access-control","test-target"],"question":"When the test target does `@testable import MyApp`, which declarations **become accessible**?","source":{"kind":"community"}},{"id":"TEST-027","type":"short","category":"testing","difficulty":2,"topic":"Tests in a take-home","tags":["take-home","unit-test","prioritization","architecture"],"question":"You got a take-home for a minimal iOS app with basic unit tests, and the brief says to finish in three to five hours. With time that tight, **where would you put which tests**?","source":{"kind":"company","company":"Twitter"}},{"id":"TEST-028","type":"short","category":"testing","difficulty":3,"topic":"TDD on an existing project","tags":["tdd","legacy","coverage","ui-test","workflow"],"question":"This one comes up onsite: \"how does your team use tests today, and how would you follow TDD on a real project?\" Answer it around a realistic way to bring TDD into an existing app that already has a lot of code.","source":{"kind":"company","company":"Gojek"}},{"id":"TEST-029","type":"short","category":"testing","difficulty":3,"topic":"Unit testing around a singleton","tags":["singleton","dependency-injection","test-isolation","protocol"],"question":"An app calls `AuthManager.shared` directly all over the code. How would you **unit test** the code that depends on this singleton?\n\n```swift\nfinal class AuthManager {\n    static let shared = AuthManager()\n    private(set) var token: String?\n    func login(_ id: String) async throws { token = try await API.login(id) }\n}\n```","source":{"kind":"company","company":"Walmart"}},{"id":"TEST-030","type":"short","category":"testing","difficulty":3,"topic":"Architecture that invites tests","tags":["architecture","testability","dependency-injection","design-round"],"question":"One item the architecture round scores is \"**can you add unit tests without a big refactor**\". Which design decisions satisfy that condition, with an example?","source":{"kind":"company","company":"Discord"}},{"id":"TEST-031","type":"short","category":"testing","difficulty":3,"topic":"What's worth testing","tags":["test-strategy","what-to-test","cost-benefit","priority"],"question":"You just built a product list screen in a live coding round: view model, network, price formatting, and a favorite toggle. The interviewer asks, \"on this screen, **what's worth testing and what isn't?**\"","source":{"kind":"company","company":"CRED"}},{"id":"TEST-032","type":"short","category":"testing","difficulty":2,"topic":"Tests in the workflow","tags":["workflow","ci","pull-request","test-plan","flaky"],"question":"This is a written question on a take-home: \"how do you integrate tests into your development workflow?\" Walk me through when and how tests run, from the moment you write code to merge and release.","source":{"kind":"company","company":"Headspace"}},{"id":"TEST-033","type":"mcq","category":"testing","difficulty":3,"topic":"URLProtocol-based mocking","tags":["urlprotocol","mocking","urlsession","network-test"],"question":"To test the network layer you've decided to intercept responses with a `URLProtocol` subclass. Which statements are **correct**? Select all that apply.\n\n```swift\nfinal class StubProtocol: URLProtocol {\n    static var handler: ((URLRequest) throws -> (HTTPURLResponse, Data))?\n    override class func canInit(with request: URLRequest) -> Bool { true }\n    override class func canonicalRequest(for request: URLRequest) -> URLRequest { request }\n    override func startLoading() { /* ... */ }\n    override func stopLoading() {}\n}\n```","source":{"kind":"company","company":"Flipkart"}},{"id":"TEST-034","type":"mcq","category":"testing","difficulty":2,"topic":"Testing a data structure","tags":["xctest","test-design","edge-case","coderpad"],"question":"On CoderPad you're asked to implement a `MaxStack` where `push`, `pop`, `top`, and `max` are all O(1), built on a Swift protocol, and verify it with XCTest. Which are **appropriate tests**? Select all that apply.","source":{"kind":"company","company":"Apple"}},{"id":"TEST-035","type":"short","category":"testing","difficulty":2,"topic":"Reviewing an iOS PR","tags":["code-review","pull-request","quality","take-home"],"question":"A take-home asks you to review an existing PR and leave comments. When you review an iOS PR, **what do you look at and in what order**?","source":{"kind":"company","company":"Deliveroo"}},{"id":"TEST-036","type":"short","category":"testing","difficulty":2,"topic":"Writing testable code","tags":["testability","dependency-injection","pure-function","design"],"question":"The question asks about your experience writing code with unit tests in mind and the philosophy you took from it. Give me the principles you hold to as **concrete code-level habits**.","source":{"kind":"community","company":"토스"}},{"id":"TEST-037","type":"short","category":"testing","difficulty":3,"topic":"Testing an SDK","tags":["sdk","integration-test","contract-test","backward-compatibility","sample-app"],"question":"Say you're building **a chat SDK that ships inside other companies' apps** rather than an app of your own. From a testing point of view, what changes compared with testing an app?","source":{"kind":"community","company":"센드버드"}},{"id":"TEST-038","type":"mcq","category":"testing","difficulty":2,"topic":"Quick and Nimble","tags":["quick","nimble","bdd","xctest","matcher"],"question":"Your team's codebase uses Quick and Nimble. Which statements about the two libraries are **correct**? Select all that apply.","source":{"kind":"community","company":"카카오뱅크"}},{"id":"TEST-039","type":"short","category":"testing","difficulty":2,"topic":"Reading coverage","tags":["testing","coverage","risk","unit-test"],"question":"An iOS payment app has 90% line coverage, yet payment failure handling regresses every release. What does that 90% guarantee, and what does it fail to guarantee?","source":{"kind":"community","company":"Barclays"}},{"id":"TEST-040","type":"short","category":"testing","difficulty":1,"topic":"Testing a playlist view model","tags":["unit-test","fake","viewmodel","state"],"question":"A music app's playlist ViewModel takes a track list from a Repository and produces loading, success, and error states. How would you test those state transitions without a real network?","source":{"kind":"community","company":"Pandora"}},{"id":"TEST-041","type":"short","category":"testing","difficulty":2,"topic":"Trustworthy tests on CI","tags":["ci","flaky-test","fixture","test-plan"],"question":"In a delivery app's iOS project the unit tests and UI tests pass locally but fail now and then only on CI. How would you cut down these flaky tests?","source":{"kind":"community","company":"요기요"}},{"id":"TEST-042","type":"short","category":"testing","difficulty":2,"topic":"Scope of UI tests","tags":["ui-test","stub","launch-arguments","testing-pyramid"],"question":"A travel booking app's search screen UI tests call every API against the real server, so they're slow and break often. How would you split what stays a UI test from what moves down to unit or integration tests?","source":{"kind":"community","company":"마이리얼트립"}},{"id":"TEST-043","type":"short","category":"testing","difficulty":2,"topic":"The first TDD test","tags":["tdd","red-green-refactor","unit-test","refactoring"],"question":"You're adding coupon discount pricing rules to an online course app with TDD. In the red-green-refactor cycle, which example would you pick as the first test?","source":{"kind":"community","company":"클래스101"}},{"id":"TEST-044","type":"short","category":"testing","difficulty":2,"topic":"Testing an async stream","tags":["asyncstream","testing","cancellation","realtime"],"question":"A live streaming app's chat ViewModel subscribes to incoming messages as an `AsyncSequence` and appends them to a list. How would you control that message stream in a test?","source":{"kind":"community","company":"SOOP"}},{"id":"TEST-045","type":"short","category":"testing","difficulty":2,"topic":"Regression tests in review","tags":["code-review","regression","behavior","testing"],"question":"A PR fixing a bug in a beauty appointment app got a review comment saying there's no reproduction test. The reviewer has already read the code and could approve it, so why ask for a separate reproduction test?","source":{"kind":"community","company":"강남언니"}},{"id":"TEST-046","type":"short","category":"testing","difficulty":2,"topic":"Layers of test automation","tags":["test-pyramid","ci","automation","quality"],"question":"You're adding automated tests to the listing feature of a secondhand marketplace app for the first time. What would you put on each of the three layers: unit tests, API contract tests, and UI tests?","source":{"kind":"community","company":"번개장터"}},{"id":"UIKIT-001","type":"short","category":"uikit","difficulty":1,"topic":"frame vs bounds","tags":["frame","bounds","coordinate","scrollview","transform"],"question":"While debugging a custom UIKit view you notice `bounds.origin` isn't (0, 0). What's the difference between frame and bounds?","source":{"kind":"community"}},{"id":"UIKIT-002","type":"mcq","category":"uikit","difficulty":1,"topic":"View controller lifecycle","tags":["viewcontroller","lifecycle","viewdidload","viewdidappear"],"question":"When a screen appears for the first time, which order do the UIViewController lifecycle methods run in?","source":{"kind":"community"}},{"id":"UIKIT-003","type":"short","category":"uikit","difficulty":2,"topic":"viewDidLoad and network requests","tags":["viewdidload","lifecycle","network","task","cancellation"],"question":"A teammate kicks off a network request directly in viewDidLoad and updates the UI when the response arrives. What problems can this cause?","source":{"kind":"community"}},{"id":"UIKIT-004","type":"short","category":"uikit","difficulty":1,"topic":"Auto Layout basics","tags":["autolayout","constraint","nslayoutanchor","visual-format"],"question":"How is an Auto Layout constraint represented internally, as a formula?","source":{"kind":"community"}},{"id":"UIKIT-005","type":"mcq","category":"uikit","difficulty":2,"topic":"Content Hugging and Compression Resistance","tags":["autolayout","hugging","compression-resistance","priority"],"question":"You've placed `titleLabel` and `dateLabel` side by side on one row with Auto Layout. When the title gets long, the title should shrink (truncate) and the date should always stay fully visible. Which priority do you adjust?","source":{"kind":"community"}},{"id":"UIKIT-006","type":"short","category":"uikit","difficulty":2,"topic":"Intrinsic Content Size","tags":["autolayout","intrinsic-content-size","custom-view","invalidate"],"question":"You put a custom view you built (say, a tag chip view) into a UIStackView and it's sized to zero and invisible. How would you explain the cause and the fix in terms of intrinsic content size?","source":{"kind":"community"}},{"id":"UIKIT-007","type":"mcq","category":"uikit","difficulty":1,"topic":"Safe Area","tags":["safe-area","layout-guide","notch","autolayout"],"question":"Which of the following statements about the Safe Area are correct? Pick **all** that apply.","source":{"kind":"community"}},{"id":"UIKIT-008","type":"mcq","category":"uikit","difficulty":1,"topic":"Leading vs Left","tags":["autolayout","leading","rtl","localization"],"question":"When would it be appropriate to use `leftAnchor` instead of `leadingAnchor` in an Auto Layout constraint?","source":{"kind":"community"}},{"id":"UIKIT-009","type":"short","category":"uikit","difficulty":1,"topic":"Storyboards vs code UI","tags":["storyboard","xib","programmatic-ui","git-conflict"],"question":"Your team is debating whether to use storyboards or build UI purely in code. What are the pros and cons of each?","source":{"kind":"company","company":"Uber"}},{"id":"UIKIT-010","type":"short","category":"uikit","difficulty":2,"topic":"Layout update methods","tags":["setneedslayout","layoutifneeded","layoutsubviews","setneedsdisplay","runloop"],"question":"What do `setNeedsLayout` and `layoutIfNeeded` each do in UIKit, and when should you call them?","source":{"kind":"company","company":"TikTok"}},{"id":"UIKIT-011","type":"mcq","category":"uikit","difficulty":2,"topic":"Constraint animation","tags":["autolayout","animation","layoutifneeded","constraint"],"question":"This Auto Layout code is meant to slide a panel up, but the panel jumps into place with no animation. Why?\n\n```swift\nbottomConstraint.constant = -300\nview.layoutIfNeeded()\nUIView.animate(withDuration: 0.3) {\n    self.view.layoutIfNeeded()\n}\n```","source":{"kind":"community"}},{"id":"UIKIT-012","type":"short","category":"uikit","difficulty":2,"topic":"Cell reuse and async images","tags":["tableview","collectionview","cell-reuse","async-image","prepareforreuse"],"question":"You've inherited a UITableView feed where, on fast scrolling, images briefly show up in the wrong cell and then get replaced. What's the cause?","source":{"kind":"community"}},{"id":"UIKIT-013","type":"mcq","category":"uikit","difficulty":2,"topic":"dequeueReusableCell API","tags":["tableview","dequeue","reuse-identifier","register"],"question":"Which statements about UITableView's `dequeueReusableCell(withIdentifier:for:)` and `dequeueReusableCell(withIdentifier:)` are correct? Pick **all** that apply.","source":{"kind":"community"}},{"id":"UIKIT-014","type":"short","category":"uikit","difficulty":2,"topic":"Dynamic cell height","tags":["tableview","self-sizing","automatic-dimension","estimated-height"],"question":"You need a UITableView cell whose height varies with the length of a comment. What do you set up so the cell height fits its content automatically?","source":{"kind":"community"}},{"id":"UIKIT-015","type":"short","category":"uikit","difficulty":2,"topic":"Responder chain and hit testing","tags":["responder-chain","hit-test","touch","first-responder","uievent"],"question":"When you tap the screen in a UIKit app, how does the system decide which view receives the touch (hit testing)?","source":{"kind":"company","company":"TikTok"}},{"id":"UIKIT-016","type":"mcq","category":"uikit","difficulty":3,"topic":"Overriding hitTest","tags":["hit-test","touch","custom-view","bounds"],"question":"You've put a round button in the middle of a custom UIKit tab bar that sticks 20pt up above it. Tapping the part that sticks out does nothing. Which override below fixes this correctly?\n\n```swift\n// inside the tab bar (parent view)\noverride func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {\n    /* ??? */\n}\n```","source":{"kind":"original"}},{"id":"UIKIT-017","type":"short","category":"uikit","difficulty":3,"topic":"UIView and CALayer","tags":["calayer","uiview","core-animation","rendering","layer"],"question":"How do UIView and CALayer relate to each other, and why are their roles split?","source":{"kind":"community"}},{"id":"UIKIT-018","type":"short","category":"uikit","difficulty":3,"topic":"Nested scrolling cell design","tags":["tableview","collectionview","nested","cell-reuse","content-offset"],"question":"You need to put a horizontally scrolling UICollectionView inside a UITableViewCell in code (a carousel row like the App Store's Today tab). Who should own the inner collection view's dataSource and delegate?","source":{"kind":"community","company":"Airbnb"}},{"id":"UIKIT-019","type":"short","category":"uikit","difficulty":3,"topic":"Diagnosing scroll performance","tags":["performance","scroll","instruments","hitch","offscreen-rendering"],"question":"You get a report that scrolling stutters on a feed screen that mixes images and text. Where do you start, and how do you check?","source":{"kind":"community","company":"Snap"}},{"id":"UIKIT-020","type":"short","category":"uikit","difficulty":3,"topic":"Compositional Layout and Diffable Data Source","tags":["collectionview","compositional-layout","diffable-datasource","snapshot"],"question":"You're moving a screen built with UICollectionViewFlowLayout and an index-based dataSource to UICollectionViewCompositionalLayout and UICollectionViewDiffableDataSource. What gets better?","source":{"kind":"original"},"since":"iOS 13"},{"id":"UIKIT-021","type":"mcq","category":"uikit","difficulty":3,"topic":"Diffable Data Source behavior","tags":["diffable-datasource","snapshot","hashable","collectionview"],"question":"Which statements about using UICollectionViewDiffableDataSource are correct? Pick **all** that apply.","source":{"kind":"original"},"since":"iOS 13"},{"id":"UIKIT-022","type":"short","category":"uikit","difficulty":2,"topic":"View hierarchy traversal","tags":["view-hierarchy","bfs","dfs","subviews","coding"],"question":"How would you write a function that starts at a root view and finds a view matching some condition (say, `tag == 99` or a specific type)?\n\n```swift\nfunc findView(in root: UIView, where predicate: (UIView) -> Bool) -> UIView?\n```","source":{"kind":"community"}},{"id":"UIKIT-023","type":"short","category":"uikit","difficulty":3,"topic":"Finding the common superview","tags":["view-hierarchy","superview","lca","algorithm","coding"],"question":"Given several UIViews, how would you design a function that returns their nearest common superview?","source":{"kind":"community"}},{"id":"UIKIT-024","type":"short","category":"uikit","difficulty":4,"topic":"Offscreen rendering and the render pipeline","tags":["rendering","offscreen","core-animation","gpu","shadow","cornerradius"],"question":"In a UIKit list, you applied `layer.cornerRadius` plus `masksToBounds` plus `shadow` to cells with profile images and the scroll frame rate dropped. From the render pipeline's point of view, why is this expensive?","source":{"kind":"original"}},{"id":"UIKIT-025","type":"mcq","category":"uikit","difficulty":2,"topic":"Dark Mode support","tags":["dark-mode","trait-collection","dynamic-color","cgcolor"],"question":"Which statements about supporting Dark Mode in a UIKit app are correct? Pick **all** that apply.","source":{"kind":"community"},"since":"iOS 13"},{"id":"UIKIT-026","type":"short","category":"uikit","difficulty":4,"topic":"Core Animation model and presentation layers","tags":["core-animation","presentation-layer","model-layer","animation","touch"],"question":"A view animates across the screen over 3 seconds with a UIView animation. Tapping it mid-flight does nothing, and printing `view.frame` mid-animation already shows the destination value. Why do these two things happen?","source":{"kind":"community"}},{"id":"UIKIT-027","type":"short","category":"uikit","difficulty":4,"topic":"Auto Layout performance","tags":["autolayout","performance","cassowary","constraint","layout-pass"],"question":"On a screen made of complex cells with hundreds of constraints, the layout pass shows up as the bottleneck. Based on how the Auto Layout engine works, what drives the cost up?","source":{"kind":"community"}},{"id":"UIKIT-028","type":"mcq","category":"uikit","difficulty":4,"topic":"UIKit render loop pass order","tags":["runloop","layout-pass","update-constraints","display","core-animation"],"question":"In one cycle of the main run loop, what's the correct order of the passes UIKit runs to update the screen? (Assume there are views marked with setNeedsUpdateConstraints, setNeedsLayout, and setNeedsDisplay respectively.)","source":{"kind":"original"}},{"id":"UIKIT-029","type":"short","category":"uikit","difficulty":2,"topic":"Pinning four corners with constraints","tags":["autolayout","nslayoutconstraint","anchor","programmatic-ui","live-coding"],"question":"Live coding. Given an `[UIImage]`, how would you build a custom `UIView` that pins one image to each of its four corners using only constraints in code?\n\n```swift\nfinal class CornerImagesView: UIView {\n    init(images: [UIImage]) { /* ... */ }\n}\n```","source":{"kind":"company","company":"Google"}},{"id":"UIKIT-030","type":"short","category":"uikit","difficulty":3,"topic":"Reimplementing UIScrollView","tags":["uiscrollview","bounds","pan-gesture","contentoffset","internals"],"question":"Suppose UIScrollView didn't exist and you had to build a UIView subclass where content follows your finger. Which property would you change to move the content?","source":{"kind":"company","company":"Meta"}},{"id":"UIKIT-031","type":"short","category":"uikit","difficulty":3,"topic":"Cell impression tracking","tags":["uitableview","impression","analytics","willdisplay","visible-rect"],"question":"Each post in a feed has to send an impression event exactly once when it has been at least 50% visible for at least 1 second. How would you design this impression tracker on top of UITableView/UICollectionView?","source":{"kind":"company","company":"Reddit"}},{"id":"UIKIT-032","type":"short","category":"uikit","difficulty":3,"topic":"Corner cycling animation","tags":["uiview-animate","animation","completion","uiviewpropertyanimator","live-coding"],"question":"A 25-minute UIKit exercise. A small logo view has to move through the four corners in order, top-left, top-right, bottom-right, bottom-left, forever, like the old DVD screensaver. How would you implement it?","source":{"kind":"company","company":"Zomato"}},{"id":"UIKIT-033","type":"mcq","category":"uikit","difficulty":1,"topic":"UIResponder inheritance chain","tags":["uiresponder","uicontrol","inheritance","uibutton"],"question":"Which is the correct inheritance chain from `NSObject` down to `UIButton`?","source":{"kind":"company","company":"Zomato"}},{"id":"UIKIT-034","type":"short","category":"uikit","difficulty":2,"topic":"Sticky header, carousel, pull to refresh","tags":["uicollectionview","compositional-layout","sticky-header","carousel","uirefreshcontrol"],"question":"A take-home review. The home screen needs (1) a filter header that stays pinned to the top while scrolling and (2) two rows of horizontally scrolling carousels, banners and restaurants. Which UIKit APIs would you use for each?","source":{"kind":"company","company":"Swiggy"}},{"id":"UIKIT-035","type":"short","category":"uikit","difficulty":4,"topic":"Making the case for UICollectionView","tags":["uitableview","uicollectionview","migration","list-configuration","tech-lead"],"question":"The project has hundreds of UITableView screens. You want to propose moving them to UICollectionView. How would you persuade the teammates who object?","source":{"kind":"company","company":"네이버웹툰"}},{"id":"UIKIT-036","type":"mcq","category":"uikit","difficulty":2,"topic":"Calls before viewDidLoad","tags":["lifecycle","loadview","awakefromnib","init-coder","uiviewcontroller"],"question":"For a UIViewController instantiated from a storyboard, which methods are called **before** `viewDidLoad()`? Pick **all** that apply.","source":{"kind":"company","company":"라인"}},{"id":"UIKIT-037","type":"short","category":"uikit","difficulty":3,"topic":"UICollectionView internals","tags":["uicollectionview","uicollectionviewlayout","layout-attributes","custom-layout","prefetching"],"question":"Why use UICollectionView instead of UITableView? Explain it in terms of the internal structure: the layout object, attributes, and reuse.","source":{"kind":"company","company":"크림"}},{"id":"UIKIT-038","type":"short","category":"uikit","difficulty":2,"topic":"Separating dataSource and delegate","tags":["uitableview","datasource","delegate","protocol","api-design","objective-c"],"question":"Why did Apple design UITableView with two protocols, `dataSource` and `delegate`, instead of just letting you hand it a data array?","source":{"kind":"company","company":"ByteDance"}},{"id":"UIKIT-039","type":"short","category":"uikit","difficulty":3,"topic":"Per-cell countdown with reuse","tags":["uitableview","timer","cell-reuse","prepareforreuse","runloop","objective-c"],"question":"Each cell in a UITableView flash sale list shows a countdown like \"Time left 00:12:34\" that ticks down every second. Instead of one Timer per cell, how would you design it?","source":{"kind":"company","company":"Baidu"}},{"id":"UIKIT-040","type":"mcq","category":"uikit","difficulty":2,"topic":"Table view call order","tags":["uitableview","datasource","heightforrow","estimatedrowheight","reloaddata","objective-c"],"question":"In a UITableView that doesn't use `estimatedRowHeight`, what's the correct order these four methods are called in right after `reloadData()`?\n\n- `numberOfSections(in:)`\n- `tableView(_:numberOfRowsInSection:)`\n- `tableView(_:heightForRowAt:)`\n- `tableView(_:cellForRowAt:)`","source":{"kind":"company","company":"Tencent"}},{"id":"UIKIT-041","type":"short","category":"uikit","difficulty":3,"topic":"Linked collection and table scrolling","tags":["uicollectionview","uitableview","scrollviewdidscroll","synchronized-scroll","code-review"],"question":"A contacts screen in code review. A horizontally scrolling UICollectionView of letter indexes sits on top, a sectioned UITableView of contacts below; scrolling the table should select the matching index on top, and tapping an index should scroll the table to that section. How would you find and fix the bug where the two directions trigger each other and bounce back and forth forever?","source":{"kind":"company","company":"Microsoft"}},{"id":"UIKIT-042","type":"mcq","category":"uikit","difficulty":3,"topic":"Reused cells and CALayer","tags":["cell-reuse","calayer","shadowpath","gradient","prepareforreuse","objective-c"],"question":"When you add layer effects like gradients, shadows, and animations to reusable UIKit cells, which statements describe a real problem and its correct fix? Pick **all** that apply.","source":{"kind":"company","company":"Alibaba"}},{"id":"UIKIT-043","type":"short","category":"uikit","difficulty":2,"topic":"Image cell reuse and cancellation","tags":["uikit","collection-view","image-loading","reuse"],"question":"In a UIKit collection view with image cells, fast scrolling makes the previous request's response flash on a reused cell before it changes. What would you cancel when the cell is reused?","source":{"kind":"company","company":"Lyft"}},{"id":"UIKIT-044","type":"short","category":"uikit","difficulty":2,"topic":"Finding the common UIView parent","tags":["uiview","view-hierarchy","ancestor","set"],"question":"You're writing a function that finds the nearest common parent of two `UIView`s. Which data structure would you keep one view's superview chain in?","source":{"kind":"community","company":"Oracle"}},{"id":"UIKIT-045","type":"short","category":"uikit","difficulty":2,"topic":"List UI with a completed state","tags":["uitableview","diffable-data-source","state","snapshot"],"question":"A UIKit table screen shows election results. Once every district's result has arrived, the refresh button should hide and the winner's row should be highlighted. Instead of a temporary flag inside the network callback, how would you represent this \"counting complete\" condition?","source":{"kind":"community","company":"BBC"}},{"id":"UIKIT-046","type":"short","category":"uikit","difficulty":2,"topic":"Auto Layout priorities","tags":["autolayout","constraint-priority","hugging","compression-resistance"],"question":"On a narrow screen, a title label and a price label have to share one row, and both demand their full text width. In Auto Layout, what decides which label gets truncated and which stays fully visible?","source":{"kind":"community","company":"더스윙"}},{"id":"UIKIT-047","type":"short","category":"uikit","difficulty":2,"topic":"Undoable game state","tags":["state-management","undo","snapshot","uikit"],"question":"A tic-tac-toe game built with UIKit needs unlimited undo. What would you store to support undoing?","source":{"kind":"company","company":"Instacart"}},{"id":"UIKIT-048","type":"short","category":"uikit","difficulty":3,"topic":"Flood fill on a large grid","tags":["collection-view","flood-fill","bfs","batch-updates"],"question":"You're implementing flood fill on a large pixel grid drawn with a collection view (say, 500×500). If you don't use recursive DFS, how would you write the traversal?","source":{"kind":"community","company":"Pinterest"}},{"id":"UIKIT-049","type":"short","category":"uikit","difficulty":2,"topic":"Chat input bar and keyboard layout","tags":["keyboard","autolayout","chat","safe-area"],"question":"In a UIKit chat screen, the input bar has to sit right on top of the keyboard and follow it as it rises. How would you connect keyboard height changes to Auto Layout constraints?","source":{"kind":"company","company":"JD.com"},"since":"iOS 15"},{"id":"UIKIT-050","type":"short","category":"uikit","difficulty":2,"topic":"Self-sizing cells and Dynamic Type","tags":["dynamic-type","self-sizing","uikit","accessibility"],"question":"A UIKit car listing cell has to grow in height and not truncate under the accessibility large text settings. How do you set up the constraints so the cell height is computed automatically from the text size?","source":{"kind":"community","company":"카카오모빌리티"}}]