Neo4j Interview Questions

Neo4j Interview Questions | Freshers & Experienced

  • Sharad Jaiswal
  • 13th Dec, 2021

About Neo4j

Neo4j is a Neo4j, Inc. graph database management system. It is accessible in an open-source "community edition" licensed under the GPL3, with online backup and extensions of high availability licensed under a closed-source commercial license. Neo4j is fully implemented in Java and can be accessed via software developed in other languages by using the Cypher Query Language via a transactional HTTP node or a binary "bolt" protocol.

Key Features of Neo4j

Below are few major features of Neo4j

Cypher API and Native Java API

MVC Framework


Apache Lucence

Graph Data Model

ACID Property

Built-in Web applications

Flexible Schema

Neo4j Interview Questions & Answers;

Q1. Explain what is Neo4j?

Neo4j is a graph database management system developed by Neo4j Inc. It is a mature and robust database with a high-performance graph store.

  • It has a friendly language and supports ACID transactions.
  • It allows the programmer to work with a flexible structure of nodes and relationships.
  • It has all the benefits of an enterprise quality database and offers orders of magnitude performance benefits compared to the relational database.
  • It is built using Apache Maven and is available as both standalone servers and as an embeddable component.

Q2. For what Neo4j is widely used?

When you have a connected data technology by using a graph database powered by the Neo4j, you can extract the true value found in the data by building relationships between the data.

This is the most important use case of the Neo4j graph database. Companies like eBay, Walmart, Telenor, UBS, Cisco, HP use the Neo4j graph database to build a relationship between the data and extract useful relationships between them.

Q3. List some features of Neo4j?

List some features of Neo4j.

  • Neo4j uses SQL like query language called Neo4j CQL that is easy to learn.
  • It has support for ACID properties, UNIQUE constraints, and the indexes by using Apache lucence.
  • It gives developers the support for Cypher API and Native Java API to develop Java applications.
  • It has the support for exporting query data to the XLS and JSON format.
  • It gives REST API to be accessed by other programming languages like Java, Spring, Scala, etc.
  • Neo4j uses Native graph storage with Native GPE (Graph Processing Engine).

Q4. In which language Neo4j is written?

Neo4j is written in the Java language.

Q5. Enlist some popular graph databases?

Some of the popular graph databases are,

  • Neo4j
  • Microsoft Azure Cosmos DB
  • OrientDB
  • ArangeDB
  • Virtuoso
  • Amazon Neptune
  • GraphDB
  • Dgraph
  • FlockDB

Q6. How to store primitive array in Neo4j?

The primitive array can be stored as a property in the Neo4j.

Q7. How to run CQL commands in Neo4j?

Cypher Shell is a command-line tool that comes with Neo4j. This command shell is used to run CQL queries and perform administrative tasks.

Q8. Explain what is object cache in Neo4j?

Object cache in Neo4j is used to cache individual nodes and relationships & properties. These are cached in a form that is optimized for fast traversal in the graph. The cached contents are represented in the form of a graph that supports the Neo4j object API and graph traversals. This is also called a high-level cache that is contained in the heap memory of the JVM. This form of cache is highly optimized for fast traversal.

Q9. For what Neo4j CQL MATCH command is used?

The MATCH command is used to search for a pattern in the database that is specified in the command. The specification for the match command s normally mentioned in the where command. This command scans the entire database searching for the node with a specific label present in the where clause and returns if it finds any.

//basic example of Match command

This command returns all the nodes in the database.

Q10. What is difference between grap and object-oriented databases?

The main difference between the graph and the object-oriented database is that the elements are stored as nodes and edges in the graph database, and the elements are stored as objects in the object-oriented database. Also, the schema of the object-oriented database is defined by its class and the schema of the graph database is independent of the application. This makes mapping the data much easy in the graph database than the object-oriented database.

Q11. List some CQL commands.

Some of the important SQL commands are,

  • BATCH - It applies different DML statements with atomicity.
  • CREATE TABLE - It creates a table.
  • DELETE - It removes data from one or more columns/rows.
  • DROP TABLE - It removes the table.
  • INSERT - It inserts a new row into the existing table.
  • SELECT - It returns data from the table.
  • TRUNCATE - It removes all the data from the table.
  • UPDATE - It modifies one or more column values in the table.

Q12. What is the use of set clause in neo4j?

The set clause in the neo4j is used to create a new property or multiple properties in the selected node. It can also be used to remove a property,

set label or multiple labels on a node.

MATCH (node:label{properties}) SET node.property1 = value RETURN node

The above statement sets a value to the property created on the node.

Q13. Enlist different types of object caches avaiable in Neo4j?

The available object cache types are,

None - In this type, no objects will be cached.

Soft - It is the default cache implementation that provides optimal utilization of the available memory. It is mainly suitable for high memory performance.

Weak - It provides a short life span for cached objects and is suitable for high throughput applications.

Strong - It is used to cache all data in the entire graph. It provides good performance if the graph is small enough to fit in the memory.

Q14. How indexing is done in Neo4j?

The index can be created over a property using the CREATE INDEX ON statement.

CREATE INDEX ON: album(name)

Here, we have created an index on the Name property of all the nodes with the label album.

Q15. What is use of CQL LIMIT clause in Neo4j?

This clause is used to set an upper limit on a number of tuples that are returned by the CQL. With this clause, we can set a maximum number of rows that a query must return from each partition.

FROM User_table

The above statement sets a limit on the number of rows up to two. So, the Select statement will return only two rows from the specified table.

About Author :

  • Author of Neo4j Interview Questions

    Sharad Jaiswal

    My name is Sharad Jaiswal, and I am the founder of Conax web Solutions. My tech stacks are PHP, NodeJS, Angular, React. I love to write technical articles and programming blogs.

Leave A Comment :

Valid name is required.

Valid name is required.

Valid email id is required.