


























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



























































































Question 1. Which of the following best describes a graph database? A) Stores data in rows and columns B) Uses key‑value pairs for storage C) Represents data as nodes, relationships, and properties D) Stores data as hierarchical documents Answer: C Explanation: A graph database models data as a network of nodes (entities) connected by relationships, each of which can have properties. Question 2. In the Property Graph Model, which element is used to group similar nodes? A) Relationship type B) Property key C) Label D) Index Answer: C Explanation: Labels classify nodes (e.g., :Person, :Movie) allowing queries to target specific groups. Question 3. Which Neo4j component provides a visual interface for exploring the graph? A) Neo4j Aura B) Neo4j Desktop C) Neo4j Browser D) Neo4j Server
Answer: C Explanation: Neo4j Browser is the web‑based UI for visual query execution and graph exploration. Question 4. What is the primary advantage of using a graph database for recommendation engines? A) Faster joins across tables B) Ability to store large binary files C) Direct traversal of relationships without costly joins D) Automatic schema generation Answer: C Explanation: Recommendations often rely on multi‑hop relationship analysis, which graph databases perform efficiently via direct traversals. Question 5. Which Neo4j deployment model is fully managed in the cloud? A) Neo4j Desktop B) Neo4j Community Edition C) Neo4j Aura D) Neo4j Enterprise on‑prem Answer: C Explanation: Neo4j Aura is Neo4j’s fully managed cloud service, handling provisioning, backups, and scaling. Question 6. In Neo4j’s architecture, what does the “store” primarily contain?
Answer: C Explanation: Descriptive singular labels make queries readable and enable efficient index usage. Question 9. Which Cypher clause is used to filter results after a pattern match? A) MATCH B) RETURN C) WHERE D) CREATE Answer: C Explanation: WHERE applies predicates to restrict the rows returned by a MATCH. Question 10. What does the following query return? MATCH (p:Person) RETURN p.name AS name A) All node IDs of :Person nodes B) The name property of each :Person node, aliased as “name” C) The label of each node D) The count of :Person nodes Answer: B Explanation: The query matches :Person nodes, extracts the name property, and aliases it as name. Question 11. Which clause creates a new node with a label and a property in one statement? A) MERGE
Answer: B Explanation: CREATE can instantiate a node with a label and any number of properties directly. Question 12. How does the MERGE clause differ from CREATE? A) MERGE only updates existing nodes B) MERGE guarantees idempotent “find‑or‑create” behavior C) MERGE deletes matching nodes before creating new ones D) MERGE is used only for relationships Answer: B Explanation: MERGE attempts to match a pattern; if none exists, it creates it, ensuring no duplicates. Question 13. Which Cypher command removes a node and all its relationships in a single step? A) DELETE B) DETACH DELETE C) REMOVE D) DROP Answer: B Explanation: DETACH DELETE first removes all incident relationships, then deletes the node.
Answer: B Explanation: COLLECT aggregates values into a list, useful for returning grouped collections. Question 17. Which clause is used to limit the number of rows returned by a query? A) ORDER BY B) SKIP C) LIMIT D) FILTER Answer: C Explanation: LIMIT restricts the result set to a specified maximum number of rows. Question 18. How would you retrieve the shortest path between two nodes a and b? A) MATCH (a)-[r]->(b) RETURN r B) MATCH p=shortestPath((a)-[]-(b)) RETURN p C) MATCH (a)-[:CONNECTED*]-(b) RETURN a,b D) MATCH (a)-[r:PATH]->(b) RETURN r Answer: B Explanation: The shortestPath function finds the minimal‑hop path between the two nodes. Question 19. What is the effect of OPTIONAL MATCH compared to MATCH? A) It forces a query to fail if the pattern is not found B) It returns rows even when the optional pattern is missing, with nulls for missing parts
C) It creates the pattern if it does not exist D) It filters out rows that do not contain the pattern Answer: B Explanation: OPTIONAL MATCH behaves like a left outer join, preserving rows that lack the optional pattern. Question 20. Which built‑in function would you use to convert a string to uppercase? A) toUpper() B) upper() C) string.upper() D) UPPERCASE() Answer: B Explanation: The Cypher function upper() returns the uppercase version of a string. Question 21. How can you create a uniqueness constraint on the email property of :User nodes? A) CREATE CONSTRAINT ON (u:User) ASSERT u.email IS UNIQUE B) CREATE INDEX ON :User(email) UNIQUE C) CREATE UNIQUE INDEX ON :User(email) D) CREATE CONSTRAINT ON (u:User) ASSERT u.email UNIQUE Answer: A Explanation: The syntax CREATE CONSTRAINT ON (n:Label) ASSERT n.property IS UNIQUE enforces uniqueness.
D) Storing values in a temporary node Answer: B Explanation: Parameters prevent injection attacks and allow query planning reuse. Question 25. What is the primary purpose of the APOC library in Neo4j? A) Provide a graphical UI B) Offer a set of extended procedures and functions for advanced operations C) Replace the core Cypher engine D) Manage cluster configuration Answer: B Explanation: APOC (Awesome Procedures on Cypher) supplies many useful utilities such as data import, graph algorithms, and string handling. Question 26. Which clause is used to load CSV data directly in Cypher? A) IMPORT CSV B) READ CSV C) LOAD CSV D) FETCH CSV Answer: C Explanation: LOAD CSV reads rows from a CSV file and makes them available as variables. Question 27. When using LOAD CSV WITH HEADERS, how do you reference the column named “age”?
A) row[age] B) line.age C) line["age"] D) row.age Answer: C Explanation: With headers, each row is a map; column values are accessed via map syntax, e.g., line["age"]. Question 28. Which Neo4j driver protocol is used for client‑server communication? A) HTTP B) JDBC C) Bolt D) REST Answer: C Explanation: Bolt is Neo4j’s binary protocol optimized for high‑performance query execution. Question 29. In a Java application, which class is typically used to start a Neo4j session? A) GraphDatabaseFactory B) SessionFactory C) Driver D) Neo4jClient Answer: C
D) graph.conf Answer: A Explanation: neo4j.conf holds server ports, memory settings, authentication, and other options. Question 33. How can you switch the active database in a multi‑database Neo4j instance using Cypher? A) SWITCH DATABASE dbname B) USE dbname C) SELECT DATABASE dbname D) SET DATABASE = dbname Answer: B Explanation: The USE clause tells the query executor which database to run against. Question 34. Which Neo4j security model assigns permissions to roles, which are then granted to users? A) ACL (Access Control List) B) RBAC (Role‑Based Access Control) C) DAC (Discretionary Access Control) D) MAC (Mandatory Access Control) Answer: B Explanation: Neo4j implements RBAC, where roles define privileges and users inherit those via role assignment.
Question 35. In a Causal Cluster, which component is responsible for leader election? A) Core server B) Read replica C) Raft consensus algorithm D) Gossip protocol Answer: C Explanation: Neo4j uses the Raft consensus algorithm to elect a leader among core members. Question 36. Which of the following is NOT a valid index type in Neo4j 5? A) B‑Tree index B) Full‑text index C) Spatial index D) Hash index Answer: D Explanation: Neo4j does not provide a native hash index; supported types include B‑Tree, full‑text, and spatial. Question 37. What does the CALL db.labels() procedure return? A) All relationship types in the database B) All node labels defined in the schema C) All property keys used in the graph D) All indexes present
Answer: A Explanation: The AS keyword creates an alias for a returned expression. Question 41. What is the result of the following query? MATCH (a)-[r]->(b) RETURN type(r) LIMIT 1 A) The label of node a B) The relationship type name between a and b C) The property type of relationship r D) The count of relationships Answer: B Explanation: type(r) returns the relationship type (e.g., FRIEND_OF). Question 42. Which of the following statements about Neo4j’s “single‑node” and “multi‑node” indexes is true? A) Single‑node indexes can only be created on relationship properties B) Multi‑node indexes support full‑text search across multiple labels C) Single‑node indexes are automatically created for primary keys D) Multi‑node indexes are deprecated in Neo4j 5 Answer: B Explanation: Multi‑node (full‑text) indexes allow searching across many nodes and labels.
Question 43. How does Neo4j handle schema‑free data? A) It enforces a rigid schema at creation time B) It allows any node or relationship to have arbitrary properties without predefined schema C) It requires a JSON schema file before data insertion D) It stores all data as key‑value pairs only Answer: B Explanation: Neo4j is schema‑optional; nodes and relationships can have any properties, and schema (indexes/constraints) can be added later. Question 44. Which function would you use to split a string s on commas into a list? A) split(s, ",") B) split(",", s) C) list.split(s, ",") D) explode(s, ",") Answer: A Explanation: split(string, delimiter) returns a list of substrings. Question 45. When importing data with LOAD CSV, which option ensures that each line is parsed as a map using the header row? A) WITH HEADERS B) AS MAP C) READ HEADERS D) HEADER TRUE
Question 48. Which Neo4j feature enables automatic backup of a database without manual scripting? A) Periodic Snapshots in Aura B) Neo4j Export Tool C) Manual neo4j-admin dump command only D) GraphQL subscriptions Answer: A Explanation: Neo4j Aura provides automated, continuous backups as part of the managed service. Question 49. What does the apoc.export.csv.all procedure do? A) Imports CSV files into the graph B) Exports the entire database to a CSV file C) Converts CSV data into JSON D) Generates a schema diagram Answer: B Explanation: The APOC procedure apoc.export.csv.all writes all nodes and relationships to a CSV file. Question 50. Which of the following is a correct way to start a read‑only transaction in a Python driver session? A) session.begin_transaction(read_only=True) B) session.run("BEGIN READ ONLY") C) session.start_transaction(mode="READ")
D) session.begin_transaction(accessMode=READ) Answer: A Explanation: The Python driver’s begin_transaction method accepts read_only=True to create a read‑only transaction. Question 51. Which of the following statements about relationship direction in Cypher is true? A) Direction is ignored during pattern matching B) A relationship can be traversed in both directions without specifying direction C) The arrow (-> or <-) defines the traversal direction in a pattern D) Direction can only be set at node creation time Answer: C Explanation: The arrow in a pattern indicates the direction of traversal; omitting the arrow makes it undirected for the match. Question 52. Which clause would you use to order results alphabetically by the title property? A) SORT BY title B) ORDER BY title ASC C) GROUP BY title D) FILTER BY title Answer: B Explanation: ORDER BY sorts the result set; ASC is the default for ascending order.