Leanpub Header

Skip to main content

Mobile Coding Interviews Using Kotlin/Swift

Pattern-Based Problem Solving in Swift & Kotlin

Crack mobile coding interviews by mastering patterns instead of memorization. This book teaches you how to quickly recognize interview problems and solve them confidently using reusable Swift and Kotlin templates, exactly the way top iOS and Android candidates do. If you want to think clearly, code fast, and explain your solutions under pressure—this book is for you.

Minimum price

$29.99

$39.99

You pay

$39.99

Author earns

$31.99
$

...Or Buy With Credits!

You can get credits with a paid monthly or annual Reader Membership, or you can buy them here.
PDF
EPUB
WEB
About

About

About the Book


Mobile Coding Interviews: Pattern-Based Problem Solving in Swift & Kotlin is a practical, no-fluff guide to mastering coding interviews for iOS and Android developers. Instead of memorizing hundreds of problems, this book teaches you how to recognize recurring patterns and apply them confidently in Swift and Kotlin.

You’ll learn how interviews actually work, how to analyze time and space complexity quickly, and how to approach problems using a pattern-first mindset—the same approach used by top candidates at FAANG and mobile-focused companies. Each core pattern is broken down with clear recognition signals, reusable templates in both Swift and Kotlin, and carefully selected interview-favorite problems.

Covering everything from Two Pointers and Sliding Window to Graphs, Dynamic Programming, and Advanced Patterns, this book helps you build strong intuition, write clean code under pressure, and explain your thinking clearly during interviews. The final sections focus on practice strategy, pattern cheat sheets, and interview-day frameworksso you walk into interviews calm, structured, and prepared.

If you’re a mobile developer aiming to pass technical interviews by thinking in patterns—not panic—this book is your roadmap.

Author

About the Author

Mahmoud Ramadan

I am Mahmoud Ramadan. I am Android Tech Lead with 12 years of experience in Android Development.

I developed many apps like chatting, augmented reality, streaming, video calling and more. I am passionate about android programming and teaching. https://www.linkedin.com/in/mahmoud-ramadan-abdelwahed/

Contents

Table of Contents

Chapter 1: How to Use This Book

  1. Who This Book Is For
  2. How Coding Interviews Actually Work
  3. The Pattern-First Approach Explained
  4. Swift vs Kotlin: A Quick Syntax Comparison
  5. How to Practice Effectively
  6. Common Data Structures: Quick Reference
  7. Setting Up Your Practice Environment
  8. A Note on Problem Selection
  9. What’s Next

Chapter 2: Complexity Analysis Essentials

  1. Why Complexity Analysis Matters
  2. Big O Notation: The Basics
  3. Common Complexity Classes
  4. Complexity Comparison Table
  5. Space Complexity
  6. Analyzing Your Own Code
  7. Common Patterns and Their Complexities
  8. Talking About Complexity in Interviews
  9. Quick Reference Card
  10. Practice Problems
  11. What’s Next

Chapter 3: Two Pointers

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. The Two Main Variations
  4. Template: Opposite Direction
  5. Template: Same Direction
  6. Problem 1: Two Sum II — Input Array Is Sorted ★
  7. Problem 2: 3Sum ★
  8. Problem 3: Container With Most Water ★
  9. Problem 4: Trapping Rain Water ★
  10. Bonus Problem: Remove Duplicates from Sorted Array
  11. Chapter Summary
  12. What’s Next

Chapter 4: Fast & Slow Pointers

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. The Core Technique
  4. Linked List Node Definition
  5. Problem 1: Linked List Cycle ★
  6. Problem 2: Linked List Cycle II ★
  7. Problem 3: Happy Number ★
  8. Problem 4: Find the Duplicate Number ★
  9. Problem 5: Middle of the Linked List ★
  10. Bonus Problem: Palindrome Linked List
  11. Chapter Summary
  12. What’s Next

