Ruby provides several built-in data structures for organizing information in programs. A Symbol is a lightweight, immutable identifier written with a leading colon, such as :status or :id. Because each symbol is stored in memory only once, symbols are more efficient than strings when used as keys or repeated identifiers, and they are commonly seen as hash keys or method names passed around a program.
An Array is an ordered, indexed collection of objects. Arrays can be created with square brackets, such as nums = [1, 2, 3], or with the percent-w shortcut for word arrays, like words = %w[hello world]. The Array.new constructor accepts a size and a default value, so Array.new(5, 0) produces an array of five zeros. Arrays preserve insertion order and can hold mixed object types.
A Hash stores data as key-value pairs and is created with curly braces or Hash.new. The shorthand h = { name: "Alice", age: 30 } uses symbols as keys; the colon before each key turns it into :name and :age behind the scenes. Hash.new(0) sets a default value of zero for missing keys, and values are accessed with square brackets, for instance h[:name]. A Range represents an interval of values using either two dots for an inclusive range like (1..5) or three dots for an exclusive range like (1...5). Ranges work with numbers, strings, and any object that implements the spaceship operator.