Frequently asked questions and answers of Lisp Common Lisp, Scheme in Programming Technologies of Computer Science to enhance your skills, knowledge on the selected topic. We have compiled the best Lisp Common Lisp, Scheme Interview question and answer, trivia quiz, mcq questions, viva question, quizzes to prepare. Download Lisp Common Lisp, Scheme 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 is a lambda function in Lisp?
Answer-1: A lambda function is an anonymous function defined using the lambda keyword.
Question-2. How is conditional logic implemented in Lisp?
Answer-2: Conditional logic is implemented using the cond or if constructs.
Question-3. What is the difference between eq, equal, and =, in Common Lisp?
Answer-3: eq checks pointer equality, equal checks structural equality, and = compares numbers.
Question-4. How are loops implemented in Common Lisp?
Answer-4: Common Lisp uses constructs like loop, do, and recursion for iteration.
Question-5. What is the setf function in Common Lisp?
Answer-5: setf is used to update the value of a variable or data structure.
Question-6. What are macros in Lisp?
Answer-6: Macros are code transformations that allow manipulation of program structure before evaluation.
Question-7. What is let used for in Lisp?
Answer-7: let creates local bindings for variables within its body.
Question-8. How does Lisp handle garbage collection?
Answer-8: Lisp languages have built-in garbage collection to manage memory automatically.
Question-9. What is quote in Lisp?
Answer-9: quote prevents evaluation of an expression, treating it as data.
Question-10. What is the difference between Common Lisp and Scheme?
Answer-10: Common Lisp is a multi-paradigm language with more features, while Scheme is minimalistic and focuses on simplicity.
Question-11. How are arrays handled in Common Lisp?
Answer-11: Arrays in Common Lisp are created using make-array and accessed with aref.
Question-12. What is the significance of parentheses in Lisp?
Answer-12: Parentheses are used to delimit lists and expressions, representing both code and data.
Question-13. What is the role of the progn construct in Lisp?
Answer-13: progn evaluates multiple expressions sequentially, returning the value of the last.
Question-14. What is the use of mapcar in Lisp?
Answer-14: mapcar applies a function to each element of one or more lists and returns a new list.
Question-15. What are property lists in Lisp?
Answer-15: Property lists are key-value pairs used for storing metadata or attributes.
Question-16. What is dynamic scoping in Lisp?
Answer-16: Dynamic scoping resolves variable bindings based on the call stack at runtime.
Question-17. How is error handling done in Lisp?
Answer-17: Error handling is done using constructs like handler-case and ignore-errors.
Question-18. What is the apply function in Lisp?
Answer-18: apply calls a function with arguments provided in a list.
Question-19. What is tail recursion, and how does Lisp optimize it?
Answer-19: Tail recursion is a recursion where the recursive call is the last operation, and Lisp optimizes it to prevent stack growth.
Question-20. What are atoms in Lisp?
Answer-20: Atoms are the smallest elements in Lisp, such as symbols or numbers, that are not lists.
Question-21. What is the purpose of eval in Lisp?
Answer-21: eval evaluates a symbolic expression as Lisp code.
Question-22. How are closures implemented in Lisp?
Answer-22: Closures are implemented using lambda functions that capture the environment in which they are created.
Question-23. What is the role of defparameter in Lisp?
Answer-23: defparameter defines a global variable and assigns it an initial value.
Question-24. How does Scheme differ from Common Lisp in terms of standardization?
Answer-24: Scheme is standardized through RnRS reports, while Common Lisp follows the ANSI standard.
Question-25. What is the difference between append and concatenate in Lisp?
Answer-25: append joins lists, while concatenate combines sequences like lists, arrays, or strings.
Question-26. What is the format function in Common Lisp?
Answer-26: format is used for formatted output to strings or streams.
Question-27. What are rest parameters in Lisp?
Answer-27: Rest parameters are denoted by &rest in function definitions to accept variable-length arguments.
Question-28. What is the difference between load and compile in Common Lisp?
Answer-28: load executes source files directly, while compile generates bytecode for efficiency.
Question-29. What is a plist in Common Lisp?
Answer-29: A plist is a property list, a list of alternating keys and values.
Question-30. What is lexical scoping in Scheme?
Answer-30: Lexical scoping resolves variable bindings based on the structure of the code.
Question-31. How is state managed in functional programming with Lisp?
Answer-31: State is managed using immutable data structures or constructs like setf.
Question-32. What is case in Common Lisp?
Answer-32: case is a conditional construct for branching based on matching values.
Question-33. How does Scheme implement continuations?
Answer-33: Scheme implements continuations using the call/cc construct.
Question-34. What is multiple-value-bind in Common Lisp?
Answer-34: multiple-value-bind captures multiple return values from a function and binds them to variables.
Question-35. How does Lisp support metaprogramming?
Answer-35: Lisp supports metaprogramming through macros and the ability to manipulate code as data.
Question-36. What is a function cell in Common Lisp?
Answer-36: A function cell stores the definition of a function associated with a symbol.
Question-37. What is the purpose of gensym in Common Lisp?
Answer-37: gensym generates unique symbols, often used in macros to avoid name conflicts.
Question-38. What is eqv? in Scheme?
Answer-38: eqv? checks for equality of values with minimal guarantees about structural equivalence.
Question-39. How are streams implemented in Common Lisp?
Answer-39: Streams are implemented as objects for input and output, handled by standard functions like read and write.
Question-40. What are reader macros in Lisp?
Answer-40: Reader macros extend the syntax of the language by defining custom behavior for input characters.
Question-41. What is Lisp?
Answer-41: Lisp is a family of programming languages known for its symbolic expression and list processing capabilities.
Question-42. Who created Lisp and when?
Answer-42: Lisp was created by John McCarthy in 1958.
Question-43. What are the main dialects of Lisp?
Answer-43: Common Lisp and Scheme are the two most prominent dialects of Lisp.
Question-44. What does Lisp stand for?
Answer-44: Lisp stands for "LISt Processing."
Question-45. What is a list in Lisp?
Answer-45: A list in Lisp is a fundamental data structure that represents sequences of elements.
Question-46. How are functions defined in Common Lisp?
Answer-46: Functions are defined using the defun keyword, e.g., (defun func-name (args) body).
Question-47. What is car in Lisp?
Answer-47: car is a function that returns the first element of a list.
Question-48. What is cdr in Lisp?
Answer-48: cdr is a function that returns the rest of the list after the first element.
Question-49. What is the purpose of cons in Lisp?
Answer-49: cons constructs a new pair or adds an element to the front of a list.
Question-50. How does Lisp handle recursion?
Answer-50: Lisp supports recursion natively, often used as the primary control flow mechanism.
Frequently Asked Question and Answer on Lisp Common Lisp, Scheme
Lisp Common Lisp, Scheme Interview Questions and Answers in PDF form Online
Lisp Common Lisp, Scheme Questions with Answers
Lisp Common Lisp, Scheme Trivia MCQ Quiz