Chapter 5: Sliding Window

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. The Two Variations
  4. Template: Fixed-Size Window
  5. Template: Dynamic-Size Window
  6. Problem 1: Best Time to Buy and Sell Stock ★
  7. Problem 2: Longest Substring Without Repeating Characters ★
  8. Problem 3: Longest Repeating Character Replacement ★
  9. Problem 4: Minimum Window Substring ★
  10. Problem 5: Maximum Sum Subarray of Size K
  11. Problem 6: Permutation in String
  12. Chapter Summary
  13. What’s Next

Chapter 6: Merge Intervals

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Key Concepts
  4. Template: Merge Overlapping Intervals
  5. Problem 1: Merge Intervals ★
  6. Problem 2: Insert Interval ★
  7. Problem 3: Non-overlapping Intervals ★
  8. Problem 4: Meeting Rooms ★
  9. Problem 5: Meeting Rooms II ★
  10. Chapter Summary
  11. What’s Next

Chapter 7: Binary Search

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. The Classic Template
  4. Common Pitfalls
  5. Problem 1: Binary Search ★
  6. Problem 2: Search in Rotated Sorted Array ★
  7. Problem 3: Find Minimum in Rotated Sorted Array ★
  8. Problem 4: Search a 2D Matrix ★
  9. Problem 5: Koko Eating Bananas ★
  10. Problem 6: Median of Two Sorted Arrays ★
  11. Chapter Summary
  12. What’s Next

Chapter 8: Linked List Manipulation

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Node Definition Reminder
  4. Essential Technique: In-Place Reversal
  5. Essential Technique: Dummy Nodes
  6. Problem 1: Reverse Linked List ★
  7. Problem 2: Reverse Linked List II ★
  8. Problem 3: Merge Two Sorted Lists ★
  9. Problem 4: Merge K Sorted Lists ★
  10. Problem 5: Remove Nth Node From End ★
  11. Problem 6: Reorder List ★
  12. Chapter Summary
  13. What’s Next

Chapter 9: Stack & Monotonic Stack

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Stack Basics in Swift and Kotlin
  4. Problem 1: Valid Parentheses ★
  5. Problem 2: Min Stack ★
  6. Problem 3: Daily Temperatures ★
  7. Problem 4: Car Fleet ★
  8. Problem 5: Largest Rectangle in Histogram ★
  9. Monotonic Stack Summary
  10. Chapter Summary
  11. What’s Next

Chapter 10: Heap / Priority Queue (Top K Elements)

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Heap in Swift and Kotlin
  4. Problem 1: Kth Largest Element in an Array ★
  5. Problem 2: Top K Frequent Elements ★
  6. Problem 3: Find Median from Data Stream ★
  7. Problem 4: Task Scheduler ★
  8. Chapter Summary
  9. What’s Next

Chapter 11: Binary Tree Traversal

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Tree Node Definition
  4. The Four Traversals
  5. Problem 1: Invert Binary Tree ★
  6. Problem 2: Maximum Depth of Binary Tree ★
  7. Problem 3: Same Tree ★
  8. Problem 4: Subtree of Another Tree ★
  9. Problem 5: Binary Tree Level Order Traversal ★
  10. Problem 6: Diameter of Binary Tree ★
  11. Problem 7: Balanced Binary Tree ★
  12. Chapter Summary
  13. What’s Next

Chapter 12: Binary Search Tree (BST)

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. BST Properties to Remember
  4. Problem 1: Lowest Common Ancestor of BST ★
  5. Problem 2: Validate Binary Search Tree ★
  6. Problem 3: Kth Smallest Element in BST ★
  7. Problem 4: Convert Sorted Array to BST ★
  8. Problem 5: Insert into a BST ★
  9. Problem 6: Delete Node in BST ★
  10. Chapter Summary
  11. What’s Next

