Our team has conducted extensive research to compile a set of Clojure MCQs. We encourage you to test your Clojure knowledge by answering these 80+ multiple-choice questions provided below.
Simply scroll down to begin!
A. @ symbol when defining regex
B. # symbol before the string in regex
C. # symbol before regex in (re-seq)
D. Nothing. The syntax is correct
E. # symbol before regex and after def
A. Every function call is a form, but not every form is a function call.
B. Every form is a function call, but not every function call is a form.
C. The terms "function call" and "form" are completely interchangeable.
D. A form is like a function call, except it invokes a macro instead.
A. True
B. False
A. provide thread-isolated transactions
B. provide thread-local variable bindings
C. manage independent, asynchronous changes to a single location
D. manage independent, synchronous changes to a single location
A. provide thread-local variable bindings
B. are a low-level construct that should be avoided in most cases
C. manage independent, asynchronous changes to a single location
D. provide thread-isolated transactions
A. java.lang.Double
B. float
C. Fixnum
D. Float
A. done for every call which is in a tail position
B. only done for simple recursion
C. impossible
D. not supported natively by the compiler, but could be simulated using thunks, trampolines, and macros.
A. There is no difference between quote (') and syntax-quote (`)
B. Syntax-quote (`) fully qualifies symbols, while quote (') doesn't
C. Quote (') fully qualifies symbols, while syntax-quote (`) doesn't
A. -> is a macro while comp is a higher order function
B. -> and comp are exactly the same, except the parameters are in the opposite order
C. -> is not a valid identifier in clojure, but comp is
D. comp is a macro while -> is a higher order function
A. True
B. False
A. False
B. True
C. (1 2 3)
D. 6
E. 5
A. important-value
B. defmacro
C. hygienic
D. gensym
A. reduce
B. map
C. recur
D. leap
A. *
B. ^
C. "
D. (
A. dependency injection
B. strategy pattern
C. chain of responsibility
D. the template method
A. {:a 1 :b 2}
B. #{:a 1 :b 2}
C. [:a 1 :b 2]
A. True
B. False
A. defmulti, defmethod
B. derive, make-heiracrchy
C. fill, fill-dispatch
D. defmethod, defmulti
A. Window
B. Buffer
C. inferior-lisp
D. paredit
A. def
B. let
C. do
D. fn
A. Installing and configuring Leiningen or setting up and configuring an app server.
B. Copying the .war file your build process is producing to your server.
C. Restarting the application
D. Reverting your application's .war file to a prior version.
A. True
B. False
A. (new Atom <value>)
B. (new-atom value)
C. (new 'Atom <value>)
D. (atom <value>)
E. (make-atom <value)
A. True
B. Can't define a reserved symbol
C. + is reserved and can't be re-defined
D. False
E. Syntax error
A. implemented in a way that makes them robust in case of memory errors
B. immutable
C. stored in a database
D. serializable
A. False
B. True
A. False
B. True
A. Software Transactional Memory
B. Step, Translate, Motion
C. State Transfer Machine
D. Safe Transactions in Memory
A. apply a function to all elements in a collection and return a sequence of the results
B. All of the above
C. aggregate the elements in a collection using a given function and return the result as a single value
D. substract a given amount from an integer value
A. Read-time, gather-time, run-time
B. Read-time, compile-time, load-time
C. There are actually 4 phases.
D. Read-time, compile-time, run-time
A. List
B. Map
C. Array
D. Vector
A. Hibernate
B. Korma
C. SLIME
D. Entity
A. Rediscover Enlightened Programs and Languages
B. Read, Eval, Process, Loop
C. REPresentational Language
D. Read, Eval, Print, Loop
A. atom
B. keyword
C. variable name
D. symbol
A. Macro
B. All of these
C. Special Form
D. Function
A. conj, pop, peek
B. get, find, pop
C. find, conj, get
D. get, nth, find
A. Macros are basically a glorified parameterizable search-replace mechanism. They are error prone, and should be avoided at all costs.
B. Macros provide an ad-hoc mechanism for improving the performance of critical code.
C. Macros allow programmers to specify program transformations that occur during compile time.
D. Macros are useful, but Clojure's implementation of them is very limited.
A. apply a function to all elements in a collection and return a sequence of the results
B. All of the above
C. aggregate the elements in a collection using a given function and return the result as a single value
D. create a new Map object containing the specified elements
A. Specific collections
B. Concrete lists
C. Logical views of collections
D. Ordered codes
A. def average (numbers) numbers.inject(: +) / numbers.length end
B. (defn average [numbers] (/ (apply + numbers) (count numbers)))
C. def average (numbers): return sum( numbers) / len( numbers)
D. public static double average (double[] numbers) { double sum = 0; for (int i = 0; i < numbers.length; i + +) { sum + = numbers[ i]; } return sum / numbers.length; }
A. REST service modules
B. SOAP service modules
C. API service modules
D. JSON service modules
E. HTTP service modules
A. :
B. -
C. ;
D. #
A. (class-name. args)
B. #"pattern"
C. {key-value-pairs}
D. ^{key-value-pairs} object
A. basic comments and source comments
B. Single-line comments and Form-level comments
C. custom comments and code-snippets
D. textual comments and multi-line comments
A. All functions that mutate some state must end with a "!", or else you will get a compiler error.
B. It warns users that the function is deprecated.
C. It is a convention that indicates the function mutates some state.
D. It serves as a warning that the function in question may produce an unstable result.
A. False
B. True
A. vectors
B. stacks
C. indices
D. contains
A. #(single-expression)
B. #(double-expression)
C. #{items}
D. prefix#
A. List
B. Vector
C. Map
D. Array
A. (method-name arg1 arg2 arg3)
B. function-name (arg1, arg2, arg3)
C. (function-name arg1 arg2 arg3)
D. methodName(arg1, arg2, arg3)