Erlang Interview Questions & Answers

  1. Question 1. What Is Erlang?

    Answer :

    Erlang is a general purpose programming language and a runtime environment. It has built in support for concurrency, fault tolerance and distribution. Erlang is available as an open source.

  2. Question 2. Explain What Is Otp (open Telecom Platform)?

    Answer :

    OTP is an open source platform, and it is a large set of libraries for Erlang to do all from compiling ASN.1 to providing a WWW server.

  3. Python Interview Questions

  4. Question 3. What Are The Key Features Of Erlang?

    Answer :

    Key features for Erlang is that it has:

    • Declarative Syntax: It has got declarative syntax
    • Concurrent: It has process based model of concurrency
    • Real time: It programs real time system
    • Continuous Operation: It allows continuous operation
    • Robust: For detecting runtime errors it has three constructs in the language
    • Memory Management: Memory is allocated automatically and de-allocated when not required
    • Distribution: It has got no shared memory, distributed systems can be easily be built in erlang
    • Integration: Easy integration of program written in other language
  5. Question 4. Name The Datatypes That Erlang Provides?

    Answer :

    Erlang provides two datatypes:

    1. Constant data types: These types of data types cannot be split into more primitive subtypes. It consists of Numbers and Atoms.
    2. Compound data types: These types of data types are used to group together other types of data types. It consists of tuples and lists.
  6. Python Tutorial

  7. Question 5. What Is The Command To Disconnect Node In Erlang?

    Answer :

    By calling erlang: disconnect_node (Node) will force disconnection of the node.

  8. Data Structures Interview Questions

  9. Question 6. Explain What Is Modules In Erlang?

    Answer :

    Erlang enables to organize code into modules. A module consists of functions; it introduces a local scope of functions (Public and Private).

  10. Question 7. Mention How Module Is Stored In Erlang?

    Answer :

    A module name is stored in a file named .erl. File basename and module name must be the same.

  11. Data Structures Tutorial
    Hadoop Interview Questions

  12. Question 8. Explain What Is Bit Strings In Erlang?

    Answer :

    To store an area of untyped memory, a bit string is used and are expressed using the bit syntax.

  13. Question 9. Explain What Is Pattern Matching?

    Answer :

    A pattern matching occurs when evaluating a function call. Through pattern matching mechanism, variables are bound to the values.

  14. Ruby on Rails Interview Questions

  15. Question 10. Explain What Is Pid Datatype?

    Answer :

    PID mean Process Identifier and is the datatype used for the unique process identifiers which are assigned to every process.

  16. Hadoop Tutorial

  17. Question 11. To Include A File In Erlang What Is The Command Used?

    Answer :

    In two ways, a file can be included in Erlang

    • include (File).
    • include_lib (File).
  18. SQL Interview Questions

  19. Question 12. How Run-time Error Is Handled In Erlang?

    Answer :

    It is possible to prevent run-time errors and other exceptions from causing the process to terminate by using Catch or Try. Catch Expr returns the value of expression unless an exception occurs during the evaluation. Try Exprs is the enhancement of catch with ability to identify the exception class and choose to handle the desired one.

  20. Python Interview Questions

  21. Question 13. In Erlang How “process” Is Created?

    Answer :

    The process is created by calling spawn, and spawn forms a new process and returns the pid.

    • Spawn (Module, Name, Args ) -> pid ()
  22. Ruby on Rails Tutorial

  23. Question 14. Define Guard Sequence And What Are The Valid Guard Expressions?

    Answer :

    Erlang function clauses can be protected with guards; a clause can be protected only if the guard holds. It is a sequence of guards, separated by semicolon (;), and a guard is a sequence of guard expressions separated by comma (,). The guard sequence is true if at least one of the guards is true.

  24. Question 15. Give The List Of Valid Guard Expressions?

    Answer :

    Valid guard expressions are:

    • Atom true,
    • Other constants
    • Calls to the BIFs specified
    • Term Comparisons
    • Arithmetic Expressions
    • Boolean Expressions
    • Short-circuit Expressions
  25. Django Interview Questions

  26. Question 16. Explain How Message Is Send And Receive In Erlang?

    Answer :

    For sending message Erlang uses the exclamation mark (!) as the operator for sending a message. The syntax used for sending a message is Pid ! Message.

    For receiving message Erlang uses Pattern Matching, to deliver a message from the message queue receive statement is used.

  27. Django Tutorial

  28. Question 17. Explain What Is Spawn/ 1l3 And Spawn_link 1l3?

    Answer :

    Spawn/ 1l3: It creates a new process and return its pid. In system scheduler queue, the new process is placed so that it runs some time later.

    Spawn_link/1l3: It provides the same functionality as spawn/1l3 but with the addition of a link that is atomically created between the newly spawned process and the caller.

  29. Javascript Advanced Interview Questions

  30. Question 18. Mention What Is The Syntax To Write Macros In Erlang?

    Answer :

    The syntax used to write Macros in Erlang is

    • define ( Const, Replacement ).
    • define ( Fun ( Var1 , Var2, …., Var ) , Replacement )
  31. Data Structures Interview Questions

  32. Question 19. List Out The Pre-defined Macros In Erlang?

    Answer :

    The pre-defined Macros in Erlang is

    • Module: It returns the name of the current module
    • Module_String: It returns the name of the current module, as a string
    • File: It returns the current file name
    • Line: It returns the current line number
    • Machine: It returns the current machine name, ‘BEAM.’
  33. Javascript Advanced Tutorial

  34. Question 20. Explain What Is A Record And How You Can Define Records In Erlang?

    Answer :

    For storing a fixed number of elements, a data structure is used which is referred as record. Expressions are translated into tuple expressions during compilation record.

    Record in Erlang is defined by the name of the record, followed by the field names of the record. Record and field names must be atoms.

    • record (Name, { Field1 [= Value] , … FieldN [= ValueN] } )
  35. Hadoop Administration Interview Questions

  36. Question 21. Mention What Is The Command Used For Accessing Record Field In Erlang?

    Answer :

    Expr#Name.Field, this command will return the value of the mentioned field while for returning the position of the specified field #Name.Field is used.

  37. Question 22. Explain What Is Epmd?

    Answer :

    epmd is a small name server which is used by Erlang programs when establishing distributed Erlang communications. It is also referred as an Erlang Port Mapper Daemon. It is responsible for mapping the symbolic node names to machine addresses it is used.

  38. Software Development Lifecycle (SDLC) Tutorial