Phoenix Interview Questions
Check out 30 of the most common Phoenix interview questions and take an AI-powered practice interview
What is Phoenix and how does it differ from Rails or Django?
What does a Phoenix 1.7 route look like with verified routes (`~p`)?
What is a 'context' in Phoenix and why does it exist?
What is Ecto and how do schema, changeset, and Repo fit together?
What is a Plug and how does it work?
How do you query data with Ecto?
What is a controller in Phoenix and how does it return responses?
What is HEEx and how does it differ from EEx?
How do you handle params and validate them in a controller?
What is `mix` and how do you start the Phoenix dev server?
What is `assigns` and `@conn` in a Phoenix template?
How do you write Ecto migrations and what is `Ecto.Migration`?
What are Phoenix Channels and how do they work?
How do you authenticate WebSocket / Channel connections?
What is Phoenix.PubSub and when do you use it directly?
What is LiveView and what is its lifecycle?
How do you avoid N+1 queries in Ecto?
What is Ecto.Multi and when should you reach for it?
How do you handle file uploads in LiveView?
What are LiveView Hooks and when do you need them?
What is Phoenix Presence and how does it work?
How do you test a LiveView?
What is `mix phx.gen.auth` and what does it scaffold?
How do you broadcast a message from a controller to all LiveViews?
What's the difference between `push_patch`, `push_navigate`, and JS commands in LiveView?
What's new in Phoenix 1.8 and how is scope-based auth different?
How do you cluster Phoenix nodes and what are the gotchas?
How would you architect a Phoenix system for 100k+ concurrent WebSocket connections?
What are the most common LiveView performance pitfalls in production?
How do you deploy a Phoenix app to Fly.io or Gigalixir, and what changes for a clustered setup?
Frequently Asked Questions
Should I learn Elixir before Phoenix?
Yes, but only the basics — pattern matching, pipes (`|>`), the `case`/`with` flow control, and how modules/functions work. Two days of `Exercism` Elixir track is enough to start a Phoenix tutorial. OTP concepts (GenServers, supervisors) you can pick up as you encounter them; you don't need them for typical CRUD work, but they're indispensable once you write Channels, LiveView, or background jobs.
How much does a Phoenix / Elixir developer earn in India?
₹10-28 LPA in 2026, skewing higher than equivalent Python or Node.js roles because the talent pool is smaller. Companies hiring in India: Glific (nonprofit messaging), parts of Razorpay's realtime ops, ShareChat (some services), and a long tail of remote-friendly companies (Discord, Brex, Pinterest, Lemonade) that hire from India. Specialised areas (high-concurrency systems, fintech, edtech with real-time features) pay at the upper end.
Is LiveView ready for production in 2026?
Yes — LiveView has been production-grade since around the 0.18 release (2022) and 1.0 shipped in 2024. Major deployments at Brex, Cars.commerce, Heroku Dashboard, and the Fly.io dashboard itself all run on LiveView. It's the right default for internal admin tools, dashboards, and CRUD apps; for marketing pages and content-heavy sites where SEO and CDN cache are critical, you can still pre-render to static HTML via `Phoenix.HTML` and skip LiveView entirely.
How does Phoenix compare to Node.js for real-time apps?
Phoenix wins on connection scale (BEAM scheduler vs Node's single event loop), fault tolerance (supervisors restart crashed processes; a Node process crashing usually means everything dies), and observability (`:observer.start()`, `:recon`, distributed tracing built in). Node wins on ecosystem size and how fast you can spin up the first version. For chat, notifications, multiplayer, or any system where 'how many concurrent connections' is the dominant question, Phoenix is the technically superior choice — that's why Discord uses it.
Do I need to know OTP to be productive in Phoenix?
For basic CRUD and LiveView, no — you can ship a usable app understanding only the controller / context / changeset / Repo flow. For Channels, background jobs (Oban), or anything that holds long-running state, yes — at least GenServer and supervisor basics. The good news: OTP concepts are small in number (maybe 5 building blocks) and the official Elixir docs explain them well. Most Elixir developers in India learn OTP on the job once they hit a real concurrency problem.
What's the difference between Phoenix Channels and LiveView?
Channels are a low-level pub/sub protocol over WebSockets — you control the wire format, you write the JS client, you build the UI yourself. Use Channels when you have a separate frontend (React, mobile app) that needs server push. LiveView is a higher-level abstraction built on top of Channels: it manages the WebSocket, the wire format, and the UI for you, and you write only Elixir. Use LiveView when you want a reactive web UI without a separate frontend codebase. Many production apps use both — LiveView for the dashboard, Channels for the mobile app talking to the same backend.
Introduction
Phoenix is the dominant web framework in the Elixir ecosystem and the reason a lot of teams pick the BEAM in the first place. Built on top of OTP (Open Telecom Platform), it inherits decades of telecom-grade primitives — supervisors, lightweight processes, fault tolerance, distribution — and packages them for the web. Discord routes billions of messages per day through Phoenix Channels, Pinterest uses it for real-time notification fan-out, and in India, Glific (a WhatsApp messaging platform for nonprofits) and parts of Razorpay's realtime ops stack lean on the same patterns.
Phoenix 1.7 (2023) and 1.8 (2024) reshaped the framework around verified routes (`~p`), function components, and 'coreless' scope-based auth. LiveView — which started as an experiment in 2019 — is now production-grade and frequently the main reason teams adopt Phoenix at all: server-rendered reactive UIs without writing a SPA.
If you are interviewing for a Phoenix role in India in 2026, expect questions on Ecto (the database wrapper), Channels and PubSub (WebSocket abstraction), LiveView lifecycle, OTP concepts (GenServers, supervisors), and production concerns like clustering and connection limits. This guide covers the 30 most-asked Phoenix questions, grouped by difficulty, with code where it pays off.