Common Lisp Basic Programming Test

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Cripstwick
C
Cripstwick
Community Contributor
Quizzes Created: 636 | Total Attempts: 763,111
Questions: 10 | Attempts: 403

SettingsSettingsSettings
Common Lisp Basic Programming Test - Quiz

Common Lisp (CL) is a phenomenal language used by a handful of programmers; it is a data exchange language of the original Lisp programming language. Take this basic programming test to assess your knowledge of Common Lisp.


Questions and Answers
  • 1. 

    Who was the founder of Lisp? 

    • A.

      Jamie McCarthy

    • B.

      John McCarthy

    • C.

      Jack McCarthy

    • D.

      Jacen McCarthy

    Correct Answer
    B. John McCarthy
    Explanation
    John McCarthy is the correct answer because he is widely recognized as the founder of Lisp, a programming language that was developed in the late 1950s. McCarthy, an American computer scientist, played a crucial role in the development of artificial intelligence and was instrumental in the creation of Lisp, which became one of the most influential programming languages in the field. His contributions to the field of computer science and his work on Lisp have had a lasting impact on the industry.

    Rate this question:

  • 2. 

    What does Lisp stand for? 

    • A.

      Listening protocol

    • B.

      List processing

    • C.

      Little performance

    • D.

      Logical process

    Correct Answer
    B. List processing
    Explanation
    Lisp stands for List processing. Lisp is a programming language that was developed in the late 1950s and is known for its unique data structure called a list. It is designed to manipulate and process lists of data efficiently, making it a powerful tool for tasks such as symbolic processing, artificial intelligence, and language processing. The other options, listening protocol, little performance, and logical process, do not accurately represent the acronym Lisp.

    Rate this question:

  • 3. 

    Which extention is used for Lisp files? 

    • A.

      .lsp

    • B.

      .lps

    • C.

      .lisp

    • D.

      .xlsp

    Correct Answer
    A. .lsp
    Explanation
    The correct answer is .lsp. This file extension is commonly used for Lisp files.

    Rate this question:

  • 4. 

    Which of the following LISP expressions correctly defines a function that takes two arguments, adds them together, and then multiplies the result by 3?

    • A.

      (defun add-and-multiply (x y) (mult 3 (plus x y)))

    • B.

      (defun add-and-multiply (x y) (* 3 (+ x y)))

    • C.

      (defun add-and-multiply (x y) (3 * (x + y)))

    • D.

      (defun add-and-multiply (x y) (multiply 3 (add x y)))

    Correct Answer
    B. (defun add-and-multiply (x y) (* 3 (+ x y)))
    Explanation
    Option B correctly uses the LISP syntax to define a function where * is the multiplication operator and + is the addition operator. Option A uses incorrect function names "mult" and "plus" instead of the correct * and +. Option C has incorrect syntax as LISP requires prefix notation (operators before operands). Option D uses incorrect function names "multiply" and "add" instead of the correct * and +.

    Rate this question:

  • 5. 

    Strings are characters enclosed in which of these?

    • A.

      “”

    • B.

      []

    • C.

      ()

    • D.

    Correct Answer
    A. “”
    Explanation
    Strings are characters enclosed in double quotation marks (""). This is the correct answer because in programming languages, strings are typically defined by enclosing a sequence of characters within double quotation marks.

    Rate this question:

  • 6. 

    How many types of data variables are there in Common Lisp? 

    • A.

      1

    • B.

      2

    • C.

      3

    • D.

      4

    Correct Answer
    B. 2
    Explanation
    Common Lisp has two types of data variables: lexical variables and special variables. Lexical variables are used within a specific scope and are defined using the "let" or "let*" forms. They are typically used for local computations. Special variables, on the other hand, have dynamic extent and can be accessed and modified globally. They are defined using the "defvar" or "defparameter" forms. These variables are commonly used for configuration settings or global state.

    Rate this question:

  • 7. 

    Which of these is not a CL symbolic expression? 

    • A.

      List

    • B.

      Atom

    • C.

      Value 

    • D.

      Strings

    Correct Answer
    C. Value 
    Explanation
    In Common Lisp, a symbolic expression is a data structure that represents code or data. It can be either an atom or a list. An atom is a single entity, such as a number or a symbol. A list is a collection of symbolic expressions enclosed in parentheses. In this case, "Value" is not a CL symbolic expression because it is not defined as an atom or a list in the given options.

    Rate this question:

  • 8. 

    What is a sequence? 

    • A.

      Vectors and strings

    • B.

      Vectors and scalars

    • C.

      Vectors and lists

    • D.

      Vectors and values

    Correct Answer
    C. Vectors and lists
    Explanation
    A sequence is a collection of elements that are arranged in a specific order. Vectors and lists are both data structures that can be used to represent sequences. Vectors are one-dimensional arrays that can hold elements of the same data type, while lists are a type of container that can hold elements of different data types. Therefore, the correct answer is "Vectors and lists" because both of these data structures can be used to represent a sequence.

    Rate this question:

  • 9. 

    All of these arguments are needed for defining functions in Lisp except which parameter of function?

    • A.

      Name

    • B.

      Number

    • C.

      Body

    • D.

      Parameter

    Correct Answer
    B. Number
    Explanation
    In Lisp, all of these arguments, namely Name, Number, Body, and Parameter, are needed for defining functions except for the Number parameter. The Name parameter is used to give a unique identifier to the function, the Body parameter contains the actual code of the function, and the Parameter parameter is used to specify the input variables for the function. However, the Number parameter does not play a role in defining functions in Lisp.

    Rate this question:

  • 10. 

    What is Lisp popularly used for?

    • A.

      Artificial Intelligence

    • B.

      Search engines

    • C.

      Mobile apps

    • D.

      Web design

    Correct Answer
    A. Artificial Intelligence
    Explanation
    Lisp is popularly used for Artificial Intelligence because it is a programming language that supports the development of complex algorithms and logic. Lisp's flexibility and powerful features, such as its ability to manipulate symbolic expressions and support for recursion, make it well-suited for tasks related to AI, such as natural language processing, expert systems, and machine learning. Lisp's rich history in AI research and its focus on symbolic processing have contributed to its popularity in this field.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jul 16, 2024
    Quiz Edited by
    ProProfs Editorial Team
  • Mar 28, 2018
    Quiz Created by
    Cripstwick
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.