Q. Explain what is Neo4j?
Neo4j is an open source NOSQL graph database, implemented in Java. It saves data structured in graphs rather than in tables.
Q. For what Neo4j is widely used for?
Neo4j is widely used for
1. Highly connected data – Social Network
2. Recommendation- ( e-coomerce)
3. Path Finding
4. Data First Schema (bottom-up)
5. Schema Evolution
6. A* (Least Cost Path)
Q. Mention what is the difference between Neo4j graph database and MySQL?
|It consists of vertices and edges. Each vertex or node represent a key value or attribute.||In relational databases, attributes are appended in plain table format.|
|It is possible to store dynamic content like images, videos, audio.||In relational databases, such as MySQL, it's difficult to store videos, audios, images.|
|It has the capability for deep search into the database without affecting the performance along with efficient timing.||It takes longer time for database search and also inconvenient compared to neo4j.|
|We can relate any two objects in neo4j by the mean of making relationship between any two nodes.||It lacks relationship and difficult to use them for connected graphs and data.|
Q. Mention some of the important characteristics of neo4j?
Some important characteristics of neo4j includes
1. Materializing of relationship at creation time, resulting in no penalties for runtime queries
2. 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
3. Relationship in Neo4j is fast and make it possible to materialize and use new relationships later on to “shortcut” and speed up the domain data when new requirement arise
4. It can do memory caching for graphs and provides compact storage, resulting in efficient scale-up
5. It is written on the top of JVM
Q. Explain the role of building blocks like Nodes, Relationships, Properties and Labels in Neo4j?
The role of building blocks
1. Nodes: They are entities
2. Relationship: It connects entities and structure domain
3. Properties: It consists of meta-data and attributes
4. Labels: It group nodes by role
Q. Explain how you can run CQL commands in Neo4j?
You use “$” prompt to run all CQL commands in Neo4j.
Q. Mention what are the different types of object caches in Neo4j?
There are two different types of object caches in Neo4j
1. Reference Caches: With this cache, Neo4j will use as much as allocated JVM heap memory as it can hold nodes and relationships
2. High-performance Caches: It get 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
Q.Mention which query language does Neo4j use and what is consist of?
Neo4j uses Cypher query language, which is unique to Neo4j. Traversing the graph requires 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 consists of
1. START n
2. MATCH n-[r]- m
3. RETURN r;
Q.Is it possible that with Neo4j you can query it 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.
Q.Explain how you can create/delete databases in Neo4j?
To delete/remove entire graph directory you can use command rm –rf data/* as such Neo4j is not storing anything outside that.
Q.Explain how Neo4j can be helpful in detecting Brute Force Attack?
Neo4J allows to store and retrieve multiple complex relations. The capability of Neo4j to do complex query in real time is really helpful in identifying a brute force attack much quicker. The most crucial thing in detecting such attacks is to capture enough information about each requests like
1. Client real IP address and not the proxy one
2. Login failure or attempt success information
Q.Mention how indexing is done in Neo4j?
There was no indexing in earlier days for Neo4j, but later on it was introduced with new feature Automatic Indexes by using the command
START n=node:node_auto_index(name=‘abc’) RETURN n
Q.Mention 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.
Q.Mention what Neo4j CQL command is used for?
Neo4j CQL command can be used for
1. To create nodes with and without properties
2. To create a relationship between nodes with properties
3. To create a relationship between nodes without properties
4. To make multiple or single labels to a Node or a Relationship
Q.Explain what Neo4j CQL MATCH command is used for?
The CQL MATCH command in NEO4j is used for
1. To get data about properties and nodes from the database
2. To get data about relationship, nodes and properties from the database
Q.Explain what is the MATCH command syntax and what is the rule for using it?
The syntax for MATCH command is
The rule for using MATCH command is that you cannot use this command alone to fetch data from the database otherwise it will show invalid syntax error.
Q.Explain what does the SET clause is used for in Neo4j?
Neo4j CQL use SET clause for the following purpose
1. Update or Add properties values
2. Add new properties to existing Relationship or Node
Q.Explain what Neo4j CQL LIMIT clause is used for?
Neo4j CQL LIMIT clause is used for limit or filter the number of rows return by a query.
Q.Mention the IN Operator syntax in Neo4i?
The IN Operator syntax in NEO4j would be something like this
Q.Explain how Neo4j stores primitive array?
Neo4j stores primitive array in a compressed way in order to save the space on disk, to do that it uses a “bit saving” algorithm.
Get Updates on Tech posts, Interview & Certification questions and training schedules