Erlang / Erlang Basics Interview questions
Explain the lifecycle of a supervised process?
A supervised worker follows a well-defined path from start to eventual restart or shutdown, orchestrated entirely by its supervisor.
stateDiagram-v2
[*] --> Starting: supervisor calls start_link
Starting --> Running: init/1 returns {ok, State}
Running --> Crashed: unhandled error / exit
Running --> Terminating: normal shutdown requested
Crashed --> Starting: supervisor restarts per strategy
Crashed --> GivingUp: restart intensity exceeded
Terminating --> [*]
GivingUp --> [*]: supervisor itself terminates/escalates
On start_link, the supervisor blocks until init/1 replies (so a failed startup is
caught immediately, not silently). Once running, the process handles calls/casts/info messages until it either
shuts down normally, or crashes. A crash triggers the configured restart strategy
(one_for_one/one_for_all/rest_for_one); if crashes happen faster than the
configured intensity/period allows, the supervisor gives up and escalates the failure to its own parent instead
of looping forever.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
