Erlang / Erlang Advanced Interview questions
Explain the execution flow of application:start/1 and its dependency resolution?
Calling application:start(my_app) doesn't just run one function — it triggers a
dependency-aware startup sequence managed by the application controller.
flowchart TD
A[application:start my_app] --> B{Dependencies in .app already running?}
B -->|No| C[Start each missing dependency first, recursively]
C --> B
B -->|Yes| D[Call my_app:start/2 - the mod callback]
D --> E[Top-level supervisor starts via start_link]
E --> F[Supervisor starts its children per its init/1 spec]
The application controller reads the applications list from the .app file and
recursively ensures each dependency is already running, starting any that aren't, before calling the target
application's own start callback. That callback (matching the mod entry) is expected to start and
return the PID of a top-level supervisor, which then boots its own children exactly as any supervision tree
does. If a required dependency can't be started, the whole start call fails rather than leaving the application
half-initialized.
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...
