Data Structures: Arrays, Lists, Stacks, Queues, Hash Maps

Interview-ready DS basics — operations, complexities, and when to pick each structure.

12 cards· by GuruOwl

Make a deck like this from your own PDF — free.

Try it
  1. 01
    Array access by index time complexity?
    O(1) random access (contiguous memory).
    arrays
  2. 02
    Array insert/delete in the middle complexity (typical dynamic array)?
    O(n) — elements must shift.
    arrays
  3. 03
    Singly linked list: access k-th element complexity?
    O(n) — must traverse from the head.
    lists
  4. 04
    Linked list insert/delete at known node (with pointer) complexity?
    O(1) pointer updates (singly list delete needs predecessor).
    lists
  5. 05
    Stack operations and complexity?
    Push/pop/peek amortized O(1); LIFO order.
    stack
  6. 06
    Queue operations and complexity?
    Enqueue/dequeue O(1) with proper ends; FIFO order.
    queue
  7. 07
    Hash map average lookup/insert/delete?
    Average O(1); worst O(n) with collisions/degeneracy.
    hashmap
  8. 08
    What is a good hash function property?
    Uniform distribution of keys into buckets to minimize collisions.
    hashmap
  9. 09
    Collision resolution: chaining vs open addressing?
    Chaining: linked lists per bucket. Open addressing: probe for next empty slot.
    hashmap
  10. 10
    When prefer a hash map over an array?
    When keys are sparse/non-integer or you need fast key-based lookup without sorting.
    choice
  11. 11
    Deque supports what?
    Insert/delete at both front and back efficiently (double-ended queue).
    queue
  12. 12
    Amortized O(1) append in dynamic arrays — how?
    Grow capacity geometrically (e.g., ×2) so resizes are rare; average cost per append is O(1).
    arrays