Font size
Worksheetsneo4j
Total questions: 80
Worksheet time: 44mins
To restore a Neo4j instance from a backup, which of the following is accurate?
The Neo4j backups are fully functional databases. To use a backup, all you need to do replace your database folder with the backup. Just make sure the database isn't running while replacing the folder.
The Neo4j "backup-restore" command will copy the compressed backup archive files and logical logs to the existing instance database folder, replay the transactions, and bring the database back online.
Issuing a "restore" command with a timestamp will recover the Neo4j instance up to that particular point in time, before any transactions corrupted the database files
Shut down the current instance, replace the database folder with the backup, and then startup the Neo4j instance in recovery mode so the database is fully recovered.
Which statements regarding page cache are true:
The page cache uses off-heap memory.
The Java heap contains the page cache
If possible you should assign enough RAM to "dbms.pagecache.memory" to hold the full graph.
The page cache is implemented in C++ for maximum throughput.
The page cache has a minimal of overhead compared to the binary storage on disc.
The following Cypher statement may not return the list of all employees who work for Acme.
MATCH (a:Employee {id:5})-[:WORKS_FOR]->(b:Company {name:"Acme"}) RETURN a LIMIT 10
Select the statement(s) below that describe why the statement may not return the list of all employees who work for Acme.
We are returning only the variable a; to get the list of employee names we would have to return a.name.
The LIMIT 10 following the RETURN clause means we will only get 10 results and there may be more than 10 employees who work at Acme in the graph.
We are matching on a node with an Employee label and with an id property of value 5, which may refer only to a single employee.
The LIST keyword needs to be used in the RETURN statement to generate the list of all nodes.
Which statement best defines uniqueness constraints in Neo4j?
Neo4j does not support uniqueness constraints.
A rule in the database that ensures a property value is unique among all nodes.
A rule in the database that ensures a property value is unique for all nodes with a specific label.
A rule in the database that ensures a node or relationship is unique.
What's the default port for the Bolt server?
7687
7474
7473
5000
What information can we not find out by executing the dbms.listQueries() procedure?
Bytes allocated for the executing query
Planner used by the query
Username of the user who is executing the query.
IP address of the machine that is executing the query
When using a language driver, a statement results comprises a stream of...
nodes
rows
entries
records
Is ORDER BY a valid Cypher clause?
true
false
Which of the following best describes what the below Cypher statement will do?
MATCH (city:City {name: "San Mateo"})
MERGE (state:State {name: "California"})
MERGE (city)-[:LOCATED_IN]->(state)
RETURN city, state
If there is a City node with name "San Mateo", uniquely create a :LOCATED_IN relationship to a State node with name "California," creating the State node if it does not already exist.
The :LOCATED_IN relationship is only created if there is both a City node with name "San Mateo" and a State node with name "California."
The :LOCATED_IN relationship is overwritten only if there is both a City node with name "San Mateo" and a State node with name "California."
The :LOCATED_IN relationship is matched only if there is both a City node with name "San Mateo" and a State node with name "California."
Which algorithm does Neo4j use to achieve consensus commits?
Paxos
Raft
An in house algorithm
SWIM
Select the Cypher statements below that will find all of Jason's friends and set their verified property to true?
MATCH (a:Person {name:"Jason"})-[:FRIEND]-(b:Person)
WITH COLLECT(b) AS friends
FOREACH (n IN friends | SET n.verified = TRUE)
MATCH (a:Person)-[:FRIEND]->(b) UPDATE b
SET b.verified = TRUE
MATCH (a:Person)-[:FRIEND]->(b) WHERE a.name = "Jason" UPDATE b SET b.verified = TRUE
MATCH (a:Person {name:"Jason"})-[:FRIEND]-(b:Person) SET b.verified = TRUE
Of the following, which would be recommended approaches for tuning and potentially improving performance of Neo4j?
Optimizing the cache settings so more of the graph fits into memory.
Increasing the size of the performance global area to increase the number of hits in the cache.
Distributing reads across a cluster of Neo4j instances for higher concurrent access.
Increasing the parallel_servers configuration setting so queries can be broken down and worked on by multiple threads.
Referential integrity is maintained in Neo4j because you cannot delete a node that has existing relationships attached.
true
false
A single node can have a relationship that points at itself?
true
false
Which of the following statements best describes Cypher's MERGE clause?
MERGE is used to merge multiple nodes or relationships in the graph together to form a single node or relationship.
MERGE is used to return multiple nodes in a Cypher return statement
The MERGE clause ensures that a pattern exists in the graph. Either the pattern already exists, or it needs to be created.
MERGE can be used to join two graph databases together by de-duplicating nodes and relationships
MERGE is not a valid Cypher clause.
What, specifically, does the following expression do?: size( (n)-[:TYPE]->() ) ?
It counts the number of relationships with this type and direction?
This is not valid Cypher
It reads the degree-value for this relationship-type and direction directly from the node record.
It executes a MATCH first and then returns the size of the path - collection.
Property values can be the following:
- Numbers
- Strings
- boolean values
- byte[]
Nested Documants
List<String>
Arrays of string
How do you perform an aggregation in Cypher?
Using the GROUP BY keyword
Using at least one aggregation function.
Defining grouping keys with WITH
With the AGGREGATE keyword
Which procedure can be run to get a list of all procedures in the DBMS?
db.procedures()
dbms.showProcedures()
db.listProcedures()
dbms.procedures()
In a Neo4j database, which of the below best describes what Nodes are used for?
Used to represent entities and complex value types in the graph.
As a table structure that identifies like entities and groups them together.
As a reference holder for keys, which also store values, and foreign key links to other nodes.
As endpoints on either side of a relationship, used to bring together relationships in the graph.
When using a language driver, TLS encryption is enabled for all connections by default
true
false
What's the correct exception to throw to signal an error from within a procedure?
RuntimeException
ProcedureException
NotFoundException
TransientTransactionFailureException
Which of the following would be the correct Cypher syntax to create an index on the id property for nodes with the Customer label?
CREATE INDEX ON :Customer(id);
CREATE INDEX ON :Customer.id;
CREATE INDEX ON Customer(id);
CREATE GRAPH INDEX ON :Customer.id;
The Cypher PROFILE keyword can be used for what purpose?
Entered before the statement it is used to return the query plan and execution information for a Cypher statement for performance tuning purposes
Used when creating parameterized Cypher queries, it tells the query engine to build a query plan for later use
The PROFILE clause will detail the current statistics for the server, including node counts, relationship counts, and data size
PROFILE will identify the schema for the current database, including labels in use, relationship types, and indexes
In modeling, the use of Bi-directional relationships is a good practice when which of the following is true?
The semantics of the relationship in one direction is different from the other direction
When you want to show the same relationship between two nodes in each direction
When a relationship between two nodes could be represented in either direction
This is never a good idea
Labels are best described as:
Unique tags on each node for fast lookups
Special types of node or relationship properties
Tags that are used to group nodes into sets
Table names in the graph database
Which of the following statements best describes properties?
Properties are the key-value pairs on both nodes and relationships
Properties are the key-value pairs on nodes only
Properties are the key-value pairs on relationships only
None of the above
Which of the following best describes Cypher, Neo4j's graph query language?
It's a SQL plugin for Neo4j
It is a regular expression-like programming language for interfacing with Neo4j.
It is a declarative query language designed for graph pattern matching and traversals
It is a procedural programming language for interfacing with Neo4j
When using a language driver, transactions can be executed in which access modes?
ReadWriteOnce, ReadOnlyMany, or ReadWriteMany
Master or Slave
Read or Write
Serializable, Read committed, or Read uncommitted
Two nodes can only be connected by a single relationship?
false
true
Of the following, which are reasons why Labels are used?
Used to represent entities, such as users, products, or company
Used to group like nodes together
Used to represent tables in the database
Used to associate indexes and constraints with groups of nodes
Which log files should I inspect if Neo4j doesn't start up - on a production installation (not Neo4j Desktop).
logs/main.log
/var/log/neo4j.log
logs/neo4j.log
logs/debug.log
/dev/null
Which of the following best describes the OPTIONAL MATCH clause in Cypher?
OPTIONAL MATCH is not a Cypher clause
The OPTIONAL MATCH searches for a described pattern that may or may not exist, assigning NULL to any identifiers in the pattern that do not exist
The OPTIONAL MATCH clause will take a set of property values and optionally match them against all nodes in the database
OPTIONAL MATCH provides parameter placeholders for Cypher queries. It holds a parameterized query and then optionally matches it against the graph with the values supplied by the client
Neo4j can be deployed...
...as a standalone server.
...embedded in a Java application
...embedded in a Java application or as a standalone server
...with an app server only
None of the above
All nodes with the same label must have the same property keys.
true
false
When modeling with Neo4j, which of the following best represents inferring a symmetric relationship for the below simple graph:
(parent:Parent)-[:PARENT_OF]->(child:Child)
child is a CHILD_OF parent
parent is the CHILD_OF parent
child is the PARENT_OF parent
child HAS_SIBLINGS from parent
How does the Neo4j configuration property "keep_logical_logs" affect Neo4j backup?
This property defines how long to keep the log files with transaction history. When running a backup, if the time since you've last run a backup is longer than the time specified in this configuration setting, Neo4j will be unable to incrementally apply all historical transactions and instead will do a full backup
This configuration property identifies the number of logs to keep to recover a backup into a fully functioning instance
This configuration will define whether logical or physical logs will be stored by Neo4j, which will determine whether a backup can copy data from memory or from the disk
This configuration identifies how many logs Neo4j should keep in memory for quick, incremental backups every hour
What prefix should be used in the connection URI when connecting an application to a Neo4j causal cluster?
bolt
bolt+cluster
bolt+routing
bolt+casualcluster
In the following MATCH clause, which of the elements represents the relationship between two nodes?
MATCH (a)-[b]->(c)
(a)
(a)-
-[b]->
->(c)
what is the main responsibility of read replicas in a causal cluster?
Scaling writes
Taking part in the Raft election algorithm
Scaling out graph workloads
Replicating data around the cluster
You can create the same type of relationship between two nodes with each relationship having different properties?
true
false
Which of the following actions is a user with the native role 'architect' able to do?
Change own password
Assign/remove role to/from user
Create/drop index/constraint
View all queries
View all roles for a user
Which of the following best describes the Causal Clustering causal_clustering.refuse_to_be_leader configuration setting in the neo4j.conf file?
Defines whether this instance should not put itself forward for election
Identifies whether the instance can be written to or not
Determines whether all instances in the cluster will be writable or not
Configures a standalone Neo4j instance to be read only
Which export formats does the Neo4j Browser support?
PNG
CSV
XML
XLS
GRAPHML
SVG
Neo4j is an ACID-compliant database.
TRUE
FALSE
Which of the following best describes a Relationship in Neo4j?
A structure with a name and direction that describes the relationship between two nodes and provides structure and context to the graph.
The link between two types of nodes.
A link that indicates how one type of node is, or should be connected to another type of node.
A key/value pair that identifies additional nodes that a single node is related to, including direction and weight
Neo4j is available with both open-source and commercial licenses.
true
false
Which of the following best describes the Neo4j data model?
Nodes and properties.
Nodes, relationships, and properties.
Nodes, foreign keys, and relationships.
Rows, properties, and relationships.
Nodes and relationships.
Read replicas have transactions pushed down to them by core servers
true
false
On a Neo4j instance participating in a cluster, which of the following configuration settings is used to define the list of other known instances that cluster?
causal_clustering.initial_discovery_members
causal_clustering.host_list
causal_clustering.cluster_members
causal_clustering.cluster_instances
Which function allows you to create a list of values as result of an aggregation?
The collect() function.
The toList() function.
The aggregate() function.
The values() function.
Foreign keys are necessary in a graph database. These allow you to determine which nodes are related.
false
true
Which of the following Cypher statements will return the number of cities in the state of California?
MATCH (:State {name:"California"})<-[:LOCATED_IN]-(city:City) RETURN count(city)
MATCH (state:State)<-[:LOCATED_IN]-(city:City) WHERE state.name="California" RETURN count(city)
MATCH (state:State {name:"California"}) JOIN state, MATCH (city:City) RETURN count(city)
MATCH (city:City) FILTER relationships(LOCATED_IN) FILTER related(:STATE {name:"California"}) RETURN count(city)
Which of the following best describes the LIMIT clause in Cypher?
RETURN db.labels()
CALL db.labels()
RETURN CALL db.labels()
CALL db.labels() YIELD label RETURN label
Neo4j allows for undirected relationships between nodes.
true
false
Cypher has a collection of statistics functions that allow you to identify data points such as the maximum and minimum values, standard deviation, and percentiles.
true
false
What parts of a Cypher query can be parameterized?
Labels
Property values
Map values
Relationship types
Index query expressions for explicit indexes
Literals
Which of the following Cypher statements would return the total population in all cities located in California?
MATCH (:STATE {name:"California"})<-[:LOCATED_IN]-(city:CITY) RETURN sum(city.population)
MATCH (city:CITY) sum(city.population) as total WHERE (city)-[:LOCATED_IN]->(:STATE {name="California"}) RETURN total
SUM (:CITY.population) WHERE city.relationships(:SATE.name="California") RETURN
MATCH (state:STATE {name:"California"}) MATCH (city:CITY) JOIN state,city RETURN SUM(city.population)
Neo4j version 2.2 introduced basic authentication with the server, which when enabled requires a username and password to be supplied to query the server.
true
false
Which of the following are not native security roles in Neo4j?
admin
publisher
developer
architect
How do you define ";" as field terminator in LOAD CSV?
LOAD CSV FROM "url" AS row FIELDTERMINATOR ";"
LOAD CSV FROM "url" AS row TERMINATED BY ";"
LOAD CSV DELIMETER ";" FROM "url" AS row
LOAD CSV FROM "url" AS row WITH split(row, ";") as fields
Relationships are defined with regard to node instances, not classes of nodes.
true
false
What type of database is Neo4j?
Key-value store.
Document database.
Graph database.
Relational database.
Semantic database.
Which of the following best describes the CONNECT_BY clause in Cypher
The CONNECT_BY clause is used to join nodes when they are connected by varying relationship depths.
The CONNECT_BY clause is used when constructing a graph tree structure where you want to define the nodes that a leaf node is connected to.
The CONNECT_BY clause is used in Cypher to limit the pattern to only certain relationship types.
The CONNECT_BY clause is a constraint that ensures only certain relationships can connect two nodes with specific labels together.
CONNECT_BY is not a valid Cypher clause.
Which of the following best describes the LIMIT clause in Cypher?
LIMIT is used to limit the number rows returned from the query or passed to other parts of a query.
LIMIT is used within the WHERE clause to limit the number of relationships traversed during a query.
The LIMIT clause is used when creating nodes to limit the number of relationships between two nodes.
The LIMIT clause is used with a RETURN clause to limit the types of values returned from node properties.
An Unmanaged Extension is best described by which of the following?
Unmanaged Extensions provide finer grained control over your application's interactions with Neo4j than Cypher by allowing you to write server-side code using Neo4j's Java API's and access the extension through REST calls.
Unmanaged Extensions are references to the HTTP REST API's that currently do not require authentication for reading or writing data to the graph.
Unmanaged Extensions are custom application services that bypass Neo4j's Cypher interface and directly interact with data stored on disk.
Unmanaged Extensions are custom Cypher extensions that provide end-user specific functional capabilities to Cypher.
Which of the following Cypher statements will return actors and the directors who directed their movies?
MATCH (actor)-[:ACTED_IN]->(movie)<-[:DIRECTED]-(director) RETURN actor, director
MATCH (actor)-[:ACTED_IN]->(movie) JOIN (movie)<-[:DIRECTED]-(director) RETURN actor, director
MATCH (actor)-[:ACTED_IN]-(movie) CONNECT (movie)-[d:DIRECTED]-(director) RETURN actor, director
MATCH (actor)-[a:ACTED_IN]->(movie)<-[b:DIRECTED]-(director) RETURN a, b
Which of the following best describes the options available for loading data into Neo4j?
Neo4j's neo4j-import tool, Cypher LOAD CSV clause, or batch operations against the REST endpoint.
Commercial ETL tools that can transform and load data in graph format.
Direct database connections from other database tools to load data in directly
The Cypher BULK LOAD clause to import data from an existing text file
The four building blocks of a Neo4j Graph Database are:
Nodes
Relationships
Properties
Labels
true
false
In Neo4j modeling, a timeline tree is a recommended approach for representing time and connecting discrete events with no natural relationship to other events where you need to find events by granularity of time.
true
false
Neo4j requires which of the following?
Java runtime environment
Microsoft .NET environment
A J2EE container server
A SAN storage system
None of the above
Which keyword in the RETURN clause will return only one instance of each item in a result set?
UNIQUE
DISTINCT
SINGLE
FIRST
Which of the following schema objects does Neo4j include?
Tables
Columns
Materialized views
none of above
Two nodes representing the same kind of thing, such as a person, can be connected to other nodes using different relationship types.
true
false
Given this Cypher statement, select the answer that best describes what data is returned from the query?
MATCH (person:Person) WHERE person.id = 526321 RETURN KEYS(person)
A collection of the property keys stored on the node with the Person label and an id property with a value of 526321
The internal key reference pointer for the node with the Person label and an id property with a value of 526321
The index keys stored for the node with the Person label and an id property with a value of 526321
The key pointers for relationships connected to the node with the Person label and an id property with a value of 526321
What are the benefits of parameterized Cypher?
The query plan from previous invocations is reused, therefore it's much more performant
Provides protection against code injection
Automatic query parallelization in a cluster
There are no benefits. Constructing statements with literal values is as good
Parameters are only available in SQL, Cypher doesn't support it
Neo4j uses the Property graph model. Which of the following best describes a property graph?
Nodes and relationships define the graph while properties add context by storing relevant information in the nodes and relationships
Property graph defines a graph meta-structure that acts as a model or schema for the data as it is entered
The Property graph is a model similar to RDF which describes how Neo4j stores resources in the database
The Property graph allows for configuration properties to define schema and structure of the graph
Select the Cypher statements below that will delete a node with an id of 3563 and all of its possibly connected relationships?
MATCH (a:Thing {id:3563}) OPTIONAL MATCH (a)-[r]-() DELETE a, r
MATCH (a:Thing {id:3563}) DELETE a
MATCH (a:Thing {id:3563}) DETACH DELETE a
MATCH (a:Thing {id:3563})-[r]-(b) DELETE a, r
In modeling, the concept of an intermediate node is used in what situation?
To connect more than two nodes in a single context, such as where a person worked and in what role during what timeframe
As a sub-node to represent complex entities as multiple nodes
In support of linked lists to identify next relationships
Before or after Primary nodes for quick traversals through the graph
Which of the following best describes a Neo4j incremental backup?
A snapshot of the transaction log from the last backup point is copied to the backup location so it can be replayed during a restore.
An incremental backup is performed whenever an existing backup directory is specified. The backup tool will then copy any new transactions from the Neo4j server and apply them to the backup. The result will be an updated backup that is consistent with the current server state.
An incremental backup is a scheduled backup process in Neo4j that copies transactions from the database to a backup location for future recovery purposes
Neo4j does not have an incremental backup capability
