Objective C Interview Questions & Answers

  1. Question 1. Explain What Objective-c Program Basically Consists Of?

    Answer :

    Objective-C program basically consists of:

    • Preprocessor commands
    • Interface
    • Implementation
    • Method
    • Variables
    • Statements & Expressions
    • Comments
  2. Question 2. Explain What Is Oop?

    Answer :

    OOP means Object Oriented Programming; it is a type of programming technique that helps to manage a set of objects in a system.  With the help of various programming languages, this method helps to develop several computer programs and applications.

  3. Python Interview Questions

  4. Question 3. Explain What Is The Protocol In Objective C?

    Answer :

    In Objetive-C, a protocol is a language feature, that provides multiple inheritances in a single inheritance language.  

    Objective C supports two types of protocol:

    1. Ad hoc protocols known as informal protocol
    2. Compiler protocols known as a formal protocol
  5. Question 4. Explain What Is The Difference Between Polymorphism And Abstraction?

    Answer :

    Abstraction in OOP is the process of reducing the unwanted data and maintaining only the relevant data for the users while polymorphism enables an object to execute their functions in two or more forms.

  6. Python Tutorial

  7. Question 5. Explain What Is Parsing And Mention Which Class Can We Use For Passing Of Xml In Iphone?

    Answer :

    Parsing is the process referred to access the data in the XML element. We can use class “NSXML” parser for passing XML in iphone.

  8. DBMS Interview Questions

  9. Question 6. Mention Which Class Are Used To Establish A Connection Between Applications To The Web Server?

    Answer :

    The class used to establish connection between applications to web server are:

    • NSURL
    • NSURL REQUEST
    • NSURL CONNECTION
  10. Question 7. Explain What Is An Accessor Methods?

    Answer :

    Accessor methods are methods belonging to a class that enables you to get and set the values of instance valuable contained within the class.

  11. C++ Tutorial
    C++ Interview Questions

  12. Question 8. Explain What Is #import?

    Answer :

    #import is a C pre-processor construct to avoid multiple inclusions of the same file.

  13. Question 9. Mention What Is The Class Of A Constant String?

    Answer :

    It’s and NXConstantString. NXConstantString *myString = @ “my string”;

  14. IPHONE APPS Interview Questions

  15. Question 10. List Out The Methods Used In Nsurl Connection?

    Answer :

    Methods used in NSURL connection are:

    • Connection did receive response
    • Connection did receive data
    • Connection fail with error
    • Connection did finish loading
  16. IPHONE APPS Tutorial

  17. Question 11. Explain Class Definition In Objective-c?

    Answer :

    A class definition begins with the keyword @interface followed by the interface (class) name, and the class body, closed by a pair of curly braces.  In Objective-C, all classed are retrieved from the base class called NSObject. It gives basic methods like memory allocation and initialization.

  18. C & Data Structures Interview Questions

  19. Question 12. Mention What Is The Use Of Category In Objective-c?

    Answer :

    The use of category in Objective-C is to extend an existing class by appending behavior that is useful only in certain situations. In order to add such extension to existing classes, objective –C provides extensions and categories. The syntax used to define a category is @interface keyword.

  20. Python Interview Questions

  21. Question 13. Explain What Are The Characteristics Of The Category?

    Answer :

    Characteristics of category includes:

    • Even if you don’t have the original source code for implementation, a category can be declared for any class
    • Any methods that you define in a category will be available to all instances of the original class as well as any sub-classes for the original class
    • At runtime, there is no variation between a method appended by a category and one that is implemented by the original class.
  22. IOS Tutorial

  23. Question 14. Explain What Is Single Inheritance In Objective-c?

    Answer :

    Objective-c subclass can only be obtained from a single direct parent class this concept is known as “single inheritance” .

  24. Question 15. Explain What Is Polymorphism In Objective-c?

    Answer :

    Polymorphism in Objective-C is referred to a capability of base class pointer to call the function.

  25. IOS Interview Questions

  26. Question 16. Explain When To Use Nsarray And Nsmutablearray?

    Answer :

    NSArray: You will use an NS array when data in the array don’t change. For example, the company name you will put in NS Array so that no one can manipulate it.

    NSMutableArray: This array will be used in an array, when data in an array will change. For instance, if you are passing an array to function and that function will append some elements in that array then you will choose NSMutable Array.

  27. Java Tutorial

  28. Question 17. Explain What Is Synthesized In Objective-c?

    Answer :

    Once you have declared the property in objective-C, you have to tell the compiler instantly by using synthesize directive.  This will tell the compiler to generate a getter&setter message.

  29. Java Interview Questions

  30. Question 18. Explain How String Is Represented In Objective-c?

    Answer :

    In Objective-C, the string is represented by using NSS string and its sub-class NSMutableString provides several ways for creating string objects.

  31. DBMS Interview Questions

  32. Question 19. Explain What Is Data Encapsulation In Objective-c?

    Answer :

    In Objective-C, data encapsulation is referred to the mechanism of connecting the data and the functions that use them.

  33. Go (programming language) Tutorial

  34. Question 20. Explain How To Call The Function In Objective-c?

    Answer :

    To call the function in Objective-C, you have to do Account -> Object Name -> Display account information ->  Method name

  35. Go (programming language) Interview Questions

  36. Question 21. Explain What Are Objective- C Blocks?

    Answer :

    In Objective-C class, there is an object that combines data with related behavior.  It enables you to form distinct segments of code that can be passed around to functions or methods as if they were values.  Objective-C blocks can be added to collections like NSDictionary or NSArray.

  37. Question 22. Explain What Is The Main Difference Between The Function Calls And Messages?

    Answer :

    The main difference between function call and message is that a function and its arguments are linked together in the compiled code, but a message and a receiving object are not linked  until the program is executing and the message is sent.

  38. F Sharp (programming language) Tutorial

  39. Question 23. Explain How Messaging Works In Objective-c?

    Answer :

    Messaging are not bound to method implementation until runtime in Objective-C. The compiler transforms a message expression, into a call on a messaging function, objc_msgSend().  This function connects the receiver and the name of the method mentioned in the message.

  40. F Sharp (programming language) Interview Questions

  41. Question 24. Explain How The Class “implementation” Is Represented In Objective-c?

    Answer :

    In Objective-C the class “ IMPLEMENTATION” is represented with @implementation directive and ends with @end.

  42. C++ Interview Questions

  43. Question 25. Explain What Is Dot Notation?

    Answer :

    Dot notation involves assessing an instance variable by determining a class “instance” followed by a “dot” followed in turn by the name of instance variable or property to be accessed.

  44. R Programming language Tutorial

  45. Question 26. Mention Whether Ns Object Is A Parent Class Or Derived Class?

    Answer :

    NS object is the parent class and consists of a number of instance variables and instance methods.

  46. C preprocessor Interview Questions