Frequently asked questions and answers of Erlang in Programming Technologies of Computer Science to enhance your skills, knowledge on the selected topic. We have compiled the best Erlang Interview question and answer, trivia quiz, mcq questions, viva question, quizzes to prepare. Download Erlang FAQs in PDF form online for academic course, jobs preparations and for certification exams .
Intervew Quizz is an online portal with frequently asked interview, viva and trivia questions and answers on various subjects, topics of kids, school, engineering students, medical aspirants, business management academics and software professionals.
Question-1. What are processes in Erlang?
Answer-1: Processes in Erlang are lightweight and run in isolation, making concurrency efficient.
Question-2. What is the significance of OTP in Erlang?
Answer-2: OTP (Open Telecom Platform) provides libraries and design principles for building robust applications.
Question-3. How does Erlang handle concurrency?
Answer-3: Concurrency in Erlang is achieved through lightweight processes and message passing.
Question-4. What is a tuple in Erlang?
Answer-4: A tuple is a fixed-size collection of values enclosed in curly braces, e.g., {1, 2, 3}.
Question-5. How are lists represented in Erlang?
Answer-5: Lists are sequences of elements enclosed in square brackets, e.g., [1, 2, 3].
Question-6. What is pattern matching in Erlang?
Answer-6: Pattern matching is used to match and destructure data structures directly in code.
Question-7. What is hot code swapping in Erlang?
Answer-7: Hot code swapping allows updating code in a running system without downtime.
Question-8. How is fault tolerance achieved in Erlang?
Answer-8: Fault tolerance is achieved through process isolation, supervision trees, and OTP principles.
Question-9. What is a supervision tree in Erlang?
Answer-9: A supervision tree is a hierarchical structure for monitoring and restarting processes.
Question-10. What is an atom in Erlang?
Answer-10: An atom is a constant whose name is its value, often used to represent states or commands.
Question-11. How are strings represented in Erlang?
Answer-11: Strings are represented as lists of integers where each integer corresponds to a character's ASCII value.
Question-12. What are guards in Erlang?
Answer-12: Guards are additional conditions in pattern matching that refine matching criteria.
Question-13. What is a record in Erlang?
Answer-13: A record is a data structure for grouping related fields, defined using -record.
Question-14. How does Erlang manage memory?
Answer-14: Erlang uses garbage collection, with each process having its own isolated memory space.
Question-15. What is spawn in Erlang?
Answer-15: spawn creates a new process to execute a given function concurrently.
Question-16. What is the difference between send and receive in Erlang?
Answer-16: send sends messages to processes, while receive retrieves messages from a process's mailbox.
Question-17. What are the uses of gen_server in Erlang?
Answer-17: gen_server is a generic OTP behavior module for implementing server processes.
Question-18. What is the purpose of the module attribute in Erlang?
Answer-18: The module attribute defines the name of the module, e.g., -module(module_name)..
Question-19. What is a list comprehension in Erlang?
Answer-19: List comprehensions are concise ways to generate lists by filtering and transforming elements.
Question-20. How do you handle errors in Erlang?
Answer-20: Errors are handled using try...catch, throw, and OTP supervision strategies.
Question-21. What are ports in Erlang?
Answer-21: Ports enable communication between Erlang processes and external programs.
Question-22. What is the receive block used for?
Answer-22: The receive block is used to handle incoming messages in a process's mailbox.
Question-23. What is immutability in Erlang?
Answer-23: Data in Erlang is immutable, meaning once created, it cannot be changed.
Question-24. How is recursion used in Erlang?
Answer-24: Recursion is the primary way to implement loops in Erlang, as it lacks traditional loop constructs.
Question-25. What is mnesia in Erlang?
Answer-25: mnesia is a distributed database management system integrated into Erlang.
Question-26. How do you define a function in Erlang?
Answer-26: Functions are defined with function_name(Arguments) -> Body.
Question-27. What is the role of gen_fsm in Erlang?
Answer-27: gen_fsm is an OTP behavior module for implementing finite state machines.
Question-28. What are macros in Erlang?
Answer-28: Macros are compile-time constants or code snippets defined using -define.
Question-29. What is the difference between fun and function in Erlang?
Answer-29: fun creates an anonymous function, while function refers to named functions.
Question-30. How do you debug Erlang applications?
Answer-30: Erlang provides tools like observer, dbg, and trace for debugging applications.
Question-31. What is the purpose of the process_flag function?
Answer-31: process_flag is used to change process-specific flags like trapping exits.
Question-32. How are modules compiled in Erlang?
Answer-32: Modules are compiled using the c(ModuleName). command in the Erlang shell.
Question-33. What is the difference between exit and throw in Erlang?
Answer-33: exit terminates a process, while throw is used for non-fatal exceptions.
Question-34. What are ETS tables in Erlang?
Answer-34: ETS (Erlang Term Storage) tables are in-memory storage for large data sets.
Question-35. How do you declare a variable in Erlang?
Answer-35: Variables in Erlang start with an uppercase letter and are immutable after assignment.
Question-36. What is the significance of link in Erlang?
Answer-36: link creates a bi-directional link between two processes for fault detection.
Question-37. How do you run an Erlang application?
Answer-37: Use the erl command to start the shell and execute the application module.
Question-38. What is a pid in Erlang?
Answer-38: A pid is a unique identifier for a process in Erlang.
Question-39. What is the difference between synchronous and asynchronous communication in Erlang?
Answer-39: Synchronous communication waits for a response, while asynchronous communication does not.
Question-40. What is gen_event in Erlang?
Answer-40: gen_event is an OTP behavior module for implementing event handling and dispatching.
Question-41. How do you manage dependencies in Erlang projects?
Answer-41: Dependencies are managed using tools like rebar3.
Question-42. What are the different types of processes in Erlang?
Answer-42: Processes in Erlang can be normal processes, system processes, or supervisors.
Question-43. What is the purpose of timer module in Erlang?
Answer-43: The timer module provides functions for time-related operations like delays and intervals.
Question-44. What is dialyzer in Erlang?
Answer-44: dialyzer is a static analysis tool for finding type errors and code inconsistencies.
Question-45. What is the rpc module used for in Erlang?
Answer-45: The rpc module provides remote procedure call functionalities for distributed systems.
Question-46. How does Erlang achieve scalability?
Answer-46: Scalability in Erlang is achieved through lightweight processes, message passing, and fault-tolerant design.
Question-47. What is Erlang?
Answer-47: Erlang is a functional programming language used for building scalable and fault-tolerant systems.
Question-48. Who created Erlang?
Answer-48: Erlang was created by Ericsson in the 1980s for use in telecommunications systems.
Question-49. What is the main feature of Erlang?
Answer-49: Erlang excels at handling concurrent, distributed, and fault-tolerant applications.
Question-50. What is the BEAM in Erlang?
Answer-50: BEAM is Erlang's virtual machine that executes compiled bytecode.
Frequently Asked Question and Answer on Erlang
Erlang Interview Questions and Answers in PDF form Online
Erlang Questions with Answers
Erlang Trivia MCQ Quiz