iOS Intern MCQ Test (60 Questions | 100
Marks)
Section A: Basic Level [1 Mark Each × 20 = 20 Marks]
1. Which programming language is primarily used for iOS development?
● a) Kotlin
● b) Swift
● c) Java
● d) Dart
✅ Answer: b
2. What is Xcode used for?
● a) Video editing
● b) iOS app development
● c) Web hosting
● d) Data analysis
✅ Answer: b
3. Which of the following is a user interface framework in iOS?
● a) TensorFlow
● b) React
● c) UIKit
● d) OpenGL
✅ Answer: c
4. What is IBOutlet used for in Swift?
● a) To perform network calls
● b) To declare constants
● c) To connect UI elements to code
● d) To declare private variables
✅ Answer: c
5. Which version control system is most commonly used in iOS development?
● a) Git
● b) CVS
● c) SVN
● d) Mercurial
✅ Answer: a
6. What is the default IDE for iOS development?
● a) Android Studio
● b) Eclipse
● c) Xcode
● d) IntelliJ IDEA
✅ Answer: c
7. Which of these is used for layout constraints in iOS?
● a) Layout Manager
● b) Auto Layout
● c) StackView
● d) Flexbox
✅ Answer: b
8. What keyword is used to declare a constant in Swift?
● a) var
● b) const
● c) final
● d) let
✅ Answer: d
9. What file extension is used for Interface Builder files?
● a) .nib
● b) .java
● c) .html
● d) .php
✅ Answer: a
10. What does MVC stand for?
● a) Model-View-Code
● b) Model-View-Controller
● c) Main-View-Connection
● d) Modular-Variable-Class
✅ Answer: b
11. Which tool is used for debugging in Xcode?
● a) Debug Navigator
● b) Chrome Inspector
● c) Console
● d) Visual Studio Tools
✅ Answer: a
12. Which method is called when a ViewController's view is loaded into memory?
● a) viewDidAppear()
● b) loadView()
● c) viewDidLoad()
● d) awakeFromNib()
✅ Answer: c
13. What framework helps store data locally in iOS?
● a) SwiftUI
● b) Firebase
● c) Core Data
● d) CloudKit
✅ Answer: c
14. What does @IBAction do?
● a) Declares an interface
● b) Connects a button tap to a method
● c) Exposes variables
● d) Instantiates objects
✅ Answer: b
15. What type of variable declaration allows its value to be changed?
● a) let
● b) final
● c) const
● d) var
✅ Answer: d
16. Which iOS feature provides animations and transitions for views?
● a) SpriteKit
● b) ARKit
● c) UIView.animate
● d) CoreData
✅ Answer: c
17. What is UserDefaults used for?
● a) Animating UI
● b) Temporary file storage
● c) Storing small user settings
● d) Creating custom views
✅ Answer: c
18. What function is used to register a cell in a UITableView?
● a) register()
● b) registerCell()
● c) dequeueReusableCell()
● d) tableView.register()
✅ Answer: d
19. Which iOS framework is used for media playback?
● a) UIKit
● b) AVFoundation
● c) CoreData
● d) Foundation
✅ Answer: b
20. What kind of queue does GCD use?
● a) Stack
● b) Pipeline
● c) Serial/Concurrent
● d) Buffer
✅ Answer: c
Section B: Intermediate Level [2 Marks Each × 40 = 80 Marks]
21. What is a storyboard in iOS development?
● a) Data file
● b) Swift file
● c) UI flow diagram
● d) Settings file
✅ Answer: c
22. Which Swift data type can store a list of elements?
● a) Struct
● b) Class
● c) Array
● d) Enum
✅ Answer: c
23. What is optional in Swift?
● a) A variable that never has a value
● b) A variable that can store nil
● c) A fixed-size variable
● d) A custom function
✅ Answer: b
24. How do you unwrap an optional safely?
● a) with !
● b) with try
● c) with if let
● d) with do-catch
✅ Answer: c
25. What is the default method for table view data population?
● a) collectionView(_:cellForItemAt:)
● b) tableView(_:cellForRowAt:)
● c) numberOfItemsInSection
● d) populateData()
✅ Answer: b
26. What is a delegate in iOS?
● a) A UI component
● b) A class that performs networking
● c) A design pattern for communication
● d) A compiler error
✅ Answer: c
27. What is @State used for?
● a) UIKit layout
● b) SwiftUI state management
● c) Core Data
● d) Debugging
✅ Answer: b
28. Which keyword is used to create a function in Swift?
● a) function
● b) func
● c) def
● d) method
✅ Answer: b
29. What is the function of Instruments in Xcode?
● a) Designing UI
● b) Monitoring performance
● c) Uploading to App Store
● d) Testing on real devices
✅ Answer: b
30. What is the role of the AppDelegate?
● a) UI creation
● b) Handles app lifecycle
● c) Manages database
● d) Initializes views
✅ Answer: b
31. Which type is best for making reusable UI components?
● a) ViewController
● b) TableView
● c) Custom View
● d) IBOutlet
✅ Answer: c
32. What is the correct way to perform an asynchronous task in Swift?
● a) DispatchQueue.main.async
● b) sleep()
● c) Thread.run()
● d) wait()
✅ Answer: a
33. What is a closure in Swift?
● a) A UI element
● b) A class
● c) A block of code
● d) A storyboard file
✅ Answer: c
34. What does defer keyword do in Swift?
● a) Delays app launch
● b) Declares errors
● c) Postpones execution to end of scope
● d) Catches exceptions
✅ Answer: c
35. How do you create a singleton in Swift?
● a) With static let shared = ClassName()
● b) With let instance = ClassName()
● c) With init()
● d) Using super.init()
✅ Answer: a
36. What is a retain cycle?
● a) Infinite loop
● b) A UI bug
● c) Memory leak due to strong references
● d) CoreData error
✅ Answer: c
37. Which attribute allows design preview in Interface Builder?
● a) @available
● b) @IBInspectable
● c) @IBOutlet
● d) @discardableResult
✅ Answer: b
38. What is SwiftUI mainly used for?
● a) Testing
● b) Network management
● c) Declarative UI building
● d) Audio processing
✅ Answer: c
39. What is the correct file extension for a Swift file?
● a) .swift
● b) .swt
● c) .swf
● d) .xcode
✅ Answer: a
40. What function is used to handle memory warning in UIKit?
● a) didReceiveMemoryWarning()
● b) viewDidLoad()
● c) memoryLow()
● d) handleMemory()
✅ Answer: a
41. Which keyword in Swift prevents subclassing of a class?
● a) static
● b) weak
● c) final
● d) let
✅ Answer: c
42. What is the correct way to define an enum in Swift?
● a) enum Colors { case Red, Green }
● b) enum Colors = [Red, Green]
● c) var Colors = enum { Red, Green }
● d) class enum Colors { Red, Green }
✅ Answer: a
43. Which modifier is used to mark properties that should not be serialized?
● a) transient
● b) static
● c) private
● d) @NSManaged
✅ Answer: a
44. What is the purpose of Codable protocol in Swift?
● a) UI animations
● b) Background threading
● c) Encoding and decoding data
● d) Making network requests
✅ Answer: c
45. What is NavigationView used for in SwiftUI?
● a) Playing audio
● b) Displaying settings
● c) Providing navigation between views
● d) Drawing shapes
✅ Answer: c
46. Which method is used to dequeue a reusable cell in a UITableView?
● a) reuseCell(with:)
● b) dequeueCell()
● c) dequeueReusableCell(withIdentifier:)
● d) getCell(identifier:)
✅ Answer: c
47. What is the correct syntax for a function with parameters in Swift?
● a) func greet(String name)
● b) function greet(name: String)
● c) func greet(name: String)
● d) greet func(String name)
✅ Answer: c
48. In SwiftUI, what does @Binding do?
● a) Binds data to a class
● b) Creates a constant
● c) Establishes a two-way data link
● d) Prevents updates to a variable
✅ Answer: c
49. What is the main use of Combine framework in iOS?
● a) Image rendering
● b) Audio playback
● c) Declarative data binding and reactive programming
● d) Push notifications
✅ Answer: c
50. What function triggers navigation in UIKit?
● a) present()
● b) navigate()
● c) show()
● d) pushViewController(_:animated:)
✅ Answer: d
51. Which lifecycle method is called just before the view disappears?
● a) viewDidDisappear()
● b) viewWillDisappear()
● c) viewDidLoad()
● d) loadView()
✅ Answer: b
52. What will happen if a strong reference cycle is not resolved?
● a) Faster performance
● b) Runtime crash
● c) Memory leak
● d) App automatically frees memory
✅ Answer: c
53. What type of value can an optional hold?
● a) Only strings
● b) Only integers
● c) nil or a value
● d) Only non-nil values
✅ Answer: c
54. What is the use of guard statement in Swift?
● a) Handling UI layout
● b) Ensuring conditions are met before proceeding
● c) Starting a network request
● d) Looping over collections
✅ Answer: b
55. What does lazy keyword do in Swift?
● a) Declares static methods
● b) Delays initialization until first use
● c) Creates uninitialized variables
● d) Hides variables from access
✅ Answer: b
56. How can you prevent memory leaks when using closures in classes?
● a) Use unowned self or weak self
● b) Use strong self
● c) Use static keyword
● d) Avoid closures
✅ Answer: a
57. Which iOS concept allows multiple tasks to run in parallel?
● a) Auto Layout
● b) GCD (Grand Central Dispatch)
● c) UIKit
● d) Interface Builder
✅ Answer: b
58. Which of the following is a valid tuple in Swift?
● a) (String, Int)
● b) [String, Int]
● c) {String, Int}
● d) <String, Int>
✅ Answer: a
59. What is @Published used for in SwiftUI with ObservableObject?
● a) Publishing errors
● b) Handling UI layout
● c) Automatically notifying views of data changes
● d) Archiving models
✅ Answer: c
60. What does fatalError() do?
● a) Logs a warning
● b) Silently ignores error
● c) Terminates app with a message
● d) Creates a UI error
✅ Answer: c