InterviewStack.io LogoInterviewStack.io

Algorithms and Data Structures Questions

Comprehensive understanding of core data structures such as arrays, linked lists, stacks, queues, hash tables, trees, heaps, and graphs, and fundamental algorithms including sorting, searching, traversal, string manipulation, and graph algorithms. Ability to analyze and compare time and space complexity using asymptotic notation such as Big O, Big Theta, and Big Omega, and to reason about trade offs between different approaches. Skills include selecting the most appropriate data structure for a problem, designing efficient algorithms, applying algorithmic paradigms such as divide and conquer, dynamic programming, greedy methods, and graph search, and implementing correct and robust code for common interview problems. At more senior levels, this also covers optimizing for large scale through considerations of memory layout, caching, amortized analysis, parallelism and concurrency where applicable, and profiling and tuning for performance in realistic systems.

HardTechnical
83 practiced
An Android app shows frequent GC pauses during fast scrolling. Profiling points to allocation churn in image handling and view binding: many short-lived temporary objects created per frame. As a senior engineer, outline a step-by-step approach to identify root causes (profiling tools, hotspots) and propose algorithmic and data-structure-level fixes (object pooling, view holder reuse, primitive arrays, bitmap pooling, avoiding boxed primitives). Explain risks and how you'd validate improvements.
EasyTechnical
95 practiced
Write a Kotlin function that reverses a singly-linked list in-place. Use the following node definition:
class ListNode(var value: Int, var next: ListNode?)
Implement:- fun reverse(head: ListNode?): ListNode?
Constraints: O(n) time, O(1) extra space. Handle empty and single-node lists. Briefly explain how this in-place operation affects memory and GC behavior on Android.
EasyTechnical
128 practiced
Explain how immutable strings in Java/Kotlin and Swift affect memory allocation, duplication, and performance on mobile devices. Give examples where naive string concatenation in tight loops or JSON construction causes allocation churn and GC/ARC pressure. Describe platform-specific mitigation techniques (StringBuilder/StringBuffer in JVM, String interpolation patterns in Kotlin, NSMutableString or Data/ByteBuffer strategies in Swift) and how you'd profile and fix excessive string allocations on Android and iOS.
EasyTechnical
95 practiced
For common mobile collection types, state average and worst-case time complexity for these operations: random access, insertion at head/tail, deletion, and search. Cover at least: dynamic array (ArrayList), singly/doubly linked list, hash table (HashMap/Dictionary), and balanced tree (TreeMap). Also discuss memory overhead per element and how that impacts low-memory devices.
MediumSystem Design
78 practiced
Design a local SQLite/Room schema for a social feed that must support: fast retrieval of newest posts for infinite scroll, efficient insertion of new posts, and filtering by author or tag. Specify tables, necessary indices (including composite indices), and discuss normalization vs denormalization trade-offs for read-heavy mobile scenarios and migration considerations.

Unlock Full Question Bank

Get access to hundreds of Algorithms and Data Structures interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.

30+ Algorithms and Data Structures Interview Questions & Answers (2026) | InterviewStack.io