Cocoa Api Interview Questions & Answers

Cocoa Api Interview Questions

Are you in search of COCOA Jobs? Then you are at the right place. We provide you with the complete COBOL interview Question and Answers on our page. Cocoa is Apple's native object-oriented application programming interface (API) for their operating system macOS. or iOS, tvOS, and watchOS, a similar API exists, named Cocoa Touch. There are numerous leading companies that offer various job positions in cocoa api like iOS Developer, Senior iOS Developer, Cocoa QA Engineer, Software Engineer, GIT Systems Developer, Foundation Engineer and many more. To clear any interview, you must prepare well for interview, so we provide a complete and tricky Interview questions on our page. To know more about interview question and answers and for various positions in Cocoa Api visit our website

Cocoa Api Interview Questions And Answers

Cocoa Api Interview Questions
    1. Question 1. What Is Cocoa?

      Answer :

      • Cocoa is an application environment and a suite of object oriented components to develop OSX and iOS Apps.
      • Cocoa apps are primarily developed using Objective C & Swift language.
      • Objective C is based out of ANSI C thus ANSI C code can be mixed with Objective C code while developing a Cocoa Application.
      • Cocoa Applications can also include C++ code.

      Cocoa has 3 core frameworks:

      1. Foundation Framework (Part of the core service layer).
      2. App Kit Framework (Application Frameworks).
      3. Core Data Framework.

    2. Question 2. What Does Cocoa Offer?

      Answer :

      Event Driven Behavior – Cocoa provides the infrastructure for event driven behavior.

      It helps manage application, windows and workspaces

      Has a rich library of user interface objects available in Interface builder. UI Objects can be dragged dropped from the interface builder or can be created from code. Some sample UI objects are (buttons, tables, views, windows, panels, drawers, segmented control etc).

      Supports the following:

      • Drawing and imaging
      • Interaction with file system and workspaces
      • Concurrency, multithreading , lazy loading etc
      • Internationalization
      • Different text representation
      • Maintains application preferences
      • Networking, communication with servers
      • Printing support, basic printing to advanced printing options such as pagination and content formatting
      • Handles Undo and Redo management
      • Audio and Video using QuickTime framework
      • Data exchange using Copy Paste and Drag Drop
      • Document based architecture (similar to word or excel)
      • Script-ability, i.e Applications responding to commands emitted from Apple Scripts (e.g: Play, Pause songs in iTunes using Apple Scripts).

    3. Question 3. What Are The Different Layers Of The Mac Osx?

      Answer :

      The Mac OSX is layered into the following:

      User Experience:

      • Aqua
      • Dashboard
      • Spotlight
      • Accessibility

      Application Frameworks:

      • Carbon
      • Java
      • Applet

      Graphics and Media (Application Services):

      • Core Animation
      • Core Image
      • Core Video
      • QuickTime
      • OpenGL
      • Quartz
      • Core Audio

      Core Services:

      • Carbon Core
      • Launch Services
      • Core Foundation
      • Foundation

    4. Question 4. What Is The Main Development Environment For Cocoa?

      Answer :

      • XCode and Interface Builder (For UI Development using drag and drop from an object library).
      • Applications can also be built using a text editor and building the application from command line using make files and use the gdb debugger to debug the application from command line.
      • Using XCode and Interface builder it is very easy to design, manage, build and debug software products.

    5. Question 5. What Is Xcode?

      Answer :

      XCode is the engine that powers Apple’s integrated development environment (IDE) for OSX and iOS.

      Using XCode developers can:

      • Create and Manage Projects,
      • Specify platforms and targets, Dependencies and Build Configurations
      • Build the project
      • Debug the project
      • Can build code written in C, C++, and Objective C
      • Create graphic user interface.
      • Manage Source Code using subversion & git.

    6. Question 6. What Are The Compiling Options In Xcode?

      Answer :

      • GCC : The GNC C Compiler (gcc)
      • LLVM: GCC (Low level virtual machine compiler). Provides past optimization times.
      • Clang: Fast compile times and diagnostics

    7. Question 7. What Is Interface Builder?

      Answer :

      Interface builder is a graphical tool for creating user interfaces.

      Has the following design element:

      • Nib Files /XIB files:contains the objects appearing on a user interface in an archived form.
      • Objects Library: Contains a list of UI Objects.
      • Inspector: Used for configuring the objects of a user interface.
      • Connection Panel: connects outlets to actions.

    8. Question 8. What Are The Performance Tools Available For Cocoa Application Development?

      Answer :

      Instruments : Instruments can be used to show the following

      • CPU Usage
      • Disk Reads and Writes
      • Memory Statistics
      • Thread activity
      • Network statistics etc

      Shark: Traces function calls and graphs memory allocation.

      Big Top: Graphs performance trends.

      Spin Control: Gathers information about what the application was doing when the rainbow spinner appeared.

      Malloc Debug: Shows how much memory the application is consuming and which functions allocated large amounts of memory. Also helps find leaks by finding allocated memory that is not referenced anywhere in the program.

      Quartz Debug: helps debug applications that do large amounts of drawing and imaging.

    9. Question 9. What Are The Primary Cocoa Frameworks Required To Build A Cocoa Application?

      Answer :

      There are two main frameworks required for building Cocoa Applications:

      • Mac OSX Cocoa Applications– Appkit Framework and Foundation Framework.
      • IOS Apps – UIKit Framework and Foundation Framework.

    10. Question 10. What Is Foundation Framework; Specify Some Of Its Features?

      Answer :

      The Foundation framework defines a base layer of classes that can be used for any type of Cocoa program.

      Foundation framework is designed for:

      • Define basic object behavior and introduce consistent conventions for such things as memory management, object mutability, and notifications.
      • Supporting internationalization and localization with (among other things) bundle technology and Unicode strings.
      • For supporting object persistence.
      • For supporting object distribution.
      • Providing some measure of operating-system independence to support portability.
      • Providing object wrappers or equivalents for programmatic primitives, such as numeric values, strings, and collections. It also provides utility classes for accessing underlying system entities and services, such as ports, threads, and file systems.
      • The foundation class hierarchy is rooted at NSObject Class along with NSObject and NSCopying protocols

      The Foundation Framework is logically grouped into Categories.

      Value Objects:

      • Encapsulates values of primitive data types including strings, integers , floats, dates etc
      • NSNumber instantiates numbers that contains integers, floats, doubles
      • NSDate, NSTimeZone, NSCalendar, NSDateComponents provides objects that represent times, dates, calendar and locales


      • NSArray, NSDictionary, NSSet along with the mutable variants

      Operation System Services:

      • File System and URL NSFileManager. NSFileHandle, NSURL etc
      • Concurrency NSThread, NSOperation, NSOperationQueue
      • Interprocess Communication – NSPipe
      • Networking – NSNetService, NSNetServiceBrowser


      Archiving and Serialization

      XML Processing – NSXML

      Predicates and Expressions – NSPredicate, NSCompoundPredicate, NSComparisonPredicate.

      Spotlight Queries NSMetadataItem. NSMetadataQuery.

    11. Question 11. What Is Appkit Framework; Specify Some Of Its Features?

      Answer :

      Appkit framework is needed for implementing graphical, event -driven user interface in OSX like window, buttons, panels, menus, scroller, text field, table views etc.

      The root of the Appkit framework is the NSResponder class.

      Appkit is divided primarily into these areas:

      • User Interface Classes
      • Global Application Object – NSApplication
      • Windows and Views – NSWindow, NSView
      • Controller Classes – NSObjectController, NSArrayController, NSDictionaryController, NSTreeController
      • Panels (Dialogs) – NSPanel
      • Menus and Cursors – NSMenu, NSMenuItem, NSCursor
      • Grouping and Scroll Views – NSBox, NSScrollView, NSSplitView etc
      • Tables and Outline Views

      Text and Fonts – NSFont, NSFontManager.

      Graphics and Colors – NSImage, NSColor, NSColorPanel. NSColorWell, NSGraphicsContext, NSBezierPath etc.

      Printing and Faxing (NSPrinter, NSPrintPanel, NSPageLayout, NSPrintInfo).

      Document and File System Support NSFileWrapper, NSFileManager.

      Sharing Data with other applications – NSPasteBoard.

      Drag & Drop.

      Spell Check – NSSpellServer.

    12. Question 12. What Is The Basic Difference Between The Foundation And The Appkit Framework?

      Answer :

      Foundation (Foundation. Framework):

      • Root Object
      • Classes representing basic data types such as strings and byte arrays.
      • Collection of classes for storing other Objects.
      • Classes representing system information such as dates.
      • Classes representing Communication Ports.

      Application Kit (AppKit.Framework):

      • Graphical, event-driven user interface- Windows, panels, buttons, menus, scrollers, text fields etc.
      • Communication with hardware devices and screen buffers.
      • Event handling, application and document management.
      • Integrate and manage fonts, colors, printing etc.

    13. Question 13. What Are The Root Classes In Cocoa?

      Answer :

      The root class does not inherit from any other class and all other classes inherit from the root class.

      The root class primarily accesses and interacts with the objective C runtime.

      Cocoa has two root classes:

      • NSObject
      • NSProxy (essential in the distributed object architecture)

    14. Question 14. State Some Of The Important Classes In Cocoa?

      Answer :

      NSNumber: Can instantiate object that contains integers, floats or doubles.

      NSDate: For storing streams of bytes, writing data objects to the file system and reading from them.

      NSDate: Displaying dates, times in many formats. Time adjustments based on time zones.

      NSString: Different representation of character strings such as UTF-8 etc.

      NSAttributedString: Supports strings with attributes such as font etc.

      NSArray: Ordered collection of objects, uses zero based indexing.

      NSDictionary: Managing key value pairs, Dictionaries are unordered and must contain unique keys.

      NSSet: Similar to NSArray but unsorted. Contains distinct objects.

      NSFileManager: Used for file operations.

      NSThread: Used for creating multithreaded programs.

      NSOperation & NSOperationQueue : To perform multiple operations (concurrent & Non-Concurrent) in priority and dependence order.

      NSXMLParser: To process XML Data.

      NSXML: Used to represent a XML document as a hierarchical tree.

    15. Question 15. What Is Core Data?

      Answer :

      • Core Data is a cocoa framework that provides infrastructure for managing object graphs & persistent storage.
      • Core Data saves model objects to a persistent store and fetches.
      • Central concept of Core Data is managed object. A managed object is a model object that is an instance of NSManagedObject.
      • Managed Context – All managed objects must be registered in the managed object context. the context allows an application to add objects to the graph and remove them from it.

Popular Interview Questions

All Interview Questions

Cocoa Api Practice Test

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Objective C Tutorial