Ultimate Guide to Mobile System Design Interview

mobile-system-design Jul 13, 2024
Mobile System Design Interview

Introduction

Mobile System Design, as the term suggests, involves designing a system where the system refers to a mobile application. This subject is becoming quite popular and is conducted as one of the technical rounds in iOS developer job interviews of top tech companies. In this article, you are going to learn about the following:

1. What is Mobile System Design Interview?
2. High Level Design
3. Low Level Design
4. Mock Mobile System Design Interview
5. Where to go next?

What is Mobile System Design Interview?

Mobile System Design interview is a two way discussion where the interviewer is also trying to help you with reaching to a solution but don't confuse it with "Interviewer will solve the problem for you". You'll be required to showcase your engineering skillset through the approach and solution you will draw for the given problem. It's broadly classified into two categories:

1. High Level Design
2. Low Level Design

 

High Level Design

When you hear the term High Level Design, you’ll most probably think of it as high level overview of the application. If that’s what you think then you are right, high level design includes details like client-server communication, databases, caching, cloud service etc.

To master this aspect of the system design round, you must consider learning the following concepts:

  1. Client Server Communication:
    • Short Polling
    • Long Polling
    • Websockets
    • Server Sent Events
  2. Data Persistence:
    • UserDefaults
    • NSCache
    • Keychain Access
    • Filesystem
  3. Notification:
    • Local Notifications
    • Push Notifications
    • Rich Push Notifications
    • Silent Push Notifications
  4. Databases:
    • Relational DB - MySQL
    • Non-relational DB - MongoDB, Apache Cassandra, Redis
  5. APIs:
    • REST
    • SOAP
    • GraphQL
    • g-RPC
  6. Infinte Scroll(Pagination):
    • Limite offset based
    • Timestamp based
    • Cursor based

 

Low Level Design

Low level design is simply the breakdown of High Level Design in a programmatic way. It deals with the algorithms, design patterns, architectures and modularisation practices.

If you want to master low level design, you must consider deep-diving into these concepts:

  1. Design Patterns:
    • Creational Design Patterns
    • Structural Design Patterns
    • Behavioural Design Patterns
  2. Architecture Patterns:
    • MVC
    • MVVM
    • MVP
    • VIPER
    • TCA
  3. Dependency Injection:
    • Initialiser Injection
    • Property Injection
    • Method Injection
    • Dependency Injection Containers
  4. Concurrency & Multi-threading
  5. Unit Testing
  6. UML & Class Diagrams
  7. Data Modelling
  8. SOLID Principles

Learning about the concepts involved in these two level of designs alone is sufficient to understand 60% of the mobile system design but we’ll go one step further and mock the Mobile System Design interview round with a real problem statement. This mock will make you understand better how a real system design round is conducted, what should you except from the round and what are the expectations of the interviewer while conducting this round.

 

Mocking Mobile System Design Interview

This interview round is usually conducted on a white board if it’s in an offline setting or via any of the live collaboration tools like Excalidraw, if conducted online. The overall round is of 1 hour, where:

5 mins : Introduction

10 mins : Requirement gathering

10 mins : API Design & Data Model

30 mins : High Level Design & Low Level Design

5 mins : Questions, if any

Problem Statement

Let's say, the interviewer asked you to “Design a Book Downloading Library”.

Requirements

Your solution starts with opening the discussion with the interviewer regarding the requirements of the problem. There are two types of requirements that you need to specifically discuss.

Functional Requirements

It includes all the requirements that directly impacts the functionality of the application.

1. Fetch list of books
2. Download the books
3. Store books in local storage
4. Encryption of the book while storing
5. Pause/Resume download
6. Start/Cancel download

Non-functional Requirements

It includes all the requirements that impacts the performance of the application.

1. Storage Checker
2. Network Strength check
3. Battery Health check
4. Optimal use of APIs

Once, you are done with mapping the requirements with the help of the interviewer, the next step will be to ask the interviewer about any constraints or assumptions that we are we making while developing these functionalities. This will signal the interviewer that you are aware of the feature’s nuances and not blindly following the instructions.

Assumptions or Constraints

1. Maximum number of parallel books download is 5
2. Size of the book shouldn't be greater than 2mb

API Design

The API design part includes discussing the type of APIs specs that will be required as per the defined functionalities. You should be aware about APIs like REST, SOAP, GraphQL, gRPC etc. in order to make a better judgment of the solution for the given use-case.

This particular aspect is more inclined towards backend knowledge but as an iOS developer you consume these APIs in your apps. Therefore, you must have a hold on the ground level concepts.

Range Request will be used to enable the resume and pause functionality.

GET API - swiftanytime.com/books - to fetch the list of books

GET API - swiftanytime.com/books/{book_id}/download - to initiate the book download


Data Schema

Define the data models that play a critical role in the given use-case and segregate them based on the type of requirements. Again, keep sharing your thoughts with the interviewer while making the models. In the book downloading library, Book, Store and BookType are evidently the three models that will be created.


High Level Design

When you start building the high level design, you can start with mapping the core entity of the system first, like BookDownloader is the main feature here and everything will be build around it. In order to start the books download, the BookDownloader will need to communicate with NetworkManager. To maintain the storage of Books you will need StorageManager, and before the storing process kicks-off you'll need to check if all the system vitals performing well. Therefore, PreDownloadRequirementChecker will be introduced. This is how the final High Level Design will look like:


Low Level Design

When you breakdown each aspect into workable modules, you'll find that you've built all the moving parts of system. Now, figure out the associations and design patterns that will be used for all the moving modules to combine them together and make a complete system. The final low level design looks like this:


Where to go next?

Today, you learned about all the aspects of the Mobile System Design Interview round, the expectations of iInterviewers and key things to keep in mind to perform well in this round. If you've read this far, congratulations you are 70% ready to crack your next mobile system design round.

If you are someone looking to crack your next dream iOS job role then we have made a highly comprehensive and practical course "Cracking Mobile System Design Interview". The course is available at a FLAT 33% discount for all the early buyers.

The discount will end on 1st November, 2024 âŹł

What are you waiting for? 

Use the coupon code : EARLY-BIRD-ANYTIME and Buy the course now!

Signup now to get notified about our
FREE iOS Workshops!