Most Important questions for the interview (for 2yrs - 4yrs of
experience):
1. Design Pattern: Singleton,
2. Architectural Patterns - MVC, MVVM, MVVM with Clean approach (UseCase/Domain
Layer)
3. Basics of Swift:
ARC, Reference Cycle, Strong weak, [weak self], [unowned self], lazy properties, optional
chaining and binding, force unwrapping, closures: trailing, escaping, non-escaping,
enums, dispatch groups, core data, frame and bounds, generics, inout parameters,
segue, delegate protocol, Scene Delegate and App Delegate, open, private, fileprivate,
public, any and anyObject, ways to persist data
4. Table Views - UICollectionview (Their working and their parent classes)
5. Auto Layout & Vary for constraints
6. Alamofire
7. App Lifecycle: inactive, active, not running, background, suspended
8. View Controller Lifecycle: loadView, viewDidLoad, viewIsLoading [iOS 17.0 & above],
viewWillAppear, viewDidAppear, etc
9. StackView
10.Higher-Order Functions
11.Error Handling
12.Grand Central Dispatch (vs Operation queue)
13.Notification Center
14.Multithreading
15.Size Classes (Compact and Regular)
16.3 types of try: try, try?, try! And throw, throws
17.Latest update in iOS 14 and iOS 15, and changes in Swift 5.
18.Flat map vs compact map
19.Difference between escaping and capturing closures
20.Swift copy on write
Ans: When we talk about value types, we know that they take different memory locations
like reference types. But if we talk about heavy data such as in arrays, it will be very space
inefficient to create new memory space for the same data. That is where Copy on Right
comes into play. It basically doesn’t allocate new memory space for the same data. Only
when you mutate that data, a separate memory space will be created. It is done by default
on the standard library.
21.Static and dynamic dispatch
Ans: Dispatching is basically a mechanism used to know which operation should be
executed.
Static dispatch can be used by both value types and reference types. However, dynamic
dispatch can only be used by reference types because it requires inheritance and value
types don't support this. The order of different types of dispatches is:
1. Inline Dispatch (fastest)
2. Static Dispatch
3. Virtual Dispatch
4. Dynamic Dispatch (slowest)
a. Table Dispatch
b. Message Dispatch
Dynamic Dispatch provides flexibility to the developer in terms of polymorphism.
Dynamic Dispatch basically means method overriding where the compiler has to see which
definition of the method has to be called during runtime from the list of all methods in the
dispatch table and this results in overhead.
How do we achieve this?
1. Dynamic Dispatch: Use inheritance, subclass a base class and then override an
existing method in the base class. Also, you can use dynamic keywords with
prefixes as @objc to expose them to the objective-c runtime environment.
2. Static Dispatch: Use final or static to make sure that inheritance cannot be
performed.
Value types such as struct and enum are by default put under static dispatch.
21.How can you make a singleton class thread-safe?
22.Class vs Struct (4 differences and when to use which)
23.Key-Value Observing (KVO):
It basically adds an observer and notifies when any change in the value has been made.
Optional:
1. Design Pattern: VIPER (View, Interactor, Presenter, Entity, Router)
2. SOAP and REST Difference
24.Other methods to animate without [Link]()
Ans: [Link], UIViewPropertyAnimator, CABasicAnimation (reference)
25.Maps (and differences between a compact map and a flat map)
26.Difference between layoutIfNeeded() and setNeedsLayout()
27.Difference between static and class function
28.ViewController Lifecycle
viewDidLoad()
viewWillAppear(_:)
viewIsAppearing(_:)
viewWillLayoutSubviews()
viewDidLayoutSubviews()
viewDidAppear(_:)
viewWillDisappear()
viewDidDisappear()
deinit()
didReceiveMemoryWarning()
viewWillTransition(to:with:)
[Link]
df-analyzed/B4DZUUTl4wHIAc-/0/1739802452369?e=1741824000&v=beta&t=arnZyfGTw93vynue
T2ZwaC2b8uYcy8uqZ8oO44dI2S8
Urban Company Questions Asked:
1. Classes are thread-safe?
2. How structures are better than classes
3. How structures and classes are stored in memory - stack and heaps
4. Use of layoutIfNeeded and setNeedsLayout
ShareChat Interview Questions:
1. Why are IBOutlets weak? What is the difference between weak and unowned?
Ans: You can create IBOutlets as strong and this is recommended by Apple as per WWDC
2015.
But it doesn’t matter now. You can make it weak or strong.
2. Can we create a custom AppDelegate and delete the default AppDelegate?
Ans: Yes. Just import the required things and you can delete the default AppDelegate.
3. Why is import Foundation required?
Ans:
If you want to work with Strings, Dates, etc you need to import Foundation. The Foundation
framework provides a base layer of functionality for apps and frameworks, including data
storage and persistence, text processing, date and time calculations, sorting and
filtering, and networking.
4. What is the difference between cocoa and cocoa touch?
5. Difference between Error and NSError.
6. Difference between nil, null and .none.
7. Difference between static and dynamic libraries.
8. What is the use of prepareForReuse?
9. Use of reuse Identifier?
10.Take a dictionary and dynamically implement it in a structure.
11.Difference b/w Float and CGFloat
12.Defer in swift
13.Imageinsets and titleinsets
14.Can Enum have functions?
EazyDiner Interview Questions:
1. What is a capturing list?
2. Escaping and non-escaping closure. Write syntax for escaping closure.
3. Associated types in protocols.
4. SOLID principles.
5. Dispatch work item
6. NSOperationsQueue and GCD
Ans: NSOperationQueue is superior to GCD and offers multiple high-level things. Such as
turnaround.
7. Generic Stack
8. Variadic functions
Ans: A function that can take multiple parameters. For eg: A function is created to add
multiple numbers, so you can pass any number of values as parameters.
9. Difference between Array and NSMutableArray.
10.How to give dynamic height to a collectionView cell based on a label inside it.
11.Can we have a table view inside the table view and how will you solve the scrolling issue in this
case?
Ans: You can do this but it is recommended to disable the scroll functionality of the child
table view to improve the overall user experience.
12.Given an array of strings, remove duplicate values.
Ans: A general way in Swift can be to convert the array to a set and back to the array.
13.Write a program with input: a1b2c3 and output abbccc.
KentCam Interview Questions:
1. Delegate Methods of UITextfield, tableView and collectionView
2. The difference between Guard and Guard let
3. Hugging priority and compression resistance priority
4. What are Lazy properties and when to use them?
5. Difference between GET and POST Request
6. SwiftUI specifics -
What are ObservableObjects
What is @Published, @State
How to pass data b/w views in SwiftUI?
7. User Authentication (How you do it - Whole Process)
8. Sort an array of 0,1 s
9. Reverse every word in the string
OLX Interview Questions:
1. Dynamic height TableView Cell
2. Memory Taken by TableView if only 6 cells are visible
3. Unit Testing
4. AB Testing
5. GCD: Queues
6. Queues serial and concurrent
7. Architectural Patterns: MVC, MVVM etc
8. Design Patterns: Factory Design Pattern, Singleton, etc
9. SOLID principles
10.NS Zombie
11. Reference cycle
12.Struct vs class, initializers,
13.Merge Request/ Code Review
14.Difference between Sync and Async
15.Content Hugging and Content Resistance with several examples
16.StackViews
17.POP and advantages
18.CaptureList, ARC,
19.AppLifeCycle + VC LifeCycle
20.LayoutIfNeeded & setNeedsLayout
21.Optional and implementation
22.Dependency Injection and advantages
23.Coupling and Decoupling. Advantages of Decoupling
24.UI updation on which thread and why not on a Background thread
25.How to deinitialize a singleton
26.Dynamic dispatch
Tokopedia:
Write a Swift program to create a new string where all the characters "a" have been removed
except its first and last occurrences.
The function which was called before the didFinishLaunching app?
Winzo Gaming:
1. Write a swift program to check if a tree is a Binary search tree or not.
2. Can the following code be written using struct, why or why not?
class CustomData {
var num: Int?
var value: CustomData?
}
3. What will be the output of the below code and why?
let queue = DispatchQueue(label: "q1")
[Link] {
print("Statement1")
[Link] {
print("Statement2")
}
}
Extra: To make avoid deadlock and execute both statements add .concurrent
attribute (let queue = DispatchQueue(label: "q1", attributes:
.concurrent))
4. If we push to controllerB from controllerA and make an async API call inside didLoad()
block, and we put a print statement inside the completion of the API call.
If the user presses the back button before the API response is received and goes back to
controllerA, will the print statement print something once data is received?
HIKE:
1. Create Own Filter method like Higher Order Filter() -
let array = [1, 2, 3, 4, 5, 6]
print([Link]({ $0>2}))
extension Collection { //Collection types, known as arrays, sets, and dictionaries
func ownFilter(_ isIncluded: (Element) -> Bool) -> [Element] { //Element is the type of values the
array is allowed to store
var result: [Element] = []
for element in self {
if isIncluded(element) {
[Link](element)
}
}
return result
}
}
print([Link]({$0>3}))
2. Why do we use unOwned and! (force unwrap).
3. What will be the outlook?
UPGrad :
1. Read Only Variable -
public class Clock {
private(set) var hours: Int = 13
}
Added from Anuranjan Bose doc (click here)
Fueled (Tech interview round)
1. What is ARC? Difference between weak and unowned
2. Class vs struct
3. A data structure in Swift to access data in constant time
4. What are enums? Are they iterable? If yes, then how
5. Can we add cases in the enum on runtime?
6. What is Codable? Can we override its basic functionality?
7. What is a Safe Area? Give an estimated height of the Safe area if the total height of the
view is 1000 pixels.
8. What is the Intrinsic content size property?
9. How will you design a label inside TableViewCell? The label must have dynamic text(1
liner or 100 liners)
10.What are generics? Give example
11.Nil coalescing and optional chaining in Swift
12.What are higher-order functions? Name a few. Difference between map, compact map
and flat map
13.What is Multithreading in iOS? How will you manage different tasks on the same
thread?
14.Give some examples of Data persistence in Swift? What will you use to store sensitive
information like passwords?
15.MVVM vs MVC
Recro
1. Weak vs strong
2. clipsToBound vs masksToBound
3. RxSwift: What is BehaviorRelay, Observable and which Design Pattern (not
architecture) supports Reactive programming
4. MVVM and its Disadvantages
5. Can IBOutlets be made unowned?
6. What are size classes and what do they do?
7. Static dispatch vs dynamic dispatch
8. Put’s use in RESTful API service
9. Struct A { var value: Int; init(value: Int) { [Link] = value } }
Struct B { var value: Int; init(value: Int) { [Link] = value } }
Let objA = A(value: 5)
var objB = B(value: 5)
print(objA == objB)
(Consider structs are equatable)
10.What are closures? What is [weak self] why do we write so?
11.Var value = 3
Var weekday = “Saturday”
Let closure = { [value] in
print(“Value is \(value)”)
print(“Today is “, weekday)
}
closure()
12.What is multithreading and how can you execute it in code?
13.DispatchGroup and NSOperationQueue
14.What is NSmanagedobjectcontext w.r.t CoreData?
15. Can we delete a property stored in Keychain?
16. Given an array [3, 3, 1, 2] write a program to print the 3rd max element in O(n) time
complexity
VIDA:
1. Struct Kitten {}
Func doSomeThing(kitten: Kitten?) {
Guard let kit = kitten else { return }
print(kit)
}
2. Struct A {
Var someValue: Int = 5 }
Var obj1 = A()
Var obj2 = obj1
[Link] = 2
print([Link])
print([Link])
3. Give examples of value types other than struct
4. Enums, closures, and arrays: what are they? Value or ref type
5. Why MVVM?
6. Explain networking and how to implement
7. Explain Forbidden and Unauthorised
8. PUT vs POST
9. HTTP vs HTTPS. How HTTPS is secured
10.If an API takes 10 mins, how will you manage?
11. How do you manage errors in API response?
12.Status codes: 400, 401, 200, 201. Different ranges and their meaning
13.Problem-solving. Given an array of integers find a contiguous portion of the array with the
largest sum
E.g. [1, -5, 4, 2, -1]
RORO:
1. Difference between struct and class
2. When to use struct, when to use class
3. Inheritance vs Extension. List use cases as well
4. Why is Swift promoted as POP?
5. Explain the git structure in your current project
6. How to reduce conflicts in storyboard files? How to avoid it?
7. How to handle permission manager in iOS for good UX?
8. Can System default permission prompt be viewed again by the user?
9. Problem-solving:
9. a. Say you have an array in which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of
the stock), design an algorithm to find the maximum profit.
inputArray: 6 10 7 9 11 4 8 7
To be done with O(n) complexity
9. B. You ordered three cartons of papers, one carton with only white papers, another
carton with only black papers and a third carton with both white and black papers. When
the cartons get delivered seller sent a note with it that says:
- All the labels on the cartons are incorrect such that no label identifies the actual
contents of the carton it labels.
- If you can correct the labels by only opening one carton and taking one paper out of
the carton and seeing its colour, you will get a full refund.
How would you approach getting a full refund?
9. C. On a table, there are 120 identical coins in a single line labelled 1 to 120. All are
initially tails up. A person flips(if heads are up then make tails up if tails are up then makes
heads up) the coins in the following way:
In the first iteration, the person flips every coin
In the second iteration, the person flips every second coin, i.e., 2nd, 4th, 6th, 8th, …
In the third iteration, the person flips every third coin, i.e. 3rd, 6th, 9th, …
………
……….
On th
e 120th iteration, the person flips the 120th coin.
PAYTM INSIDER(Round 1):
1. States of an application. When an app is running and you receive a call and accept it,
what function gets called in AppDelegate?
2. What do you mean by reference and value types?
3. The life cycle of a view.
4. VC1 -> VC2
1. viewWillDisAppear of VC1
2. viewDidDisAppear of VC1
3. viewWillAppear of VC2
4. viewDidAppear of VC2
Mention the order of the sequence
5. What is a protocol? How to make a function NOT mandatory?
6. What are optionals? How to use optional?
7. If VC1 -> VC2, suggest a way to analyse the time the user stayed on VC1
8. Var a =1
Var b =2
Swap without using 3rd variable and in a single line of code
9. Write a generic func for the addition of two entities.
If the entity is a string then append it, if integers add them
E.g.
Func add(a, b) {
A+b
}
add(“3”, “4) Result: “34”
add(3, 4) Result: 7
10.How to setup push notifications
11.What are weak and strong
12. What is a race condition
13. How to reduce App size
PAYTM INSIDER(Round 2):
1. Lifecycle of UIViewController
2. If Vc1 and vc2 are in a navigation stack and vc2 is popped
Vc2 ka viewWillDisappear
Vc2 ka viewDidDisappear
Vc1 ka viewWillAppear
Vc1 ka viewDidAppear
3. Vc1. If you push vc2 on it, so it seems like vc2 came in from the right. Can you modify
it?
4. Tableview VC collectionview
Collection view seems better than table view so why does not Apple deprecate table
view
5. Escaping and unescaping. Why Apple made @nonescaping default from Swift 3.x
6. What are the associated type of keyword and their use?
7. What is recursive enum? Is it possible?
8. Are recursive structs possible?
9. Auto closures?
DIANAPPS:
1. What is certificate pinning? How to implement it?
2. What is Expectation (related to Unit testing in Swift)
3. Types of closures? Which one is the default?
4. Various ways to pass data
5. Write a generic function to add values(Int, Float, Double)
6. How can concurrency be implemented in Swift?
7. How to monitor memory leaks in Swift?
8. What is Retain cycle?
9. Class vs struct? Give examples of value types and reference types?
10. Is dictionary value or a reference type?
11.NSOperationQueue vs GCD
12.What is Abstraction class?
13.What is a singleton? Pros and cons
NYKAA Round 1:
Build a project, use MVVM to display a list of items (product name, price and rating)
Use URLSession
ONTIC:
1. What is bitcode?
2. What are higher order functions? Difference between map, flatMap and compactMap
3. [Link] { $0 * $1 }. What is $0 and $1. Til what count can we use numbers with $
4. There are two structs User and Address. You have a list of users (Inside each user
there is age, name and list of addresses). Find those users whose age is greater than
30 and whose address contains Noida
5. Are closures reference or value types?
6. What is the difference between value and reference type in terms of memory allocation?
7. If the struct has a property of the class, how memory allocation takes place?
8. How do ARC works? When retain count gets increased
9. If weak var? If used, will it increase retain count
10.What are the concurrency APIs in Swift
11.4 APIs are called. How you manage dependency
NYKAA Round 2:
1. What are SOLID Principles?
2. Write algorithm and code to find a unique element in a sorted array of integers
HIKE:
1. What problems did you face in your iOS development career and how did you resolve
those?
2. What should a UIView’s initialiser take?
3. Declare an optional variable and what are the ways to unwrap it?
4. What if we use a guard let inside a for loop?
5. In the else block of guard let, what else can be written in place of return?
6. Var arr1 = [1, 2, 3]; var arr2 = arr1; [Link](4); print([Link])
7. In objective C, arrays, String, dictionaries were all reference types. Why did Swift make
all these value types?
8. State the states of an application
9. What happens when an application moves to the background?
10.What difference between active and inactive states?
11.Explain the life cycle of a view
12. When and where force unwrapping is used to access optional variables? If it’s
dangerous then why is it there? (Hint: IBOutlets)
13. What is the Reader writer problem? And how to solve it using GCD or without it?
14. Write a closure variable which takes two integers and returns a string
15. Func doSomething(closureArg: ((Int, Int) -> String)) { }. Will it compile? If no, then why
16.What is default type of closure
17.Why and when capture list is used?
18. [Link]({ element in
return [Link] == element
})
Why don’t we use weak self in the above code?
19.When would you want to use the capture list? For escaping or non escaping?
INFOEDGE:
1. Dispatch methods, how does it work
2. Is ARC compile time or run time? How does ARC work in the background?
3. What is Result Type?
4. What difference between class and struct?
5. Are arrays, and dictionaries thread safe?
6. What is witness table?
7. layoutIfNeeded() vs setNeedsLayout()
8. prepareForReuse’s need
9. Escaping vs non-escaping closure? Which one is async/sync?
10. What is a generic protocol
11.Swift vs Objective C
BLINKIT(GROFERS):
1. Lifecycle of a view. Why should we not call API in viewDidAppear
2. What are Optionals? Create a custom optional in Swift
3. How to decide what architecture needs to be implemented?
4. System design for cart page in a shopping app
5. Class or struct for parsing response models and why?
TRAINMAN:
1. How does Swift manage memory?
2. Which is better: Delegate or closure callback?
3. How will you design a multi-level category list?
4. Write a code to put odd integers in the first half and even in the second half of the same
array
PAYTM:
1. clipsToBound vs maskToBound
2. Error handling techniques
3. What does defer do?
4. Main thread: Serial or concurrent? Why?
5. Class func vs static func
6. Frames vs bounds
7. What is the Autolayout engine?
8. Implement a generic queue based on LinkedList
MEDIBUDDY:
1. Fileprivate vs private
2. Application lifecycle
3. Various dataTask methods in URLSession
4. Hierarchy of UIButton
MAKE MY TRIP:
1. Write a program to find if an input string has balanced parenthesis
E.g. {{[()]}} is balanced
{{][}} is not balanced
Round: 1
1. You are given an integer array height of length n. There are n vertical lines drawn such that the
two endpoints of the ith line are (i, 0) and (i, height[i]).
Find two lines that together with the x-axis form a container, such that the container contains the most
water.
Return the maximum amount of water a container can store.
Notice that you may not slant the container.
You are given an integer array height of length n. There are n vertical lines drawn such that the two
endpoints of the ith line are (i, 0) and (i, height[i]).
Find two lines that together with the x-axis form a container, such that the container contains the most
water.
Return the maximum amount of water a container can store.
2. The length of the subarray is k, and
All the elements of the subarray are distinct.
Return the maximum subarray sum of all the subarrays that meet the conditions. If no subarray meets
the conditions, return 0.
A subarray is a contiguous non-empty sequence of elements within an array.
that you may not slant the container.
Example 1:
Input: nums = [1,5,4,2,9,9,9], k = 3Output: 15Explanation: The subarrays of nums with length 3 are:
- [1,5,4] which meets the requirements and has a sum of 10.
- [5,4,2] which meets the requirements and has a sum of 11.
- [4,2,9] which meets the requirements and has a sum of 15.
- [2,9,9] which does not meet the requirements because the element 9 is repeated.
- [9,9,9] which does not meet the requirements because the element 9 is repeated.
We return 15 because it is the maximum subarray sum of all the subarrays that meet the conditions
Example 2:
Input: nums = [4,4,4], k = 3Output: 0
Explanation: The subarrays of nums with length 3 are:
- [4,4,4] which does not meet the requirements because the element 4 is repeated.
We return 0 because no subarrays meet the conditions.
Walmart:
1. SSL Pinning
2. Four sum problem
3. Find longest subsequence string without repeating characters
4. Implement scroll view in UIKit
5. Dispatch Group & Dispatch Barrier
Startup - KynHood:
1. Protocol Extension
2. Protocol Composition
3. Retain Cycle between Class & Struct
Make My Trip:
-> First Missing Positive (DSA)
1. MVC vs MVVM
2. ARC
3. Method Dispatch
Question: protocol { func A() }
Implement it inside a class, what method dispatch it is used
4. Why we make viewModel as a class or struct
5. Weak or Unowned
6. How to break Retain cycle
7. Implementation of MVVM architecture
8. Unit Testing
9. Failable Initaializer
10. How to pass property in Singleton class
Stupa Analytics:
1. If we restart server then how to connect it again if we are using Web sockets
2. Prefer Alamofire or URLSession
3. How to do handshake if we are using WebSockets
4. Is 192 bits in symmetric key
5. How many possible combination can be there if we are using 128bit
6. JWT Token
7. DefableTableView
8. CollectionViewCompositionLayout
Hive:
1. Dependency Injection iin Singleton Class
2. Generic function to add numbers
3. Opaque type (Any Swift in built)
4. App States
5. Is iOS able to kill the app if it is in background
6. Failable Initializer
7. Dynamic vs Static Library
8. Dispatch Semaphore
9. How to perform task on background
10.Property Wrapper with an example
11.Best practices for memory management
12.UiCollectionCompositionLayout
13.UITableViewDiffableDataSource
14.
Deutch Telekom
1. Dispatch Queue related (ques nested queue)
2. Weak vs unowned
3. Async vs sync
4. Coordinator pattern
Target:
struct Test {
let value: Int = 0
}
let t1 = Test()
let t2 = t1
let queue = DispatchQueue(label: "[Link]")
[Link] {
print(1)
}
[Link] {
print(2)
}
[Link] {
print(3)
}
[Link] {
print(4)
}
1,2,3,4
class List {
private(set) var items: [Int] = []
func add(item: Int) {
[Link](item)
}
func clear() {
[Link]()
}
}
func doSomething() throws -> Bool {
defer { print(1) }
defer { print(2) }
print(3)
return true
}
SwiftUI -> UIKit and vice versa
Implementation of own map function
TCA Architecture
Defer block
Exception throw
Make class property thread safe
Use of async and await
Actor - non-isolated properties
Network 18 (SSE- Apr 24):
ROUND 1(DS ALGO)
1. What do you know about memory management in Swift ?
2. Given an array arr[] of size N-1 with integers in the range of [1, N], the task is to find the
missing number from the first N integers.
Note: There are no duplicates in the list.
Examples:
Input: arr[] = {1, 2, 4, 6, 3, 7, 8}, N = 8
Output: 5
Explanation: The missing
number between 1 to 8 is 5
Write clean and executable code
3. Given a string S consisting of lowercase Latin Letters, the task is to find the first
non-repeating character in S.
Examples:
Input: “abcdabce”
Output: d
Explanation: As ‘d’ is first character in the string which does not repeat.
ROUND 2(MOBILE SYSTEM DESIGN)
Create a module for video download.
Requirements:
- Download functionality
- video lib, show list of videos to users
- download videos
- dedicated url for each video
- authentication needed
- save on local storage for offline use
- start, pause, resume, delete
- download can happen in background
- notify the user after download is complete - silent notification
- automatic - store the flag on server
How to ensure that the download will complete even if app goes in Background state?
Ans - set URLSession configuration to Background while creating URLSession object
How to show progress of the download on multiple pages ?
Ans - store progress in DB, use URLSessionDownloadDelegate method to track progress and
update db
1. Find the Next Greater Element for every element in given Array:
eg
arr[] = [ 4 , 5 , 1, 2 , 25 ]
How will the server authenticate the user and how will the user authenticate the server.
Ans - Server auth: SSL Pinning, use authentication token in download request to authenticate
user.
Where is video/images stored in our device ?
Heap Memory
How will we integrate the above created downloader in our app ?Whether in monolithic
architecture or any other way ?
Two ways - either separate module if it needs to be integrated in one app only. Or we can
create a framework that can be plugged as a pod using cocoa pods.
What are things we should ensure while creating a separate framework to ensure its
correctness since it will be used by multiple apps?
Ans. - Unit tests for all the use cases
Multiple code review to ensure quality
Adhere to standards for better quality
Proper testing
Profiling for performance
Had a conversation regarding deleting the unused videos or which are no longer
needed. How will we delete them ?
We can use timestamp to fetch the videos which are not accessed from a long period of time.
Asked about the data structure to perform this task ?
Adobe (SSE- May 24):
Round 1 (DSA):
Output: 4 –> 5
5 –> 25
1 -> 2
2 –> 25
25 –> -1
2. [Puzzle] A person has 81 cows, each cow has a number plate on it numbering from 1 to 81.
Number represents liters of milk a cow provides. Now you have 9 children and you have to
divide these cows among them in such a way that each get equal amount of milk.
Round 2(iOS):
Had discussion regarding, journey and projects, type of frameworks I used. Adobe creates SDKs in
iOS, flutter, React, they do not have any app. So asked why I want to move from app development
to SDK development.
Coding related questions:
1. Iterate from 1 to 100, print “Fizz” if number divided by 3, print “Buzz” if number divided by 5,
print “FizzBuzz” if number divided by 3 and 5 both.
Note: Want to check how to code, what the thought process is, how you think to optimize it.
2. Had a function written that returns the factorial of a number. Asked to find errors, and then
write UT.
Round 3 (Mobile Design):
Need to design a SDK to track the time a user is spending on our app, how do we do that?
BLU SMART:
DSA:
Only solutions no coding
1. Find the missing number from in an array of 1 to N
2. Find the duplicate number in an array
3. Find the number that appears once in an array where others are appearing twice
Project related questions
How to archive an app
Escaping vs non escaping closures
What is ARC
How to use tools to detect memory leaks in the device
How to achieve concurrency using dispatch queues, explain scenarios of all Dispatch group,
Dispatch barrier, Dispatch semaphore
Google (May 24):
Round 1 (DSA):
Check if a point (x, y) can make a square from existing points.
Eg: (1,2), (1,5), (4,2), (4,5) will make a square
Vision Pro (May 24):
Screening Round:
func printstatment(){
print (“0”)
[Link] {
[Link] {
print (“1”)
}
print (“2”)
}
print (“3”)
0, 3, 1, 2
what is the output of below program?
func printstatment(){
print (“1”)
[Link] {
print (“2”)
[Link] {
print (“3”)
}
print (“4”)
}
print (“5”)
} // 1, 5, 2, 4, 3
answers
1. 1,5,2,4,3
2. 5,2,4,3,1
3. 4,3,1,2,5
4. 3,2,4,5,1
what is the output of below program?
func printstatment(){
print(“Step-1”)
[Link] {
print(“Step-2”)
}
print(“Step-3”)
} // 1, 3, 2
answers
1. Step1, Step2, Step3
2. Step2, Step3, Step1
3. Step1, Step3, Step2
4. Step3, Step1, Step2
What is the output of the below program?
[Link] {
print(“Hello”)
print(“Good Morning”)
answers
1. Hello
2. Hello , Good Morning
3. Compile time error
4. App crash
Which code snippet correctly creates a typealias closure?
1. typealias CustomClosure: () -> ()
2. typealias CustomClosure { () -> () }
3. typealias CustomClosure -> () -> ()
4. typealias CustomClosure -> () {}
Consider this code:
let d = ["john": 23, "james": 24, "vincent": 34, "louis": 29]
let x = [Link]{ $0.1 < $1.1 }.map{ $0.0 }
What is the type of x? And what is its value?
1. x is of type [Int] and of value [23, 24, 29, 34].
2. x is of type [String] and of value ["john", "james", "louis", "vincent"].
3. x is of type [Int] and of value [23, “29, 34, 24].
4. x is of type [String] and of value ["vincent", "louis", "john", "james"].
The following code snippet results in a compile time error:
struct IntStack {
var items = [Int]()
func add(x: Int) {
[Link](x)
}
}
Answer:
1- Can’t create property in struct,
2- Print items value successfully
3- compile time error because structures are value types. By default, the properties of a value type
cannot be modified from within its instance methods.
What is the output for the below function?
var name = “Android”
let closure = { [name]
print(“I love \(name)”)
}
name = “iOS developer”
closure()
Answers
1. Given compile error
2. I love iOS developer
3. I love android developer
4. iOS developer
[4:53 pm] Bindu Singh
__________ is a process of querying and calling properties.
A) Swift Chaining
B) Optional Chaining
C) Lazy Chaining
D) All of the above
What is the collection type in swift ?
A) Array and library
B) Dictionary and array
C) Dictionary and library
D) Library, dictionary and array
[4:55 pm] Bindu Singh
What is a type alias in Swift?
a. A way to define a new name for an existing type.
b. A way to define a new type that inherits from an existing type.
c. A way to define a new type that has the same interface as an existing type.
d. A way to define a new type that is a composite of two or more existing types.
What is a guard statement in Swift?
a. A way to define a conditional statement that executes if a condition is true.
b. A way to define a loop that continues until a condition is true.
c. A way to define a conditional statement that executes if a condition is false.
d. A way to define a loop that breaks when a condition is false.
Walmart First Round (DSA):
- Given 2 numbers First and Second, move all the occurrences of First to the right end and
Second to the left end and the order of remaining numbers should not change.
- Given a linked list, remove the consecutive duplicates.
Eg:- 1,2,3,2,2 Output:- 1,2,3,2
-
Expedia(1 st Round):-
- Find the Loop in Linked List
- What is stateObject, ObservedObject and Environment object
- What are ways to transfer data in SwiftUI from 1 view to another
- What is State and Binding
- Frame and Bounds
- Struct vs Class
- Why every view in swiftUI is a struct
- Closure types and use
Lenskart (Technical Round 1) :
● Static vs Dynamic Dispatch
● Class vs structs
● Higher Order Functions - ( Which higher order functions would you use to find the
average of the squares of all elements in an array)
Ans - Map to square all elements of an array then reduce to get their average
● SOLID Principles (Dependency Inversion and Liskov Substitution)
● Asked to share the screen and open xcode, Write a program to fetch the data from
the API (url given by the interviewer of the JSON data) using URLSession and follow
the MVVM Model to display that data in the table view. (Took almost about an hour to
code this) { They will check your understanding of Singleton, MVVM, Completion
Handler, creating model data, Data fetching and data parsing plus UI.
Lenskart(Technical Round 2) :
● setNeedsLayout vs LayoutIfNeeded
● Content hugging vs compression resistance
● A clock has 4:20 time, what is the angle between minute and hour hand
var array = [1,2,3,4,5]
for i in array {
print(i)
[Link](i)
}
● Apps Lifecycle and all its methods
● UIButton Hierarchy
● What is intrinsic content size
● Clip to bounds vs mask to bounds
● QoS (Quality of Services) - their priority order