What is a data structure?

Why Interviewers Ask This

Foundational questions like this help interviewers calibrate the rest of the interview. A confident, accurate answer signals that you have solid Data Structures & Algorithms basics — a prerequisite for any developer role.

Answer

A data structure is a way of organizing, storing, and managing data in a computer so that it can be accessed and modified efficiently. Different data structures are suited to different kinds of tasks — the choice of data structure directly affects the performance of algorithms that use it. Categories: Linear data structures: elements are arranged sequentially — Array, Linked List, Stack, Queue; Non-linear data structures: elements are not sequential — Trees, Graphs; Hash-based: Hash Table / Hash Map; Heap-based: Priority Queue / Heap. Primitive vs abstract: Primitive data structures (int, float, char) are provided by programming languages. Abstract Data Types (ADTs) define the operations (interface) without specifying implementation — Stack (push, pop, peek), Queue (enqueue, dequeue), List (insert, delete, find). Choosing the right data structure is one of the most impactful decisions in software engineering — a hash map gives O(1) lookup vs O(n) for an array, which can be the difference between a program running in milliseconds or minutes on large data.

Common Mistake

Don't just define the term — demonstrate that you understand when to use it and when not to. Showing awareness of trade-offs is what separates average from strong Data Structures & Algorithms candidates.