Top Interview Questions and Answers for a Junior Elixir Developer

man-wearing-white-top-in-front-of-woman-wearing-blue-long-1181715
Photo by Christina Morillo from Pexels

Elixir – an introduction

A dynamic and functional language to be used for creating applications that can be scaled, Elixir is based on the virtual machine language Erlang, itself written by Ericsson in 1986 in response to concurrency and fault tolerance, is used for operating low latency and fault-tolerant systems. Elixir provides extensible design and useful tooling and both polymorphism and meta-programming support it.

Interview Questions And Answers best suited to Elixir

1. What is Elixir? Explain

Elixir is a dynamic and functional language to be used for creating applications that can be scaled. Elixir comes on top of Erlang language VM, itself used for operating low latency and fault-tolerant systems. Elixir provides extensible design and useful tooling and polymorphism and meta-programming support it.

2. What are the advantages of Elixir?

  • Extensible and Scalable
  • Fault-Tolerant
  • Rapid and interactive development
  • Considerable metaprogramming
  • Easy to understand syntax

3. Which is the latest version of Elixir

Version 1.7.3 – released in August 2018.

4. What are the data types that Erlang offers?

There are two data types offered by Erlang:

Constant: As this data type is made up of Numbers and Atoms, it cannot be broken down into primitive.

Compound:  Made up principally of tuples and lists, you can put together other data types using this one.

5. Define OTP –  Open Telecom Platform

OTP constitutes a vast set of Erlang language libraries and can be used for a wide variety of tasks, be it providing a server or for the assembly of ASN.1. It is an open-source platform.

6. How does Erlang manage the run time error?

You can use the Catch or Try function to stop the process terminating due to run-time errors. Unless an exception occurs in the evaluation phase, Catch Expr will throw the expression value. Try Exprs is simply a catch enhancement and is also capable of both identifying and managing the exception class chosen.

7. Explain the modules and how one is stored.

Using Erlang means that code can be assembled in modules which are made up of functions. A local scope of functions is introduced by the module, both Private and Public. An “erl” file stores the module. You need to ensure that the name of the module and the file basename are identical.

8. Explain the process creation in Erlang?

Calling spawn is required to create a process – the spawn both creates the process and is in charge of returning the pid. This is how you do it:

Spawn (Module, Name, Args ) -> pid ()

9. Explain guard sequence?

Guards are used to safeguard the function clauses provided the guard holds the clause. A comma (,) and semicolon (;) both act to separate the guard sequence. One guard needs to be true at least for the guard sequence to be true.

10. Give examples of valid guard expressions?

A few valid guard expressions include Short-circuit Expressions, Boolean Expressions, Arithmetic Expressions, Term Comparisons, Calls to the BIF’s specified, Other constants, and Atom True.