1- How could you setup Live Rendering - *answers *The attribute @IBDesignable lets
Interface Builder perform live updates on a particular view.
2- What is the difference between Synchronous & Asynchronous task - *answers
*Synchronous: waits until the task has completed Asynchronous: completes a task in
background and can notify you when complete
3- What Are B-Trees - *answers *B-trees are search trees that provide an ordered key-
value store with excellent performance characteristics. In principle, each node maintains
a sorted array of its own elements, and another array for its children.
4- What is made up of NSError object - *answers *There are three parts of NSError
object a domain, an error code, and a user info dictionary. The domain is a string that
identifies what categories of errors this error is coming from.
5- What is Enum - *answers *Enum is a type that basically contains a group of related
values in same umbrella.
6- What is bounding box - *answers *Bounding box is a term used in geometry; it refers
to the smallest measure (area or volume) within which a given set of points.
7- Why don't we use strong for enum property in Objective-C - *answers *Because
enums aren't objects, so we don't specify strong or weak here.
8- What is @synthesize in Objective-C - *answers *synthesize generates getter and
setter methods for your property.
9- What is @dynamic in Objective-C - *answers *We use dynamic for subclasses of
NSManagedObject. @dynamic tells the compiler that getter and setters are
implemented somewhere else.
10- Why do we use synchronized - *answers *synchronized guarantees that only one
thread can be executing that code in the block at any given time.
11- What is the difference strong, weaks, read only and copy - *answers *strong, weak,
assign property attributes define how memory for that property will be managed.
Strong means that the reference count will be increased and the reference to it will be
maintained through the life of the object
Weak ( non-strong reference ), means that we are pointing to an object but not
increasing its reference count. It's often used when creating a parent child relationship.
The parent has a strong reference to the child but the child only has a weak reference to
the parent.
Every time used on var
Every time used on an optional type
,Swift Test Questions
Automatically changes itself to nil
Read only, we can set the property initially but then it can't be changed.
Copy, means that we're copying the value of the object when it's created. Also prevents
its value from changing.
12- What is Dynamic Dispatch - *answers *Dynamic Dispatch is the process of
selecting which implementation of a polymorphic operation that's a method or a function
to call at run time. This means, that when we wanna invoke our methods like object
method. but Swift does not default to dynamic dispatch
13- What's Code Coverage - *answers *Code coverage is a metric that helps us to
measure the value of our unit tests.
14- What's Completion Handler - *answers *Completion handlers are super convenient
when our app is making an API call, and we need to do something when that task is
done, like updating the UI to show the data from the API call. We'll see completion
handlers in Apple's APIs like dataTaskWithRequest and they can be pretty handy in
your own code.
The completion handler takes a chunk of code with 3 arguments:(NSData ,
NSURLResponse?, NSError?) that returns nothing: Void. It's a closure.
The completion handlers have to marked @escaping since they are executed some
point after the enclosing function has been executed.
15- How to Prioritize Usability in Design - *answers *Broke down its design process to
prioritize usability in 4 steps:
Think like the user, then design the UX.
Remember that users are people, not demographics.
When promoting an app, consider all the situations in which it could be useful.
Keep working on the utility of the app even after launch.
16- What's the difference between the frame and the bounds - *answers *The bounds
of a UIView is the rectangle, expressed as a location (x,y) and size (width,height)
relative to its own coordinate system (0,0).
The frame of a UIView is the rectangle, expressed as a location (x,y) and size
(width,height) relative to the superview it is contained within.
17- What is Responder Chain - *answers *A ResponderChain is a hierarchy of objects
that have the opportunity to respond to events received.
, Swift Test Questions
18- What is Regular expressions - *answers *Regular expressions are special string
patterns that describe how to search through a string.
19- What is Operator Overloading - *answers *Operator overloading allows us to
change how existing operators behave with types that both already exist.
20- What is TVMLKit - *answers *TVMLKit is the glue between TVML, JavaScript, and
your native tvOS application.
21- What is Platform limitations of tvOS - *answers *First, tvOS provides no browser
support of any kind, nor is there any WebKit or other web-based rendering engine you
can program against. This means your app can't link out to a web browser for anything,
including web links, OAuth, or social media sites.
Second, tvOS apps cannot explicitly use local storage. At product launch, the devices
ship with either 32 GB or 64 GB of hard drive space, but apps are not permitted to write
directly to the on-board storage.
tvOS app bundle cannot exceed 4 GB.
22- What is Functions - *answers *Functions let us group a series of statements
together to perform some task. Once a function is created, it can be reused over and
over in your code. If you find yourself repeating statements in your code, then a function
may be the answer to avoid that repetition.
Pro Tip, Good functions accept input and return output. Bad functions set global
variables and rely on other functions to work.
23- What is ABI - *answers *ABIs are important when it comes to applications that use
external libraries. If a program is built to use a particular library and that library is later
updated, you don't want to have to re-compile that application (and from the end-user's
standpoint, you may not have the source). If the updated library uses the same ABI,
then your program will not need to change. ABI stability will come with Swift 5.0
24- Why is design pattern very important - *answers *Design patterns are reusable
solutions to common problems in software design. They're templates designed to help
you write code that's easy to understand and reuse. Most common Cocoa design
patterns:
Creational: Singleton.
Structural: Decorator, Adapter, Facade.
Behavioral: Observer, and, Memento
25- What is Singleton Pattern - *answers *The Singleton design pattern ensures that
only one instance exists for a given class and that there's a global access point to that