Elixir & Erlang/OTP Module 1
Start here: the BEAM, Elixir and Erlang/OTP interview questions
Interview questions on “Start here: the BEAM, Elixir and Erlang/OTP”: warm-ups, then what each harder question tests and how a good answer starts.
Warm-up questions
Short questions with short answers, each answered in full.
-
Fresher
What is the difference between Erlang, OTP and the BEAM?
Answered in the lesson The BEAM, Elixir and Erlang/OTP explained
-
Fresher
What is the difference between an .ex file and an .exs file in Elixir?
Answered in the lesson Install Elixir and Erlang; use IEx, mix and erl
-
Fresher
What does the -otp-29 in the version elixir@1.20.4-otp-29 mean?
Answered in the lesson Install Elixir and Erlang; use IEx, mix and erl
Questions with model answers
What each question tests, the first step of a good answer and the follow-ups to expect.
-
Fresher to mid
A service on one BEAM node must hold 200,000 open WebSocket connections, with one process per connection. Is that a reasonable design, and what would you measure before you commit to it?
- What it tests
- Knowing what a BEAM process costs and which limits apply, and turning them into a capacity check made of measurements rather than guesses.
- First step
- Start from the lesson's numbers: an idle process took 2,624 bytes and the default limit is 1,048,576 processes, so 200,000 idle processes need about 525 MB and fit easily. A real connection process holds more than an idle one, so measure one under realistic traffic before you multiply.
- Follow-ups
-
- Each connection process keeps about 20 KB of state. What changes in your estimate?
- The node must also survive a burst to 600,000 connections. What do you check and set first?
- How would you notice a connection process whose mailbox keeps growing?
From the lesson The BEAM, Elixir and Erlang/OTP explained
Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.Opening the model answers with your pass…
Model answers open with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; nothing renews unless you choose to. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so the model answers can’t be opened at the moment. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Mid to senior
Your team runs Elixir 1.16 on Erlang/OTP 26 and wants to reach Elixir 1.20. Plan the upgrade: in what order do you move Elixir and OTP, and why can it not be done in one step?
- What it tests
- Reading the compatibility table of Elixir and Erlang/OTP and the support policy, and planning a path on which every step runs on a supported pair.
- First step
- Write down the OTP range of each Elixir line: 1.16 runs on OTP 24 to 26 and 1.20 on 27 to 29, so no OTP version runs both. Then look for Elixir lines whose ranges overlap each side, and plan every step as a pair you can test.
- Follow-ups
-
- Why not move OTP to 29 first and Elixir afterwards?
- Which fixes does each pair on the way still get?
- After the deploy, how do you prove that the servers run the pair you planned?
From the lesson The BEAM, Elixir and Erlang/OTP explained
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Fresher to mid
A new CI job installs Elixir 1.20.4 and stops with "exec: erl: not found", although the team's laptops work. What is wrong, and how do you make the job's tools match the laptops exactly?
- What it tests
- Knowing that Elixir runs on an Erlang/OTP that must be on PATH, reading what the error says, and pinning both tools as one pair in one place.
- First step
- Read the error first: the elixir command is a shell script that ends by starting erl, and the shell found no erl on PATH. So the job installed Elixir without Erlang, or without putting Erlang's bin folder on PATH. Then check which pair the laptops run, with elixir --version, and pin exactly that pair.
- Follow-ups
-
- The job passes now, but elixir --version shows Erlang/OTP 28 and "compiled with Erlang/OTP 29". Does it matter?
- How do you pin both tools for every developer and the CI job in one place?
- A teammate on Windows uses the installers. How do they get the same pair?
From the lesson Install Elixir and Erlang; use IEx, mix and erl
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Fresher to mid
Code that works when you paste it into IEx line by line fails as a script with "cannot access struct Point, the struct was not yet defined". Explain why, and give two ways to fix it.
- What it tests
- Understanding how a script's top-level code is compiled, which uses of a module need it compiled first, and when a script should become a Mix project.
- First step
- Look at where the struct is used: by top-level code of the same script that defines Point. That code is compiled in the same context that defines Point, before the module exists, while IEx compiles and runs each input on its own, so Point already exists when the next line is compiled.
- Follow-ups
-
- Why does a call such as Point.new() at the top level work while %Point{} does not?
- Which other uses of a module fail the same way?
- When should this script become a Mix project?
From the lesson Install Elixir and Erlang; use IEx, mix and erl
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
All Elixir & Erlang/OTP interview questions · The Elixir & Erlang/OTP track