Erlang OTP Developer Hiring Guide

Hiring Guide for Erlang OTP Engineers

Ask the right questions to secure the right Erlang OTP talent among an increasingly shrinking pool of talent.

Erlang OTP (Open Telecom Platform) is a programming language developed by Ericsson in the late 1980s to address the needs of telecommunication systems. It is a concurrent, functional language designed for building scalable, fault-tolerant applications. The language's key features include hot swapping, where code can be changed without stopping the system, and its ability to handle large numbers of lightweight processes. Erlang OTP has been used in various sectors beyond telecoms, such as banking, e-commerce and computer telephony. Its robustness and efficiency have made it a popular choice for high-availability systems (source: "Erlang Programming" by Francesco Cesarini and Simon Thompson).

First 20 minutes

General Erlang OTP knowledge and experience

The next 20 minutes of the interview should attempt to focus more specifically on the development questions used, and the level of depth and skill the engineer possesses.

How would you handle state in a gen_server?

State in a gen_server is handled using its callback functions. The state is passed as an argument to the callback functions and can be updated and returned from these functions to maintain state across different function calls.

Describe the difference between gen_server and gen_event behavior.

gen_server is a behavior module for implementing the server of a client-server relation. gen_event is a behavior module for implementing event handling functionality. The main difference is that gen_server is used for handling requests and sending responses, while gen_event is used for handling events.

What are some of the design principles of OTP?

Some of the design principles of OTP include behaviors, which are formalized design patterns; supervision trees, which provide fault-tolerance; and applications, which are a packaging mechanism that allows developers to bundle related components together.

How would you explain the concept of supervision trees in Erlang OTP?

Supervision trees are a fault-tolerance mechanism in Erlang OTP. They are a hierarchical arrangement of processes where parent processes, known as supervisors, monitor the behavior of their child processes and take appropriate action if they fail.

What are the main components of OTP?

The main components of OTP are the Erlang runtime system, a number of ready-to-use components mainly written in Erlang, and a set of design principles for Erlang programs.

The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

What youre looking for early-on

Is the candidate comfortable with functional programming concepts?

Erlang is a functional programming language. A good understanding of functional programming concepts is necessary to write effective Erlang code.

Has the candidate shown the ability to write clean, efficient Erlang code?

Writing clean, efficient code is important for maintainability, readability, and performance. This shows the candidate's attention to detail and commitment to high quality work.

How well does the candidate understand distributed systems?

Erlang is often used in distributed systems, where tasks are divided among multiple computers. Understanding distributed systems indicates the candidate's ability to work on large-scale, complex projects.

Can the candidate effectively debug Erlang code?

Debugging is a critical skill for any developer. The ability to identify and fix issues in Erlang code is necessary for maintaining code quality and efficiency.

Has the candidate worked on any projects involving concurrent programming?

Erlang is known for its designs around concurrent programming. Experience in this area shows that the candidate can effectively handle tasks that require multiple computations to happen simultaneously.

Does the candidate demonstrate a solid understanding of Erlang OTP?

This is crucial as Erlang OTP (Open Telecom Platform) is a set of Erlang libraries, which consists of the Erlang runtime system, a number of ready-to-use components mainly written in Erlang, and a set of design principles for Erlang programs. A deep understanding of this shows the candidate's expertise and ability to handle complex tasks.

Next 20 minutes

Specific Erlang OTP development questions

The next 20 minutes of the interview should attempt to focus more specifically on the development questions used, and the level of depth and skill the engineer possesses.

Describe the difference between synchronous and asynchronous communication in Erlang OTP.

Synchronous communication in Erlang OTP is when a process sends a message to another process and waits for a reply before continuing. Asynchronous communication is when a process sends a message to another process and continues without waiting for a reply.

What is the purpose of the handle_call function in a gen_server?

The handle_call function is used to handle synchronous requests to the gen_server. It takes three arguments: the request, the client's process ID, and the server's current state. It returns a tuple that includes the reply to the client and the updated state.

How would you handle errors in a supervision tree?

Errors in a supervision tree are handled by the supervisor process. When a child process fails, the supervisor can choose to restart the child process, restart all child processes, or terminate all child processes and itself.

What are the different types of process links in Erlang OTP?

There are two types of process links in Erlang OTP: one-to-one links and one-to-many links. One-to-one links are created with the link function, while one-to-many links are created with the group_leader function.

