Neo4j Interview Questions
Neo4j Interview Questions : Neo4j is a most popular graph database management system developed by Neo4j, Inc. It is written in Java Programming language. It is highly scalable and schema free. Described by its developers as an ACID-compliant transactional database with native graph storage and processing, Neo4j is the most popular graph database according to DB-Engines ranking, and the 22nd most popular database overall.
It was built to efficiently store, handle, and query highly-connected data in your data model. With a powerful and flexible data model, you can represent your real-world, variably-structured information without a loss of richness.
What is Neo4J?
Neo4J is an open-source, schema-free, NoSQL, popular graph database. It is the world’s leading open-source graph database. Neo4J is also called graph database because it saves data structure in graph rather than in tables.
What are the important features of Neo4J databases?
- It is durable and fast
- Intuitive, using a graph model for Data representation.
- Reliable with full ACID transactions support
- Massively scalable supports up to several billion of nodes/relationships/properties
- Highly available, when distributed across multiple machines
- Expressive, powerful, readable using Cypher graph query language
- Fast with powerful traversal framework that supports high-speed query execution.
- Embeddable, with few small jar files
- Simple accessible by convenient Rest interface or object oriented Java API’s
In which language Neo4G is written?
Neo4J is written and implemented in Java language.
Which query language is used by Neo4J?
Cypher Query Language (CQL) is used by Neo4J.
What is the role of building blocks like Nodes, Relationships, Properties and Labels in Neo4J?
Roles of building blocks:
Nodes: They are entities equivalent to rows in table.
Relationship: It connects entities and structure domain.
Properties: It contains meta-data and attributes.
Labels: It groups nodes by role.
Which are the several popular Graph Databases?
Neo4J is a very popular Graph Database. Other Graph Databases are Oracle NoSQL Database, OrientDB, HypherGraphDB, GraphBase, InfiniteGraph, AllegroGraph etc.
What is use of Neo4j CQL command ?
- To create nodes with and without properties
- To create a relationship between nodes with properties
- To create a relationship between nodes without properties
- To make multiple or single labels to a Node or a Relationship
What is the difference between Neo4j graph database and MySQL?
Neo4j
- It consists of vertices and edges. Each vertex or node represent a key value or attribute
- It is possible to store dynamic content like images, videos, audio,
- It has the capability for deep search into the database without affecting the performance along with efficient timing
- We can relate any two objects in neo4j by the mean of making relationship between any two nodes
MySQL
- In relational databases, attributes are appended in plain table format
- In relational databases, such as MySQL, it’s difficult to store videos, audios, images,
- It takes longer time for database search and also inconvenient compared to neo4j
- It lacks relationship and difficult to use them for connected graphs and data
Explain some important characteristics of Neo4J?
Important characteristics of Neo4J:
- Neo4J is written on the top of JVM.
- It can do memory caching for graphs and provides compact storage, resulting in efficient scale-up.
- It provides continuous time traversals for relationship in the graph both in breadth and depth due to double linking on the storage level between nodes and relationships.
- Relationship in Neo4j is fast and makes it possible to materialize and use new relationships later on to “shortcut” and speed up the domain data when new requirement arises.
How files are stored in Neo4J?
Neo4J stores graph data in a number of different store files, and each store file contains the data for a specific part of the graph for example relationships, nodes, properties etc.
What is CQL? How can you run CQL commands in Neo4J?
CQL stands for Cypher Query Language. You have to use “$” prompt to run all CQL commands in Neo4j.
What are the several different types of object caches in Neo4J?
There are two different types of object caches in Neo4j:
Reference Caches: This object clause facilitates you to use as much as allocated JVM heap memory as it can hold nodes and relationships.
High-performance Caches: It is assigned a certain maximum amount of space on the JVM heap and will delete objects whenever it grows bigger than that.
Relationship and Nodes are added to the object cache as soon as they are accessed.
Which query language does Neo4J use and what it contains?
Neo4j uses Cypher query language, which is unique to Neo4j. If you want to traverse a graph, you have to know where you want to begin (Start), the rules that allow traversal (Match) and what data you are expecting back (Return). The basic query contains:
START n
MATCH n-[r]- m
RETURN r;
What can you delete databases in Neo4J?
If you want to delete/remove entire graph directory you can use command rm -rf data/*as such Neo4j is not storing anything outside that.
Is it possible to query Neo4j over the internet?
As such Neo4j got RESTful API, you can query over the web, or you can run it locally. It runs in the Heroku or Cloud.
What Neo4j CQL command is used for?
Neo4j CQL command can be used for the following reasons:
- create nodes with and without properties.
- create a relationship between nodes with properties.
- create a relationship between nodes without properties.
- It is used to make multiple or single labels to a Node or a Relationship.
Why is SET clause used for in Neo4J?
In Neo4J CQL, SET clause is used for following purposes:
- Update or Add properties values.
- Add new properties to existing Relationship or Node.
Is it easy to fragment a Neo4J graph across multiple servers?
It is very difficult to fragment a Neo4J graph across multiple servers.
How files are stored in Neo4j?
Neo4j stores graph data in a number of different store files, and each store file consists of the data for a specific part of the graph for example relationships, nodes, properties etc. for example Neostore.nodestore.db, neostore.propertystore.db and so on.
What are the companies use Neo4J?
- Facebook
- Blockchain (Bitcoin)
- Github
- EdgeTheory
- eBay (logistics and routing)
- Walmart (real-time ecommerce recommendations)
- adidas (real-time content recommendations)
- Pitney Bowes (master data management)
- Telenor (identity and access management)
- the ICIJ (data analysis for investigative journalism)
- Schleich (supply chain management)
- Cisco (graph-based search
List out Neo4j CQL commands?
- CREATE
- MERGE
- SET
- RETURN
- START
- LOAD CSV
- REMOVE
- CREATE UNIQUE
- UNWIND
- UNION
- CALL
What are the indexing capabilities of Neo4j?
Neo4j as a graph database features indexing as the preferred way to find start points for graph traversals. Over the years multiple different indexing approach have been added. The goal of this article is to give an overview on this to avoid confusion esp. for those who just recently got started with Neo4j.A graph database using a property graph model stores its data in nodes, relationships and properties.
In Neo4j 2.0 this model was amended with labels.Neo4J supports no indexes in the beginning later it started support for manual, automatic and schema indexes.