×

Top 24 Clojure Interview Questions for 2024

1) What is Clojure?

Clojure is a dynamic, general-purpose programming language. It is simple, coherent and powerful tool. It is based on Lisp Programming language.

2) Which platform is used to run Clojure?

JVM (Java Virtual Machine), CLR (Common Language Runtime) and JavaScript are platform used to run Clojure.

3) Who designed the Clojure?

Rich Hickey designed the Clojure.

4) What is the stable version of Clojure?

The stable version of Clojure is 1.8 and released on 19 January 2016.

5) How to write a simple program of Clojure?

The following code for write a simple program:
(ns clojure.examples.hello  

   (:gen-class))  

  

(defn hello-world [username]  

   (println (format "Hello, %s" username)))  

  

(hello-world "world")

6) What are the features of Clojure?

There are various following features of Clojure:
  • It is based on the Lisp programming Language.
  • It is functional programming language.
  • It manages the state of an application.
  • It supports concurrency.

7) What is the use of StructMaps?

StructMaps are used to create structures.

8) What is the filename extension of Clojure?

Clojure filename extension are: clj, .cljs, .cljc, .edn

9) What is the keyword to define a function?

The â€˜defn’ keyword is used to define the function.

10) What is REPL in Clojure?

REPL stand for read eval print loop. It is a tool for Clojure code.

11) How to launch a REPL?

The following command is used to launch a REPL:
java -cp clojure.jar clojure.main

12) What are the Clojure variables?

There are following Clojure variables:
  • Short
  • Int
  • Long
  • Float
  • Char
  • Boolean
  • String

13) How to declare a variable in Clojure?

The following code for declare a variable in Clojure:
(def var-name var-value)

14) What are the operators in Clojure?

Clojure has following operators that are given below:
  • Arithmetic operators
  • Relational operators
  • Logical operators
  • Bitwise operators

15) What is the syntax for declaration the operator and operands in Clojure?

In Clojure, the following syntax for declaring the operator and operand is:
(operator operand1 operand2 operandn)

16) What is clojure.main namespace in Clojure?

Clojure.main namespace provides functions that allow Clojure program and interactive sessions.

17) What are the properties of Socket Server?

The following socket Server properties are:
Socket Server Properties Description
server-daemon It is by defaults true and socket server thread doesn’t block exit.
Address It hosts or address, It is by defaults to loopback.
Port It uses positive integer, it is required.
Accept It is namespaced symbol of function. It is used to invoke on socket accept, it is required.
Args It is sequential collection of args to pass to accept.
bind-err It is by default true, and binds *err* to socket out stream.
client-daemon It is by default true and socket client thread doesn’t block exit.

18) What is set in Clojure?

In Clojure, set is unique value that is created with the help of the set command. Example:
(ns clojure.examples.example  

   (:gen-class))  

(defn example []  

   (println (set '(1 1 2 2))))  

(example)

19) What is the use of Macros in Clojure?

Macro is used to define the syntactic constructs which would require primitives or built-in support in other languages.

20) What is Map in Clojure?

Map is a collection, which is used to maps the Keys to the values. It provided two types of Map:
  • HashMaps
  • SortedMaps

21) What is Clojure Namespace?

Clojure Namespace is used to specify the classes into separate logical spaces.

22) What are the special variables?

There are following two types of special variables:
  • &form : The actual form (as data) that is being invoked
  • &env : A map of local bindings. It is from symbols that is used to objects holding and compiler information about the binding.

23) What is the use of Clojure libs?

A lib is a named unit of Clojure source code. It contained in a java resource within classpath. Closer provides code loading and dependency tracking via lib. Example:
(ns com.my-company.clojure.examples.my-utils  

 (:import java.util.Date)  

 (:use [clojure.string :only (join)])  

 (:require [clojure.java.io :as jio]))

24) What is Atoms in Clojure?

In Clojure, atom is a data type that provides a way to manage shared synchronous, independent state. Example:
 
(ns clojure.examples.example  
   (:gen-class))  
(defn example []  
   (def myatom (atom 1))  
   (println @myatom))  
(example)

Related Topics

Top 15 Erlang Interview Questions for 2024

1) What is Erlang÷ Erlang is an open source programming language. It is used to build massively scalable soft real-time systems. It has runtime environment. It supports concurrency, fault tolerance and...

2 minutes read.

Top 43 React Native Interview Questions for 2024

1. What is React Native? React native is an open-source JavaScript framework designed by Facebook for native mobile applications development. It is based on a JavaScript library-React. React Native saves your development...

11 minutes read.

