Skip to main content

Basics for Elixirs

Elixir basics are the core of the language: immutable data types such as atoms, tuples, lists and maps, pattern matching with the = operator, and functions organised into modules. Pattern matching in function heads replaces most if statements and drives how Elixir code is structured.

Stage: Language · Part of the Elixir roadmap · Last reviewed 19 November 2026

What to learn in Basics

Basics interview questions

What does the = operator do in Elixir?

It is the match operator, not plain assignment. The left side is a pattern that must fit the right-hand value, binding variables where it can. So {:ok, value} = {:ok, 42} binds value to 42, while a mismatched shape raises a MatchError.

Why are lists in Elixir poor for random access?

Lists are linked lists, so reaching the nth element means walking n cells. Prepending is cheap and constant time, which is why recursion over head and tail is idiomatic. For indexed or key-based access, maps or tuples are the better choice.

Where Basics fits in the Elixir roadmap

Basics belongs to the Language stage (beginner level). Functional basics.

Back to the full Elixir roadmap