Skip to content

Cloud · updated 26 November 2026

Elixir runs on the BEAM and is known for fault-tolerant, concurrent systems. These scenarios test processes and supervision.

Top 10 Elixir scenario questions

Try each one yourself first, then open the model answer.

1. A worker process crashes occasionally. Should you wrap everything in try/rescue?

Show answer

Usually not. Put it under a supervisor with a suitable restart strategy and let it restart in a clean state, handling expected errors with tagged tuples.

2. A single GenServer becomes a bottleneck. What would you do?

Show answer

Move slow work out of the server process, partition across several processes, or use ETS for frequently read data.

3. A process mailbox grows without limit. Why is that a problem and what helps?

Show answer

Memory grows and latency rises. Apply back-pressure, for example with calls instead of casts, or GenStage or Broadway pipelines.

4. A GenServer.call times out under load. What do you check?

Show answer

Whether the callback does slow work, calls itself or waits on another busy process. Reply later or use a task for slow work.

5. Which supervision strategy suits processes that depend on each other?

Show answer

rest_for_one or one_for_all, depending on which processes must restart together. one_for_one suits independent workers.

6. You need to run many independent requests concurrently with a limit. How?

Show answer

Task.async_stream with max_concurrency and a timeout.

7. Creating atoms from user input is risky. Why?

Show answer

Atoms are not garbage collected and the table has a limit. Keep input as strings or use String.to_existing_atom.

8. Code has deeply nested case statements for successive steps. How can it be cleaner?

Show answer

Use a with expression and return consistent ok and error tuples.

9. State is lost when a process restarts. How do you handle important data?

Show answer

Persist it in a database or another durable store and load it on start. Process memory is not durable.

10. How would you find why a production node is using too much memory?

Show answer

Inspect processes with observer or recon, check mailbox sizes and ETS tables, and look for large binaries being retained.

Ready to build something great?

Book your free 30-minute consultation today. No obligation, just honest advice.