Top 30 CodeIgniter interview Questions for 2024

1) What is CodeIgniter? CodeIgniter is an open source PHP framework. It is used to develop web applications and websites. It is loosely based on MVC pattern and easy to use...

4 minutes read.

Top 30 Zend Framework Interview Questions for 2024

1) What is Zend Framework? Zend is an open source, object-oriented web application framework. It is implemented in PHP 5. It was developed in 3 March 2006. 2) What is the use...

6 minutes read.

Top 25 PL/SQL Interview question for 2024

1) What is PL/SQL? It is defined as SQL having Procedural features of Programming Language i.e. Procedural Language extension of SQL. 2) Enlist the section of PL/SQL block. It consist of three block ...

4 minutes read.

Top 15 Foundation Interview Questions for 2024

1) What is Foundation? Foundation is a front-end framework that is for designing beautiful responsive websites. This framework is compatible with all types of devices and provides you with HTML, CSS...

2 minutes read.

Top 30 Sencha Touch Interview Questions for 2024

1) What is Sencha Touch? Sencha Touch is an UI (User Interface) JavaScript library. It is written in JavaScript. It is used to build mobile interface quickly and easily. It works...

6 minutes read.

Top 15 PostgreSQL Interview Questions for 2024

1) What is PostgreSQL? PostgreSQL is a most advance open source database system. PostgreSQL is an object Oriented Relational Database Management System (ORDBMS). PostgreSQL source code is available free of charge...

3 minutes read.

Top 15 CherryPy Interview Questions for 2024

1) What is CherryPy? CherryPy is a web framework used for Python. It provides a friendly interface for Http protocol for Python developer. 2) Why we use CherryPy? CherryPy has following strength: Simplicity: It...

3 minutes read.

Top 30 Perl interview questions for 2024

1) What is Perl? It is a programming language which is used for web development, system administration, GUI development and etc. It is also known as cross-platform programming language. 2) What are the...

4 minutes read.

Top 15 Euphoria Interview Questions for 2024

1) What is Euphoria? Euphoria is a programming language. It is open source, powerful and easy to learn. It stands for End-User Programming with Hierarchical Objects for Robust Interpreted Applications 2) Who...

2 minutes read.

Top 14 Materialize CSS Framework Interview Questions for 2024

1) What is Materialize? Materialize is a CSS framework that contains library file. It is created with CSS, JavaScript and HTML. It helps to create attractive, reliable and functional web pages...

7 minutes read.

Top 15 Java OOPS Interview Questions for 2024

1) What are the advantages of Java Package? Advantages of Java package are: Provides access protection Removes naming collision Easily maintained 2) What are the types of Access Modifiers in Java? Two types...

4 minutes read.

Top 16 Arduino Interview Questions for 2024

1) What is Arduino? Arduino is an open source electronic platform. It is based on easy-to-use hardware and software. It able to read input signal. It is used to write and...

2 minutes read.

Top 15 ExpressJS Interview Questions for 2024

1) What is ExpressJs? Express Js is a framework for node.js which is light-weight and fast. It is used to develop web and mobile applications. 2) What are the features of ExpressJs? Following...

4 minutes read.

Backbone.js Interview Questions

1) What is Backbone.js? Backbone.js is a JavaScript framework or library. It is a client-side framework which helps in creating single page application in organized manner i.e. structured layout. 2) Backbone.js is...

4 minutes read.

Top 30 RPA Interview questions for 2024

Q1. What is RPA (Robotic Process Automation)? The Robotic Process Automation is a trending technology in the market where: Robotic: Robotic means "machines that copy the human actions." Process: Process means "the sequence of steps which...

12 minutes read.

Top 48 C# Interview Questions for 2024

1) Write a program in C# to print "HELLO WORLD"? class Program         {          static void Main(string  args[])           {             System.Console.WriteLine(" HELLO WORLD ");             }          } 2) Write a program in C# to print "TutorialandExample" using namespace? Here, namespace is used to group related classes. Using System;    namespace  TutorialandExample      {         public class           {             public static void Main(string[]  args)             {              Console.WriteLine(" TutorialandExample ");             }          }       } 3) What are the...

8 minutes read.

Polymer.js Interview Questions

1) What is Polymer.js? Polymer.js is an open source JavaScript library. It is developed by Google. It is used to develop web applications for using of web components like HTML. 2) Describe...

3 minutes read.

Top 15 Apache Tapestry Interview Questions for 2024

1) What is Apache Tapestry? It is an open source web framework written in Java and can work under any application server. It is easily integrate with back ends like Hibernate...

2 minutes read.