iOS Technical Test 2015

1. True or False? When you create a new iOS project from a template, the template automatically makes a controller object for you.
Answers:
• True
• FALSE
2. Automatic migration between Core Data model versions is sufficient for many cases. Which one of the following cases would require additional migration code?
Answers:
• A mandatory attribute is made optional
• An optional attribute is made required
• A relationship has changed from a 'to-one' to a 'to-many' relationship
• A new attribute has been added to an Entity
3. In Objective C, which of the following is group of objects that can be visualized as a physical set of frames?
Answers:
• The stack
• The heap
• The frame
• The set
4. How would you add a property to an Objective C Category?
Answers:
• Create an ivar in the interface definition of the category
• Create an @property definition with @synthesize
• It is not possible to add properties to a category
• Add an associated reference to the category
5. What is the minimum iOS version you can support and still have Automatic Reference Counting?
Answers:
• iOS 5
• iOS 4
• iOS 6
• iOS 3
6. What would be the localized resource name for French?
Answers:
• french.lproj
• fr.plist
• fr.lproj
• fr.local
7. In Objective C, what class will allow you to use one or more blocks concurrently?
Answers:
• NSBlock
• NSBlockOperation
• NSConcurrency
• NSConcurrentBlock
8. What is the effect of using 'weak' in the following @property definition: @property (nonatomic, weak) SomeClass *responder; ?
Answers:
• The responder object is retained and the pointer is set to nil when the object is destroyed
• The responder object is retained and the pointer will point to free memory when the object is destroyed
• The responder object is not retained and the pointer will point to free memory when the object is destroyed
• The responder object is not retained and the pointer is set to nil when the object is destroyed
9. In Core Data, what is the object representation of a record called?
Answers:
• NSManageObjectContext
• NSManagedObjectModel
• NSManagedObject
• NSEntityDescription
10. What flag prevents the device from turning off wifi if your app is running?
Answers:
• Airplane Mode
• UIRequiresPersistentWiFi
• NSWifi
• UINetworkFlag
11. Which 3D Framework was added in iOS since iOS 8?
Answers:
• CoreAnimation
• CoreGraphics
• SceneKit
• Quartz
• SpriteKit
12. In Objective C, what happens when you send a message to a variable that is nil?
Answers:
• Nothing happens
• None of these
• You will receive an error message
• You will receive a confirmation
13. Which of the following statements is TRUE?
Answers:
• When using Grand Central Dispatch your app is assigned three Serial dispatch queues
• (none of these are correct)
• When using Grand Central Dispatch you can create as many serial dispatch queues as you want
• When using Grand Central dispatch only three Serial dispatch queues can operate concurrently
14. How can you make the following code display with rounded corners?   UIView *rectView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];          rectView.backgroundColor = [UIColor redColor];          rectView.layer.cornerRadius = 8;      [self.view addSubview:rectView];
Answers:
• [rectView setNeedsDisplay];
• [rectView drawRect:rectView.bounds];
• rectView.layer.masksToBounds = YES;
• rectView.roundedCornersVisible = YES;
15. What object is responsible for launch time initalization and transitions?
Answers:
• viewDidAppear
• viewDidLoad
• Main.m
• AppDelegate
16. Which of the following best describes the differences between iOS 7 and iOS 6?
Answers:
• iOS 6 is not supported on iPhone 5s and iPhone 5c
• iOS 7 supports Autolayout.
• iOS 7 user interface has been completely redesigned.
• iOS 7 user interface has been completely redesigned and has 64-Bit Support.
17. What structure can be used to define a portion of a series?
Answers:
• NSRange
• NSString
• NSSet
• CGPoint
18. Which of the following code snippets would work for changing the position of a view?
Answers:
• view.frame.x = 0; view.frame.y = 100;
• view.frame.size.x = 0; view.frame.size.y = 100;
• (none of these)
• CGPoint center = view.center; center.x = 0; center.y = 100; view.center = center;
19. Which of the following objects is considered "the managers in an application" by keeping the other objects in sync?
Answers:
• Model objects
• View objects
• All of these
• Controller objects
20. Which of the follow statements is TRUE of the use of categories?
Answers:
• You can also use categories to split the implementation of a complex class across multiple source code files.
• The syntax to declare a category uses the @protocol keyword.
• A category can only be declared for abstract classes.
• The compiler synthesises any instance variable or property accessor methods for the category.
21. What is used to sort Core Data results?
Answers:
• NSCoreDataSort
• NSSortDescriptor
• NSSort
• [self sort]
22. What class supports the sharing of small amounts of data such as strings or dates to iCloud?
Answers:
• NSUrlConnection
• NSOperation
• NSUbiquitousKeyValueStore
23. What is the preferred way to store paths to files?
Answers:
• NSURL
• fileWithPath
• NSFile
• NSSystemResource
24. When do you use the "assign" value for a property?
Answers:
• On strings
• For primitive values such as BOOLs or NSIntegers
• Never. It should always be either: atomic, nonatomic, strong or weak
• On arrays and dictionaries
25. Delegation is an object-oriented approach to:
Answers:
• delegation
• callouts
• callbacks
• calls
26. In order to test your application in XCode, which testing frameworks are available?
Answers:
• OCMock, OCUnit, XCTest
• (all of these)
• MinUnit, IOSUnit
• NUnit, JUnit
• Tes.ting
27. What do you use to expose preferences for your app in the Settings section of the device?
Answers:
• Variables.bundle
• settings.m
• NSSetting
• Settings.bundle
28. Which of the following holds data and knows nothing about the user interface?
Answers:
• All of these
• View objects
• Model objects
• Controller objects
29. Which statement is NOT true of notifications?
Answers:
• Notifications are identified by the name instance method
• Objects register with a notification center to receive notifications
• Notifications must be registered on the App Delegate
• Notifications are used to broadcast messages to possibly several recipients unknown from the sender
30. What is a design pattern?
Answers:
• A methodology for approching database design
• A template for a solution to a common problem faced by programmers
• Coding standards used by an organization
31. What is a persistent object store?
Answers:
• It is the relationships between tables in your data
• It represents an external file of persisted data.
• It is retained database objects
• It is the schema for your object
32. What data type do you initialize if you want a list of items that can change?
Answers:
• NSDictionary
• NSArray
• NSMutableDictionary
• NSMutableArray
33. What function do you call to close the current view and go back to the root?
Answers:
• pushRootViewController
• popToMainViewController
• closeCurrentView
• popToRootViewController
34. What are the two types of predicates?
Answers:
• Expression and Operator predicates
• Comparison and Compound predicates.
• Filter and exclusion predicates
35. What is a SEL?
Answers:
• The C type of a message selector
• A pointer to a method
• A selection
• The C type of a class
36. Which of the following lines of code will cause a run time crash?
Answers:
• NSArray *array = @[ @"1", @"1", @"2", @"YES" ];
• NSArray *array = [NSArray arrayWithObject:nil];
• NSDictionary *dict = [NSMutableDictionary dictionary];
• NSNumber *num = [NSNumber numberWithInt:[NSNumber numberWithInt:1]];
37. True or False: You can weak link to an entire framework?
Answers:
• True
• False
38. If you use threading, on which thread should UI Transitions be called?
Answers:
• The background thread
• Any thread
• Concurrent threads
• The main thread
39. True or False: You need to call retain on ARC enabled properties
Answers:
• False
• True
40. What is a category?
Answers:
• A category is a way to add methods to a class which already exists
• A way to add instance variables to a class which already exists
• A namespace
• A group of classes
41. True or False: viewDidLoad comes after viewDidAppear?
Answers:
• False
• True
42. True or False: A Collection View is another name for a tableView
Answers:
• True
• False
43. What is the function in Objective C that determines what is in the cells of a tableView?
Answers:
• cellForRowAtIndexPath
• cellForTableView
• tableView.cell.content
• tableViewCellContents
44. True or False: You can use %@ to specify a dynamic property in Objectve C.
Answers:
• True
• False
45. What protocol is used to create an action object?
Answers:
• None of these
• CAAction
• CoreAnimation
• NSAction
46. When using ARC, how do you destroy an object in Objective C?
Answers:
• All of these
• Set the variable that points at it to 1
• Set the variable that points at it to 0
• Set the variable that points at it to nil
47. Can two different applications have the same Identifier For Vendor (aka IDFV)?
Answers:
• Yes, because the vendor of the IDFV is defined by the first two parts of the reverse DNS formatted CFBundleIdentifier
• No, the Identifier For Vendor is generated by the association of an application installation and a device
48. How can you temporarily disable layer actions in a Core Animation?
Answers:
• Using the CAExit class
• Using the CATransaction class
• Using the CAStop class
• Using the CAStopAnimation class
49. NSXMLParser is which kind of parser ?
Answers:
• DOM Parser
• SAX Parser
50. What happens if you use fgets and do not give it a size smaller than the buffer?
Answers:
• It will clip its size automatically
• None of these
• It will use the size of the object as its size
• It will overwrite the data past the size
51. This code doesn't do much, but which line will call the + (void)initialize method on the class SomeClass  1. - (void)doSomething 2. { 3.  [SomeClass someClassMethod]; 4.          SomeClass *obj = [[SomeClass alloc] init]; 5.    NSString *descriptionString = [obj getNewString]; 6. }
Answers:
• line 3
• line 4
• line 5
• line 1
52. In Core Data, what is the name of the object representation for the database schema?
Answers:
• NSManagedObjectModel
• NSEntityDescription
• NSManageObjectContext
• NSManagedObject
53. In Objective C, when an application launches and runs the 'main' function, the frame for 'main' is put at the _____ of the stack.
Answers:
• bottom
• top
54. True or False: In Objective C, all instance methods are accessors.
Answers:
• TRUE
• False
55. In which scenario should you use an NSDictionary over an NSArray?
Answers:
• When item retrieval should be fast and in constant time
• When insertion time should be fast
• When storing literals
• It does't matter, they're both data structures and can be used interchangeably
56. Which instrument would be most suited to debug whether a view is drawn from cache or redrawn?
Answers:
• Time Profiler
• Open GL ES Driver
• Zombies
• Core Animation
57. Which of the following is true?
Answers:
• A class cannot implement more than one protocol
• A class cannot be declared as abstract
• Instance variables must begin with underscore
• Instance variables have to be declared in the header file containing the class definition
58. True or False: The main thread handles touch inputs
Answers:
• True
• False
59. What's the difference between a frame and bounds?
Answers:
• It's the same
• Frame is for UIKit objects, bounds are for CoreGraphics.
• Bounds origin is always (0, 0), a frame origin is relative to his container view
60. What structure can hold an x and y coordinate that defines a location?
Answers:
• CGSize
• CGRect
• CGPoint
• NSFrame
61. What do you do when you don't need a reference on a object ?
Answers:
• [obj free]
• [obj dealloc]
• free(obj)
• [obj release];
62. Is it possible to make a full application without using Interface Builder?
Answers:
• Yes, on any platform
• Yes, but only for iPad
• No, you always have to use Interface Builder to meet Apple's app standards
63. Which of the following objects is visible to the user?
Answers:
• Controller objects
• None of these
• Model objects
• View objects
64. What data object can store a timestamp the best?
Answers:
• NSNumber
• NSString
• NSDate
• NSArray
65. What file contains configuration data for the app?
Answers:
• Main.m
• config.m
• AppDelegate.h
• Info.plist
66. An indexPath has a Section and a ____
Answers:
• Row or item
• Grid
• Coordinate
• Column
67. What is Class Extension?
Answers:
• A class extension is used to declare additional interface -- methods and properties -- whose implementation contract will be met within the class's primary @implementaiton
• Extension of class in Objective-C.
68. What data type do you initialize if you want a string that can change?
Answers:
• NSCore
• NSString
• NSChangeableString
• NSMutableString
69. Methods and instance variables are declared in the ______ file, but the actual code for the methods is placed in the _______ file.
Answers:
• implementation, header
• implementation, implementation
• header, header
• header, implementation
70. The archive that holds the saved create and configure view objects is known as:
Answers:
• XIB
• XBI
• XID
• XML
71. If an asset is for iPad only, how do you specify it in the file name?
Answers:
• !iPad
• ~iPhone
• !iPhone
• ~iPad
72. ARC Stands for:
Answers:
• Automatic Retained Collections
• Automatic Reference Counting
• Allocated Reference Cycles
• Autoreleased Reference Counters
73. Which of the following symbols do you prefix a character string with when you want a hard coded string?
Answers:
• @
• *
• &
• #
74. What's the difference between NSArray and NSMutableArray?
Answers:
• NSArray has a limited capacity of 256 items where as NSMutableArray is unlimited
• NSMutableArrayʼs contents can not be modified once itʼs been created whereas a NSArray can be modified as needed
• NSArray is an abstractClass class and NSMutableArray is a protocol
• NSArrayʼs contents can not be modified once itʼs been created whereas a NSMutableArray can be modified as needed
75. How do you reference your app bundle?
Answers:
• app.io
• self.app.fileSystem
• self.bundle
• [NSBundle mainBundle]
76. What is a delegate?
Answers:
• A delegate is a UIView
• A delegate allows one NSObject to send messages to another NSObject, and listen to those messages
• A delegate is a variable
• A delegate holds the type of data a variable stores
77. What function is called for each cell in a Table View?
Answers:
• cellDidAppear
• viewDidLoad
• viewWillLoad
• cellForRowAtIndexPath
78. Which of the following keyboard shortcuts will run your app on the simulator?
Answers:
• Command-P
• Command-A
• Command-R
• Command-G
79. What is @2x used for?
Answers:
• Retina Assets
• Normal Assets
• NSStrings
• All Images
80. True or False? An object with at least one owner can be destroyed.
Answers:
• True
• False
81. What is the name of the type of SQL Database that iOS Supports?
Answers:
• SQL
• SQLite
• MySql
• NoSql
82. Which scenario will not result in NSOperation throwing an exceptions:
Answers:
• When you try to retrieve the result of an NSInvocationOperation object that was canceled.
• When the operation is not ready to execute but its start method is called.
• When the return value from a completion block is nil.
• When the operation is executing or finished (possibly because it was canceled) and its start method is called again.
• When you try to add a completion block to an operation that is already executing or finished.
83. When adding objects to NSMutableDictionary, the key...
Answers:
• Must be wither an NSString or an NSNumber
• Must be a string literal
• Must conform to the NSCopying protocol
• Can be any object
84. What class can implement Document Objects?
Answers:
• NSDocument
• NSUrl
• NSArray
• UIDocument
85. Which one of the following is true?
Answers:
• None of these are true
• You can modify UIKit drawing on a background thread
• You can modify Core Animation layers on a background thread

• You can only create and draw to an image context on the main thread

No comments:

Post a Comment