What is the role of the init function in a gen_server?

The init function is called when the gen_server is started. It initializes the server's state and can also set options for the server.

The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

The ideal back-end app developer

What you’re looking to see on the Erlang OTP engineer at this point.

A skilled Erlang OTP engineer should demonstrate strong knowledge of Erlang language, proficiency in OTP frameworks and understanding of concurrent programming. They should be able to design, build and maintain scalable systems. Red flags would include lack of practical experience or inability to solve complex problems.

Digging deeper

Code questions

These will help you see the candidate's real-world development capabilities with Erlang OTP.

What does this simple Erlang function do?

add(X, Y) -> X + Y.

This function adds two numbers. It takes two parameters X and Y, and returns their sum.

What does this Erlang syntax do?

{ok, {Year, Month, Day}} = erlang:localtime().

This syntax is used for pattern matching. It matches the result of the erlang:localtime() function, which returns the current local time, with the tuple {ok, {Year, Month, Day}}. If they match, it binds the variables Year, Month, and Day to the respective values.

What does this Erlang list comprehension do?

[X || X <- [1,2,3,4,5,6,7,8,9,10], X rem 2 == 0].

This list comprehension generates a new list that contains only the even numbers from the original list [1,2,3,4,5,6,7,8,9,10]. The 'rem' operator is used to get the remainder of the division of X by 2. If the remainder is 0, it means the number is even.

What does this Erlang concurrency code do?

spawn(fun() -> io:format('Hello from another process~n') end).

This code spawns a new Erlang process that executes the function provided. The function prints 'Hello from another process' to the standard output. The spawn function is used for creating concurrent processes in Erlang.

What does this Erlang record definition do?

-record(person, {name, age}).

This code defines a record named 'person' with two fields: 'name' and 'age'. Records in Erlang provide a way to bundle several named data items together. They are similar to 'struct' in C or objects in OOP languages.

What does this advanced Erlang code do?

-module(test).
-export([start/0]).
start() ->
  Pid = spawn(fun loop/0),
  Pid ! {self(), hello},
  receive
    {Pid, Msg} ->
      io:format('Received ~p~n', [Msg])
  end.
loop() ->
  receive
    {From, Msg} ->
      From ! {self(), Msg},
      loop()
  end.

This code defines a module named 'test' that exports a function 'start/0'. The 'start' function spawns a new process running a 'loop' function and sends a message 'hello' to it. The 'loop' function waits for a message, sends it back, and then calls itself recursively. When the 'start' function receives the message back from the 'loop' process, it prints 'Received hello'.

Wrap-up questions

Final candidate for Erlang OTP role questions

The final few interview questions for a Erlang OTP candidate should typically focus on a combination of technical skills, personal goals, growth potential, team dynamics, and company culture.

How would you design a distributed system using Erlang OTP?

Designing a distributed system using Erlang OTP involves using its built-in support for distributed programming. This includes using distributed Erlang nodes, global process names, and distributed applications. The design should also take into account fault-tolerance, scalability, and consistency requirements.

What are some of the ways to improve the performance of an Erlang OTP application?

Some ways to improve the performance of an Erlang OTP application include optimizing the code, using native compiled code, adjusting the scheduler settings, and using more efficient data structures.

How would you handle a situation where a process in a supervision tree is frequently crashing?

If a process in a supervision tree is frequently crashing, it may be necessary to adjust the supervisor's restart strategy or the maximum restart intensity. If the problem persists, it may be necessary to investigate the cause of the crashes and fix the underlying issue.

What is the role of the handle_info function in a gen_server?

The handle_info function is used to handle all messages sent to the gen_server that are not requests or responses. It takes two arguments: the message and the server's current state. It returns a tuple that includes the updated state.

How would you implement a finite state machine in Erlang OTP?

A finite state machine can be implemented in Erlang OTP using the gen_statem behavior. This involves defining the states and transitions of the machine in the callback functions of a gen_statem module.

The hiring guide has been successfully sent to your email address.
Oops! Something went wrong while submitting the form.

Erlang OTP application related

Product Perfect's Erlang OTP development capabilities

Beyond hiring for your Erlang OTP engineering team, you may be in the market for additional help. Product Perfect provides seasoned expertise in Erlang OTP projects, and can engage in multiple capacities.