Chapter 13: Tries (Prefix Trees)

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Trie Node Structure
  4. Alternative: Array-based Children (for lowercase letters only)
  5. Problem 1: Implement Trie ★
  6. Problem 2: Design Add and Search Words ★
  7. Problem 3: Word Search II ★
  8. Problem 4: Longest Word in Dictionary
  9. Chapter Summary
  10. What’s Next

Chapter 14: Backtracking

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. The Backtracking Template
  4. Problem 1: Subsets ★
  5. Problem 2: Combination Sum ★
  6. Problem 3: Permutations ★
  7. Problem 4: Word Search ★
  8. Problem 5: N-Queens ★
  9. Chapter Summary

Chapter 15: Graph Traversal (BFS & DFS)

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Graph Representations
  4. DFS Template
  5. BFS Template
  6. Problem 1: Number of Islands ★
  7. Problem 2: Clone Graph ★
  8. Problem 3: Pacific Atlantic Water Flow ★
  9. Problem 4: Rotting Oranges ★
  10. Problem 5: Course Schedule ★
  11. Chapter Summary

Chapter 16: Advanced Graph Algorithms

  1. Part 1: Topological Sort
  2. Part 2: Union-Find (Disjoint Set Union)
  3. Chapter Summary

Chapter 17: Dynamic Programming - 1D

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. The 1D DP Template
  4. Problem 1: Climbing Stairs ★
  5. Problem 2: House Robber ★
  6. Problem 3: Coin Change ★
  7. Problem 4: Longest Increasing Subsequence ★
  8. Problem 5: Word Break ★
  9. Problem 6: Decode Ways ★
  10. Chapter Summary

Chapter 18: Dynamic Programming - 2D

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Problem 1: Unique Paths ★
  4. Problem 2: Longest Common Subsequence ★
  5. Problem 3: Edit Distance ★
  6. Problem 4: 0/1 Knapsack Pattern
  7. Problem 5: Target Sum ★
  8. Problem 6: Longest Palindromic Substring ★
  9. Chapter Summary

Chapter 19: Bit Manipulation

  1. The Pattern Explained
  2. Pattern Recognition Signals
  3. Essential Bit Tricks
  4. Problem 1: Single Number ★
  5. Problem 2: Number of 1 Bits ★
  6. Problem 3: Counting Bits ★
  7. Problem 4: Reverse Bits ★
  8. Problem 5: Missing Number ★
  9. Problem 6: Sum of Two Integers ★
  10. Bitmask for Subsets
  11. Chapter Summary

Chapter 20: Math & Geometry

  1. Common Mathematical Patterns
  2. Problem 1: Rotate Image ★
  3. Problem 2: Spiral Matrix ★
  4. Problem 3: Set Matrix Zeroes ★
  5. Problem 4: Happy Number ★
  6. Problem 5: Plus One ★
  7. Problem 6: Pow(x, n) ★
  8. Problem 7: Detect Squares ★
  9. Chapter Summary

Chapter 21: Problem-Solving Strategies

  1. The 4-Step Framework
  2. Pattern Recognition Guide
  3. Common Mistakes to Avoid
  4. Time Management
  5. Communication Templates
  6. Chapter Summary

Chapter 22: Pattern Quick Reference

  1. Two Pointers
  2. Fast & Slow Pointers
  3. Sliding Window
  4. Binary Search
  5. Merge Intervals
  6. Linked List Techniques
  7. Stack / Monotonic Stack
  8. Heap / Priority Queue
  9. Tree Traversal
  10. Graph Traversal
  11. Topological Sort
  12. Union-Find
  13. Backtracking
  14. Dynamic Programming - 1D
  15. Dynamic Programming - 2D
  16. Bit Manipulation
  17. Complexity Quick Reference

Chapter 24: Final Review & Next Steps

  1. The Complete Pattern Map
  2. The 88 Problems Checklist
  3. Study Plans
  4. Interview Day Tips
  5. Beyond the Interview
  6. Final Words
  7. Quick Reference Card
  8. About This Book

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub