The LinkedIn Skill Assessments feature allows you to demonstrate your knowledge of the skills you’ve added on your profile. Job posters on LinkedIn can also add Skill Assessments as part of the job application process. This allows job posters to more efficiently and accurately verify the crucial skills a candidate should have for a role.
The topics in the Objective-C assessment include:
- General
- Collections
- Variables
- Functions
- Classes
- Control Flow
- Operators and Strings
- Categories and Blocks
- Threading
- Notifications and Unit Testing
Question Format
Multiple Choice
Language
English
Table of Content
- 1 LinkedIn Objective-C Skill Assessment Answers
- 1.1 What is the value of s?
- 1.2 What’s the value of i after these statements?
- 1.3 What value is in str after this line in executed?
- 1.4 What does this code print?
- 1.5 Property defaults include _?
- 1.6 What is the key difference between NSDictionary and NSMutableDictionary?
- 1.7 What is foo?
- 1.8 What can you glean from this line?
- 1.9 What’s wrong with this code?
- 1.10 How many times with this loop be executed?
- 1.11 What is this code an example of?
- 1.12 What does ARC stand for?
- 1.13 What is printed for this code?
- 1.14 What best describes class inheritance in Objective-C?
- 1.15 How many keys does this NSDictionary have after this code is executed?
- 1.16 What is wrong with this code?
- 1.17 What is printed from this code?
- 1.18 What is different about this function?
- 1.19 Structs can have _?
- 1.20 What is wrong with this code?
- 1.21 What is an enums base type for the code below?
- 1.22 If you want to store a small amount of information (e.g., user settings), whats the best, built-in way to go?
- 1.23 What are categories used for?
- 1.24 What is this Objective-C code checking?
- 1.25 What is this a declaration of?
- 1.26 For observing changes to a property, which of these two statements cause the related method to be called and why?
- 1.27 What is wrong with this code?
- 1.28 What’s the difference between an array and a set?
- 1.29 Dot notation can be used for _?
- 1.30 What is the value of newVals after this code is executed?
- 1.31 How would this function be called?
- 1.32 What is the type of the error return value stored in json?
- 1.33 What is significant about this function declaration?
- 1.34 What is printed from this code execution?
- 1.35 You are worried about threaded access to a property and possible collision in writing. What directive should you use on the property?
- 1.36 What is wrong with this line of code?
- 1.37 What is special about the code within this block?
- 1.38 How many items are in set1 after this code executes?
- 1.39 What is wrong with this code?
- 1.40 What is the initial value of the property val?
- 1.41 Which thread should UI updates be processed on to avoid crashes and application lag?
LinkedIn Objective-C Skill Assessment Answers
What is the value of s?
NSMutableString *s = [NSMutableString stringWithString: @”123″];
[s appendString: @”456″];
- 123456
- 123
- 456
- This code contains an error.
What’s the value of i after these statements?
NSString *str = nil;
NSInteger i = str.integerValue;
- nil
- 0
- -1
- This code crashes.
What value is in str after this line in executed?
NSString str = “test” + ” ” + “more”;
- This code contains an error
- test
- nil
- test more
What does this code print?
NSPredicate *p2 = [NSPredicate predicateWithBlock:^BOOL(NSString* evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
return evaluatedObject.intValue % 2 == 0;
}];
NSArray *vals = @[@”1″, @”2″, @”3″];
NSArray *n2 = [vals filteredArrayUsingPredicate:p2];
NSLog(@”%@”, n2.firstObject);
- 2
- 1,2,3
- 1,2
- Nothing, since this code contains an error.
Property defaults include _?
- atomic/strong
- atomic/weak
- nonatomic/weak
- nonatomic/strong
What is the key difference between NSDictionary and NSMutableDictionary?
- NSMutableDictionary’s values can change
- NSMutableDictionary has not initializers.
- NSDictionary can’t be copied.
- NSDictionary’s values can change.
What is foo?
-(float)foo;
- A function with a return type of float.
- This code contains an error.
- A variable declaration of type float.
- A property of type float.
What can you glean from this line?
#import “NSString+NameHelper.h”
- NameHelper is a category of NSString.
- NameHelper is a subclass of NSString.
- NSString implements the NameHelper protocol.
- NSString has a helper class.
What’s wrong with this code?
float x = 5.;
- Nothing is wrong with this code.
- Declarations do not need semicolons.
- x=5 is an invalid float.
- Variables can’t be declared and initialized in the same state.
How many times with this loop be executed?
for (int x=0; x<100; x++) {
x = x + 1;
}
- 50
- 99
- 100
- This code contains an error.
What is this code an example of?
[self addObserver: self forKeyPath: @”val” options:0 context: nil];
- Key-Value Observing
- Class Value Observing
- Key-Data Observing
- KeyPath Observing
What does ARC stand for?
- Automatic Reference Counting
- Automatic Retain Checking
- Async Retain Cycles
- Automatic Release Code
What is printed for this code?
int val = 0;
val = 1.5;
printf(“%d”, val);
- 1
- 2
- 0
- This code contains an error.
What best describes class inheritance in Objective-C?
- single inheritance but multiple protocol implementation
- Objective-C doesn’t support inheritance
- dual class inheritance
- unlimited class inheritance and protocol adherence
How many keys does this NSDictionary have after this code is executed?
NSDictionary dict = [[NSDictionary alloc] initWithObjectsAndKeys: @”b”, @”e”, @”a”, @”r”, nil];
- 2
- 4
- 5
- This code contains an error.
What is wrong with this code?
NSMutableDictionary *dict1 = [NSMutableDictionary dictionaryWithCapacity:5];
[dict1 setValue:@”key” forKey:@”value”];
- The key and value items are mixed
- Nothing is wrong with it
- You can’t set the capacity of a dictionary
- NSMutableDictionary doesn’t have a :setValue:forKey function.
What is printed from this code?
NSData *data = [@”print” dataUsingEncoding:NSASCIIStringEncoding];
NSLog(@”%@”, [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]);
- This code is invalid
- Nothing is printed from this code.
- nil
What is different about this function?
+(void)doSomething;
- It is static
- It is abstract.
- It is inline.
- This code contains an error.
Structs can have _?
- functions
- initializers
- fields
- all of these answers
What is wrong with this code?
@interface MyClass : NSObject
@property (strong, nonatomic, readonly) NSString *name;
@end
- There is nothing wrong with this code.
- There is not read-only directive.
- MyClass doesn’t implement NSObject.
- Properties are declared in the implementation.
What is an enums base type for the code below?
typedef enum { Foo1, Foo2} Foo;
- There is no base type.
- NSObject
- int
- NSNumber
If you want to store a small amount of information (e.g., user settings), whats the best, built-in way to go?
- UserDefaults
- plist file
- CoreData
- TextFile
What are categories used for?
- to extend other classes
- to manage access control
- to coordinate objects
- to group classes
What is this Objective-C code checking?
if ([keyPath isInstanceOf:[NSString class]]) {………..}
- This code contains an error
- if keyPath is an instance of NSString
- if keyPath’s baseclass is the same as NSString’s baseclass
- if keyPath implements the same methods as NSString
What is this a declaration of?
int(^foo)(int);
- an Extension
- a Generic
- a block of code
- an abstract class
1. _val = 1;
2. self.val= 100;
- Statement 2, since it calls the auto-created setter on the property.
- Statement 1, since it uses the property directly.
- Statement 2, since it specifies the class instance to use.
- Statement 1, since it calls the auto-created setter on the property.
What is wrong with this code?
float x = 2.0;
int(^foo)(int) = ^(int n1) {
return (int)(n1*x);
};
foo(5);
- Ints and floats can’t be multiplied.
- The parameter isn’t declared correctly.
- x is not in the right scope.
- Nothing is wrong with this code.
What’s the difference between an array and a set?
- Arrays are ordered, non-unique values.
- Arrays are stored sorted.
- Sets are ordered, unique values.
- Sets can contain nils.
Dot notation can be used for _?
- nothing, as they’re never used in Objective-C
- function calls only
- property getter/setter
- parameter delimiters
What is the value of newVals after this code is executed?
NSArray *vals = @[@”1″, @”2″, @”3″];
NSPredicate *pred = [NSPredicate predicateWithFormat:@”SELF.intValue > 1″];
NSArray *newVals = [vals filteredArrayUsingPredicate:pred];
- 2,3
- nil
- This code contains an error
- 2,”3″
How would this function be called?
-(int)foo:(int)a b:(int)c;
- self.foo(5, b:10);
- This code contains an error.
- [self foo:5:10:20];
- [self foo:5 b:10];
What is the type of the error return value stored in json?
NSError *error;
NSData *data;
id json = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];
- NSString
- NSArray
- id
- NSDictionary
What is significant about this function declaration?
-(void)testFunc:(NSString**)str;
- The parameter is passed by value and can not be changed
- is not allowed on a parameter
- The parameter may be nil
- The parameter is passed by reference and may be changed
What is printed from this code execution?
typedef enum {
thing1,
thing2,
thing3
} Thing;
-(void) enumStuff {
NSLog(@”%d”, thing2);
}
- 0
- 1
- thing2
- This code does not print anything
You are worried about threaded access to a property and possible collision in writing. What directive should you use on the property?
- non-atomic
- strong
- weak
- atomic
What is wrong with this line of code?
int temp = 1==1;
- temp is a keyword.
- 1==1 is invalid.
- 1==1 evaluates to a Boolean.
- Nothing is wrong with it.
What is special about the code within this block?
dispatch_async(dispatch_get_main_queue(), ^{
// code
});
- It executes on the main queue.
- It is the last code to run before the app goes inactive.
- It executes on a background thread.
- It is queued to execute in the background.
How many items are in set1 after this code executes?
NSMutableSet *set1 = [NSMutableSet setWithObjects: @1,@2, @3, @4, @5, nil];
[set1 add0bject:@3];
- zero
- six
- one
- five
What is wrong with this code?
NSDictionary *d1 = @[@”v1″, @4, @”v2″, @5.6, @”v3″];
NSlog(@”d1: %@”, d1);
- NSDictionary cannot be printed this way.
- The last key is missing a value.
- Dictionaries cannot have mixed types as values.
- d1 is assigned an NSArray of values.
What is the initial value of the property val?
@property (nonatomic, readonly) int val;
- 8
- nil
- -1
- undefined
Which thread should UI updates be processed on to avoid crashes and application lag?
- UI
- dispatch
- background
- main
All Linkedin Skill Assessment Answers
List of Technical Skill Assessment
- LinkedIn .NET Framework Skill Assessment Quiz Answers
- LinkedIn Agile Methodologies Skill Assessment Quiz Answers
- LinkedIn Amazon Web Services (AWS) Skill Quiz Answers
- LinkedIn Android Assessment Quiz Answers
- LinkedIn AngularJS Skill Assessment Quiz Answers
- LinkedIn AWS Lambda Skill Assessment Answers
- LinkedIn Bash Skill Assessment Quiz Answers
- LinkedIn C Skill Assessment Quiz Answers
- LinkedIn C# Skill Assessment Quiz Answers
- LinkedIn C++ Skill Assessment Quiz Answers
- LinkedIn CSS Skill Assessment Quiz Answers
- LinkedIn Cyber Security Skill Assessment Quiz Answers
- LinkedIn Django Skill Assessment Quiz Answers
- LinkedIn Eclipse Skill Assessment Quiz Answers
- LinkedIn Front End Development Skill Assessment Quiz Answers
- LinkedIn Git Skill Assessment Quiz Answers
- LinkedIn Google Analytics Skill Assessment Quiz Answers
- LinkedIn Google Cloud Platform (GCP) Skill Assessment Quiz Answers
- LinkedIn Hadoop Skill Assessment Quiz Answers
- LinkedIn HTML Skill Assessment Quiz Answers
- LinkedIn IT Operation Skill Assessment Quiz Answers
- LinkedIn Java Skill Assessment Quiz Answers
- LinkedIn JavaScript Skill Assessment Quiz Answers
- LinkedIn JQuery Skill Assessment Quiz Answers
- LinkedIn JSON Skill Assessment Quiz Answers
- LinkedIn Windows Server Skill Assessment Quiz Answers
- LinkedIn XML Skill Assessment Answers
- LinkedIn Kotlin Skill Assessment Quiz Answers
- LinkedIn Linux Skill Assessment Quiz Answers
- LinkedIn Machine Learning Skill Assessment Quiz Answers
- LinkedIn Maven Skill Assessment Quiz Answers
- LinkedIn Microsoft Azure Skill Assessment Quiz Answers
- LinkedIn MongoDB Skill Assessment Quiz Answers
- LinkedIn MySQL Skill Assessment Quiz Answers
- LinkedIn Node JS Skill Assessment Quiz Answers
- LinkedIn NoSQL Skill Assessment Quiz Answers
- LinkedIn Objective-C Skill Assessment Quiz Answers
- LinkedIn OOP (Object-Oriented Programming Skill Assessment Quiz Answers
- LinkedIn PHP Skill Assessment Quiz Answers
- LinkedIn Python Skill Assessment Quiz Answers
- LinkedIn React JS Skill Assessment Quiz Answers
- LinkedIn Rest APIs Skill Assessment Quiz Answers
- LinkedIn R (Programming Language) Skill Assessment Quiz Answers
- LinkedIn Ruby on Rails Skill Assessment Quiz Answers
- LinkedIn Scala Skill Assessment Quiz Answers
- LinkedIn Search Engine Optimization (SEO) Skill Assessment Quiz Answers
- LinkedIn Spring Framework Skill Assessment Quiz Answers
- LinkedIn Swift Skill Assessment Quiz Answers
- LinkedIn T-SQL Skill Assessment Quiz Answers
- LinkedIn Unity Skill Assessment Quiz Answers
- LinkedIn Visual Basic for Application (VBA) Skill Assessment Quiz Answers
- LinkedIn WordPress Skill Assessment Quiz Answers
List of Business Skill Assessment
- LinkedIn Accounting Skill Assessment Quiz Answers
- LinkedIn Adobe Acrobat Skill Assessment Quiz Answers
- LinkedIn Google Ads Skill Assessment Quiz Answers
- LinkedIn Microsoft Access Skill Assessment Quiz Answers
- LinkedIn Microsoft Excel Skill Assessment Quiz Answers
- LinkedIn Microsoft Outlook Skill Assessment Quiz Answers
- LinkedIn Microsoft Power BI Skill Assessment Quiz Answers
- LinkedIn Microsoft PowerPoint Skill Assessment Quiz Answers
- LinkedIn Microsoft Project Skill Assessment Quiz Answers
- LinkedIn Microsoft Word Skill Assessment Quiz Answers
- LinkedIn SharePoint Skill Assessment Quiz Answers
- LinkedIn Visio Skill Assessment Quiz Answers
List of Design Skill Assessment