0% found this document useful (0 votes)
3 views

iOS Interview Question and Topics

The document outlines various iOS multithreading concepts, including definitions of threads, Grand Central Dispatch (GCD), and operation queues. It explains the types of queues in GCD, the difference between synchronous and asynchronous operations, and discusses issues like deadlocks and race conditions. Additionally, it covers how to create and manage operation queues, including adding dependencies and completion blocks.

Uploaded by

bbakerr1230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

iOS Interview Question and Topics

The document outlines various iOS multithreading concepts, including definitions of threads, Grand Central Dispatch (GCD), and operation queues. It explains the types of queues in GCD, the difference between synchronous and asynchronous operations, and discusses issues like deadlocks and race conditions. Additionally, it covers how to create and manage operation queues, including adding dependencies and completion blocks.

Uploaded by

bbakerr1230
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

iOS Interview Question:

●​ Multithreading related question


1.​ What is thread ? - Single sequence if execution
2.​ What is gcd , how is it used in multithreading ?
3.​ What is Qos in GCD?
4.​ What is the method followed in GCD ? - dispatch queue
5.​ What type of queue are there in GCD ? - serial , concurrent , main and global
6.​ ​Does the application have its own global queue or does the whole OS have one
global queue which the apps are sharing ? - ANS : only one global queue in the
system OS and it is shared all over the app in the phone . the system dispatch
mechanism allocated based on the QOS of the global queue - meanwhile one
app global queue is not interacted with other apps. But it might impact the
performance.
7.​ Adding on we can create a custom queue of serial or concurrent type in an
individual app and it is used within the app only .
8.​ What will happen when you call a sync operation inside the async code in GCD ?
9.​ What is sync block and async block does ? Ans: sync - does not transfer the
control back to caller function until it finishes the work whereas Async block
transfers the control back to the called function and execution happens
sometime.
10.​What does Serial Queue and Current queue diff ? ANS: Only one queue is
executed in time [ serial ] and Concurrent queue [ multiple queue work parallel ]
11.​What is OperationQueue?
12.​What is diff btw GCD and operation queue ? and what is the advantage for the
ans given ?
13.​What are all the advantages we have with operation Queue ?
14.​How will you add operations ? - ANS : block operation - let operation =
BlockOperation {}
15.​How will I create a NSOperationQueue? - let queue = operationQueue()
16.​How will you add the dependency , priority , cancel, maximum no of current
operations , pause in the operation queue ?
17.​Completion block on the operation Queue ? ANS: operation.completionBlock { }
18.​What is a deadlock ?? - ANS : two thread tried to lock each other ended in no
response
19.​What is race condition ? - ANS : multiple threads accessing a shared resource
ended up in incorrect value given back. - dispatch semaphore is solution or lock
or serial execution
20.​What is Dispatch Semaphore ?
21.​What is Async await ?
22.​What is the dispatch barrier ?
23.​How does serial.sync block and serial.async block work ? and how abt the
control transfer block?
24.​And what is the diff btw serialque.async and and global.async and how is it
executed ?
25.​

You might also like