Lisp (short for List Processing) is a family of programming languages known for its unique and distinctive features. It was one of the first high-level programming languages and was invented by John McCarthy in the late 1950s. Lisp has been influential in the development of many other programming languages and has found applications in various fields, including artificial intelligence and symbolic computation.
Key features and characteristics of Lisp include:
S-expressions: In Lisp, programs and data are represented as symbolic expressions or S-expressions. S-expressions are nested lists made up of atoms (symbols or numbers) and other lists.
Homoiconicity: Lisp’s code and data share the same syntax. This characteristic, called homoiconicity, makes it easy to manipulate code programmatically and enables powerful metaprogramming capabilities.
Dynamic typing: Lisp is dynamically typed, meaning variable types are determined at runtime rather than explicitly declared.
Automatic memory management: Like many modern languages, Lisp incorporates garbage collection to automatically manage memory allocation and deallocation.
Just so you know
With OnlineExamMaker quiz software, anyone can create & share professional online assessments easily.
Article outline
- Part 1: 30 Lisp quiz questions & answers
- Part 2: Download Lisp questions & answers for free
- Part 3: Free online quiz creator – OnlineExamMaker
Part 1: 30 Lisp quiz questions & answers
1. What does Lisp stand for?
a) List Processing
b) Logical Instruction Set Programming
c) Language-Integrated Symbolic Programming
d) Logic and Integer Symbolic Processing
Answer: a) List Processing
2. In Lisp, programs and data are represented as:
a) Strings
b) Arrays
c) S-expressions
d) Integers
Answer: c) S-expressions
3. What does homoiconicity mean in the context of Lisp?
a) The ability to execute code without interpretation
b) The integration of symbolic and numeric data types
c) Code and data sharing the same syntax
d) Recursive data structures
Answer: c) Code and data sharing the same syntax
4. Which Lisp dialect is commonly used for extending the functionality of the Emacs text editor?
a) Common Lisp
b) Scheme
c) Clojure
d) Emacs Lisp
Answer: d) Emacs Lisp
5. Which control structure does Lisp encourage the use of?
a) Loops
b) Conditionals
c) Recursion
d) Switch statements
Answer: c) Recursion
6. What is the primary purpose of Lisp macros?
a) To add new features to the programming language
b) To simplify code with pre-defined functions
c) To allow for powerful code transformations and abstractions
d) To improve code readability
Answer: c) To allow for powerful code transformations and abstractions
7. Which Lisp dialect is known for its minimalist and elegant design?
a) Common Lisp
b) Scheme
c) Clojure
d) Emacs Lisp
Answer: b) Scheme
8. In Lisp, how are variables represented?
a) With a dollar sign prefix ($variable)
b) With a hash symbol prefix (#variable)
c) With a percent sign prefix (%variable)
d) Without any special prefix (variable)
Answer: d) Without any special prefix (variable)
9. What is the primary application of Lisp in artificial intelligence (AI)?
a) Image processing
b) Machine learning
c) Natural language processing
d) Web development
Answer: c) Natural language processing
10. Which Lisp dialect is designed to run on the Java Virtual Machine (JVM)?
a) Common Lisp
b) Scheme
c) Clojure
d) Emacs Lisp
Answer: c) Clojure
11. Which of the following is NOT a Lisp data type?
a) List
b) Integer
c) Symbol
d) Dictionary
Answer: d) Dictionary
12. In Lisp, which function is used to create a new list by adding an element at the end?
a) append
b) cons
c) push
d) extend
Answer: a) append
13. What does the ‘car’ function in Lisp return?
a) The first element of a list
b) The last element of a list
c) The length of a list
d) The sum of all elements in a list
Answer: a) The first element of a list
14. Which operator is used for logical AND in Lisp?
a) &&
b) and
c) AND
d) &
Answer: b) and
15. What is the output of the following Lisp code: (+ 5 3 (* 2 4)) ?
a) 17
b) 15
c) 13
d) 20
Answer: a) 17
Part 2: Download Lisp questions & answers for free
Download questions & answers for free
16. Which function is used to convert a number into a string in Lisp?
a) int-to-string
b) str
c) number-to-string
d) stringify
Answer: c) number-to-string
17. In Lisp, what is the purpose of the ‘cdr’ function?
a) It returns the first element of a list.
b) It returns the last element of a list.
c) It returns the rest of the elements in a list except the first one.
d) It returns the length of a list.
Answer: c) It returns the rest of the elements in a list except the first one.
18. Which Lisp dialect is commonly used in web development?
a) Common Lisp
b) Scheme
c) Clojure
d) Emacs Lisp
Answer: c) Clojure
19. Which special symbol is used to represent ‘nil’ or an empty list in Lisp?
a) ()
b) []
c) {}
d) <>
Answer: a) ()
20. In Lisp, what is the role of ‘setq’?
a) It is used to define functions.
b) It is used to set the value of a variable.
c) It is used to include external libraries.
d) It is used to create macros.
Answer: b) It is used to set the value of a variable.
21. Which Lisp dialect is known for its support of object-oriented programming?
a) Common Lisp
b) Scheme
c) Clojure
d) Emacs Lisp
Answer: a) Common Lisp
22. What is tail recursion in Lisp?
a) A type of recursion used for processing linked lists.
b) A form of recursion where the recursive call is the last operation in the function.
c) A recursive algorithm used in tree data structures.
d) A form of recursion used in artificial intelligence algorithms.
Answer: b) A form of recursion where the recursive call is the last operation in the function.
23. Which function is used to calculate the length of a list in Lisp?
a) length
b) len
c) list-length
d) list-size
Answer: a) length
24. What does REPL stand for in the context of Lisp?
a) Read, Execute, Print, Loop
b) Reusable Programming Language
c) Recursive Expression Parser Library
d) Real-time Evaluation and Programming Loop
Answer: a) Read, Execute, Print, Loop
25. Which of the following is a valid comment syntax in Lisp?
a) /* This is a comment */
b)
c) ;; This is a comment
d) # This is a comment
Answer: c) ;; This is a comment
26. Which function is used to check if an element exists in a list in Lisp?
a) in
b) exists
c) contains
d) member
Answer: d) member
27. Which Lisp dialect is known for its focus on immutability and functional programming?
a) Common Lisp
b) Scheme
c) Clojure
d) Emacs Lisp
Answer: c) Clojure
Pro Tip
You can build engaging online quizzes with our free online quiz maker.
28. What is the role of the ‘map’ function in Lisp?
a) It applies a function to each element of a list and returns a new list.
b) It merges two lists into a single list.
c) It filters the elements of a list based on a given condition.
d) It sorts the elements of a list in ascending order.
Answer: a) It applies a function to each element of a list and returns a new list.
29. Which Lisp dialect is commonly used for educational purposes due to its simplicity?
a) Common Lisp
b) Scheme
c) Clojure
d) Emacs Lisp
Answer: b) Scheme
30. In Lisp, what does the function ‘cond’ do?
a) It performs a bitwise AND operation on two numbers.
b) It defines a new macro.
c) It allows multiple conditional branches to be tested in order.
d) It checks if a list is empty.
Answer: c) It allows multiple conditional branches to be tested in order.
Part 3: Best online quiz making platform – OnlineExamMaker
With OnlineExamMaker, you can create online exams, performance assessments, practice tests to assess leaners’ knowledge and skills, and boost their engagement & improve knowledge retention. Supporting up to 10 question types, teachers are able to create quizzes with multiple-choice, true or false, matching, and open-ended questions, OnlineExamMaker provides flexibility in creating professional assessments.
Create Your Next Quiz/Exam with OnlineExamMaker