October 01, 2019

#Neo4j Part 1: Interview Questions & Answers

What is Neo4j?
Neo4j is an open source NOSQL graph database, implemented in Java. It saves data structured in graphs rather than in tables.

What is the difference between Neo4j graph database and MySQL?
  • Neo4j 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 Neo4j, where as relational databases, such as MySQL, it’s difficult to store them.
  • Neo4j has the capability for deep search into the database without affecting the performance along with efficient timing. Relational Database 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. Relational Database lacks relationship and difficult to use them for connected graphs and data.
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.

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.

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.

Which query language does Neo4j use and what is consist of? What is CQL? How to execute CQL commands in Neo4J?
Neo4j uses Cypher query language (CQL), which is unique to Neo4j. The "$" prompt is used to execute all CQL commands in 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

START n MATCH n-[r]- m RETURN r;

Explain the role of building blocks like Nodes, Relationships, Properties and Labels in Neo4j?
  • Nodes are entities.
  • Relationship connects entities and structure domain.
  • Properties consists of meta-data and attributes.
  • Labels is the group nodes by role.
What are the different types of object caches in Neo4j?
There are two different types of object caches in Neo4j
  • Reference Caches: With this cache, Neo4j will use as much as allocated JVM heap memory as it can hold nodes and relationships.
  • 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.
Explain how Neo4j can be helpful in detecting Brute Force Attack?
A brute force attack, also known as an exhaustive search, is a cryptographic hack that relies on guessing possible combinations of a targeted password until the correct password is discovered.

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
  • Client real IP address and not the proxy one
  • Login failure or attempt success information
  • Timestamp
-K Himaanshu Shuklaa..

No comments:

Post a Comment