iOS Interview || Deliveroo || iOS engineer || Swift

Sakshi
4 min readNov 3, 2023

--

Round 1 — Problem solving:

  • Filter items of dictionary based on array to create a menu for restaurant.
let menuItems: [String: Double] = ["Burger": 5.99, "Pizza": 8.99, "Pasta": 7.49, "Salad": 4.99, "Soda": 1.99]
let selectedItems: [String] = ["Burger", "Pizza", "Soda"]


var restaurantMenu: [String: Double] = [:]

for item in selectedItems {
if let price = menuItems[item] {
restaurantMenu[item] = price
}
}

print(restaurantMenu)

Round 2 — Take home task and Code review:

  • A PR was provided and had to review it and put comments. And a simple task to create a list of similar movies as an extension task.
func fetchMovieDetails(movieID: Int, completion: @escaping (MovieDetails?) -> Void) {
// Use URLSession or a networking library to make an API request to fetch movie details
// Parse the response and create a MovieDetails object
// Call the completion handler with the result
}

func findSimilarMovies(for movie: MovieDetails, completion: @escaping ([Movie]) -> Void) {
// Analyze the movie details and find similar movies
// Create a list of similar movies and call the completion handler
}

// Update your UI to show the list of similar movies
func displaySimilarMovies(_ similarMovies: [Movie]) {
// Update your UI with the list of similar movies
}

let movieToFindSimilarTo = // Fetch the movie details of the selected movie
fetchMovieDetails(movieID: movieToFindSimilarTo.id) { movieDetails in
if let movieDetails = movieDetails {
findSimilarMovies(for: movieDetails) { similarMovies in
displaySimilarMovies(similarMovies)
}
}
}

Round 3— Behavioural round:

  • Tell me a time when you faced a lacking colleague? What did you do?
  • Tell me a time you worked on something complex? How did you do it?
  • Tell me a time you added something new to your org? What was the pros and cons?

Round 4— Architecture Round:

  • Design a delivery architecture for a rider, screens will be provided. You’re expected to design ent-to-end flow, UI components, API endpoints and responses, design patterns
1. User Authentication:

The rider should log in with their credentials or through a social media account.
Implement user authentication and authorization to secure access.
2. Rider App:

Develop a Swift-based mobile application for the rider.

Implement the following key screens:

Login/Registration: Allow riders to sign in or register.
Dashboard: Display available orders for delivery.
Order Details: Show detailed information about a selected order.
Navigation: Use a map component (e.g., MapKit) for navigation to the customer's location and the delivery destination.
Order Status: Provide real-time updates on the status of the delivery.
3. Backend Server:

Create a backend server that communicates with the rider app.

Implement RESTful API endpoints for various functionalities, such as:

GET /rider/orders: Retrieve a list of available delivery orders.
POST /rider/orders/{order_id}/accept: Allow riders to accept an order.
POST /rider/orders/{order_id}/complete: Mark an order as completed.
4. Database:

Store data related to rider profiles, order assignments, and order history.
Use a database management system, such as MySQL, PostgreSQL, or NoSQL solutions like MongoDB.
5. Order Management:

Orders are created by customers and assigned to riders.
Riders receive order details, such as the customer's address and the items to be delivered.
Riders can accept or reject orders based on their availability.
6. Real-time Tracking:

Implement real-time order tracking using technologies like WebSockets or push notifications.
Update the rider app with the current location and status of the order.
7. Navigation:

Integrate a navigation SDK or service, such as MapKit or Google Maps, to provide turn-by-turn directions for the rider.
8. Security:

Ensure the security of user data, communication, and authentication.
Use encryption for sensitive data.
9. Notifications:

Send push notifications to inform riders about new order assignments, changes in order status, and important updates.
10. Error Handling and Recovery:

Implement error-handling mechanisms to address network failures, crashes, and other issues gracefully.
Allow riders to report issues or seek help in case of problems during delivery.
11. Design Patterns:

MVC (Model-View-Controller): Use the MVC design pattern to structure your Swift application for separation of concerns.
Singleton Pattern: Implement singletons for managing shared resources, such as location services and authentication.
Observer Pattern: Use the observer pattern for real-time updates in the app.

Round 4 — Extended Take home task:

  • You will be asked to explain your take-home task, anything you would add or remove to the current project and why.
    Then you will be asked to find a subtle bug in a block of code from the same project and questions will be asked to fix it. Issue was, there are multiple search requests getting fired, so the data we receive may not be for the latest query, how to fix this data issue?
var currentSearchTask: URLSessionDataTask?
let debouncingDelay = 0.5 // Adjust the delay as needed

func initiateSearch(query: String) {
// Cancel the current search task if it exists
currentSearchTask?.cancel()

// Schedule a new search request after the debouncing delay
currentSearchTask = URLSession.shared.dataTask(with: yourURLRequest) { (data, response, error) in
// Process the response here
}
DispatchQueue.main.asyncAfter(deadline: .now() + debouncingDelay) {
self.currentSearchTask?.resume()
}
}

--

--

Sakshi
Sakshi

Responses (4)