Interview Q&A · questions with model answers

Data Structures Interview Questions

Part of the study plan for: Machine Learning Engineer

Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.

  1. In Python DSA interviews, explain: list vs deque for queue.

    list.pop(0) is O(n); collections.deque popleft is O(1).

  2. Big-Ω vs Big-Θ?

    Ω lower bound; Θ tight bound when upper and lower match.

  3. Time vs space tradeoff?

    Use extra memory (tables, caches) to reduce runtime.

  4. Stable vs unstable sort?

    Stable keeps equal keys' relative order; matters for multi-key sorts.

  5. In Python DSA interviews, explain: array vs list.

    array module stores typed compact values; list stores pointers to objects.

  6. What is the difference between a list and a tuple in Python?

    Lists are mutable (can be modified after creation) while tuples are immutable.

Was this page helpful?

Report a mistake