Search Your Question

TCS iOS Interview Questions

Location: India
Date: 17-Mar-2022

  1. What is constructor
  2. Difference between swift and obj c and which is better?
  3. Difference between classes and structure, which will require more memory?
  4. What are execution states?
  5. What is stack view?
  6. Difference between guard let and if let()?
  7. What is Tagging?
  8. How to test accessibility in Xcode?
  9. About json and API.
  10. What is super init() and init()?
  11. What is tuple?
  12. What is set?
  13. Difference between tuple and set.
  14. Difference between background state & inactive state?

Location : India
Date : March, 2021

  1. Difference between Swift and Objective C.
  2. What is protocol oriented languages?
  3. Difference between OOPS and POPS ?
  4. What are higher order function?
  5. Difference between map and flat map?
  6. What is compact map?
  7. Difference between MVC and MVVM.
  8. What is optional?
  9. What is optional binding?
  10. Difference between if let and guard let.
  11. What are application states?
  12. How to run our application continuously running in the background?
  13. What is lazy?
  14. What is weak and unowned?
  15. Difference between KVO and Delegate.
  16. What are solid principles?
  17. Difference between GCD and OperationQueue?
  18. Difference between escaping and non-escaping closure.
  19. What is codable?
  20. How to upload your own framework to cocoapods?
  21. How can you move from 4 commits to one commit?
  22. What is git squash?
  23. What is rebase in git?
  24. Difference between management and leadership skill.
Location: Bangalore
Date: March, 2021



2 comments:

  1. I have attended to the technical interview for TCS, the questions that they have asked is:
    1. what is constructor
    2. diff b/w swift and obj c, which is better
    3. diff b/w classes and structure, which will require more memory
    4. what are execution states
    5. what is stack view
    6. diff b/w guard let and if let()
    7. what is Tagging
    8. how to test accessibility in xcode
    9. about json and API
    10. what is super init() and init()
    11. what is tuple
    12. what is set , diff b/w tuple and set
    13. diff b/w background state & inactive state
    14. code for orientation

    ReplyDelete
    Replies
    1. 1. What is constructor?

      A constructor in Swift is the init() method. It's used to initialize an object’s properties when the object is created.


      2. Difference between Swift and Objective-C, which is better?

      Swift: Modern, safer, faster, clean syntax, type-safe.

      Objective-C: Old, more verbose, dynamic.
      ✅ Swift is better for new projects due to better performance and safety.


      3. Difference between classes and structures, which uses more memory?

      Class: Reference type, supports inheritance.

      Struct: Value type, copied on assignment.
      ✅ Classes generally use more memory due to reference counting and heap allocation.

      4. What are execution states?

      App lifecycle states:

      Not Running

      Inactive

      Active

      Background

      Suspended
      These define what the app is doing or not doing in memory.

      5. What is stack view?

      A UIStackView arranges subviews in a horizontal or vertical stack, managing layout automatically with spacing, alignment, and distribution.


      6. Difference between guard let and if let?

      if let: Optional unwrapping inside a block.

      guard let: Unwraps and exits early if nil. Used for early return and cleaner code.
      ✅ Use guard when you want to exit early on failure.



      7. What is Tagging?

      Assigning a tag (Int) to a UI element (e.g., button) to identify it uniquely, especially in loops or actions.


      8. How to test accessibility in Xcode?

      Use Accessibility Inspector tool.

      Enable VoiceOver or run UI tests with accessibility identifiers.

      Set accessibilityLabel, accessibilityIdentifier in code.


      9. About JSON and API?

      JSON: Lightweight data format used for data exchange.

      API: A way apps communicate with backend services.
      You parse JSON from API using Codable in Swift.


      10. What is super.init() and init()?

      init(): Initializes current class.

      super.init(): Calls parent class initializer in subclass to ensure proper setup.


      11. What is Tuple?

      A group of multiple values combined into a single compound value.

      let person = (name: "John", age: 30)


      12. What is Set? Difference between Tuple and Set?

      Set: Unordered collection of unique values.

      Tuple: Fixed number of values of possibly different types.
      ✅ Set is used for uniqueness; Tuple for grouping.


      13. Difference between Background and Inactive state?

      Background: App is running but not on screen.

      Inactive: App is in foreground but not receiving events (e.g., phone call alert).

      Delete

Thanks