iOS Interview || Zeta || SDE2 || Swift

Sakshi
2 min readNov 3, 2023

--

image from Freepik

Round 1 — DSA Round (1 hour):

1 — Find the intersection in 2 linked lists. ✅
2 — Print leaf nodes of a tree. ✅

Round 2 — iOS Round (1 hour):

  • Basic of Swift
  • Concurrency in swift:
    Concurrency in Swift has been traditionally achieved using Grand Central Dispatch (GCD), which dispatches tasks to different queues, and NSOperation, which provides a higher-level API to manage operations. With the introduction of Swift’s new concurrency model, developers now also have native tools like async/await for asynchronous code, tasks for managing units of work, and actors for protecting shared mutable state.
  • Class vs Structures:
    -
    Class is a reference type and is stored in the heap part of memory which makes a class comparatively slower than a struct in terms of performance.
    - Unlike a class, a struct is created on the stack. So, it is faster to instantiate (and destroy) a struct than a class. Unless struct is a class member in which case it is allocated in heap, along with everything else.
    - Use classes if you want reference types. Use structs if you want value types.
    - Value types do not need dynamic memory allocation or reference counting, both of which are expensive operations. At the same time methods on value types are dispatched statically. These create a huge advantage in favor of value types in terms of performance.

Final Round — System Design + Hiring Manager (1.5 hours)

  • Discussions on past projects and work
  • A basic banking application design

--

--