Neo4j Graph Database MongoDB Associate DBA Practice Exam, Exams of Technology

This DBA-focused exam covers MongoDB installation, replica set configuration, indexing strategies, sharding operations, security setup, backup/restore tasks, and performance tuning. Candidates are evaluated on diagnosing bottlenecks, setting cluster parameters, adapting workloads to distributed environments, and applying database governance best practices. The exam also touches on compatibility and integration considerations between MongoDB and Neo4j systems.

Typology: Exams

2025/2026

Available from 01/06/2026

shilpi-jain-1
shilpi-jain-1 🇮🇳

4.2

(5)

29K documents

1 / 90

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Neo4j Graph Database MongoDB Associate DBA
Practice Exam
**Question 1.** In the Neo4j property graph model, which element stores the relationship
type?
A) Node label
B) Relationship property
C) Relationship type
D) Node property
Answer: C
Explanation: The relationship type (e.g., `FRIENDS_WITH`) is stored on the relationship itself and
defines the semantics of the connection.
**Question 2.** Which Neo4j feature allows traversal from a node to its adjacent nodes
without an index lookup?
A) IndexFree Adjacency
B) Schema Indexes
C) Fulltext Search
D) BTree Indexing
Answer: A
Explanation: IndexFree adjacency means each node directly references its neighboring nodes,
enabling constanttime traversals.
**Question 3.** In Cypher, which clause is used to ensure a pattern exists or is created if it does
not?
A) CREATE
B) MERGE
C) MATCH
D) OPTIONAL MATCH
Answer: B
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a

Partial preview of the text

Download Neo4j Graph Database MongoDB Associate DBA Practice Exam and more Exams Technology in PDF only on Docsity!

Practice Exam

Question 1. In the Neo4j property graph model, which element stores the relationship type? A) Node label B) Relationship property C) Relationship type D) Node property Answer: C Explanation: The relationship type (e.g., FRIENDS_WITH) is stored on the relationship itself and defines the semantics of the connection. Question 2. Which Neo4j feature allows traversal from a node to its adjacent nodes without an index lookup? A) Index‑Free Adjacency B) Schema Indexes C) Full‑text Search D) B‑Tree Indexing Answer: A Explanation: Index‑Free adjacency means each node directly references its neighboring nodes, enabling constant‑time traversals. Question 3. In Cypher, which clause is used to ensure a pattern exists or is created if it does not? A) CREATE B) MERGE C) MATCH D) OPTIONAL MATCH Answer: B

Practice Exam

Explanation: MERGE matches a pattern and creates it when it does not exist, providing idempotent behavior. Question 4. Which Cypher keyword removes a property from a node or relationship? A) DELETE B) DETACH DELETE C) REMOVE D) DROP Answer: C Explanation: REMOVE n.prop deletes the specified property while leaving the node or relationship intact. Question 5. What does the DETACH DELETE command do in Neo4j? A) Deletes a node only if it has no relationships B) Deletes a node and all its relationships atomically C) Deletes only relationships, leaving the node D) Detaches a node from a transaction Answer: B Explanation: DETACH DELETE removes the node and any connected relationships, avoiding constraint violations. Question 6. Which function would you use to collect all distinct values of a property into a list during aggregation? A) collect() B) distinct() C) list()

Practice Exam

B) It transforms a list into a stream of rows for further processing C) It merges duplicate rows D) It validates CSV schema Answer: B Explanation: UNWIND takes a list (e.g., from LOAD CSV) and yields each element as a separate row for subsequent CREATE or MERGE. Question 10. Which Cypher clause is used to control the number of rows returned after sorting? A) LIMIT B) SKIP C) ORDER BY D) BOTH A AND B Answer: D Explanation: ORDER BY defines sort order, SKIP offsets the result set, and LIMIT caps the number of rows returned. Question 11. When modeling many‑to‑many relationships in Neo4j, what is the recommended approach? A) Use a single node with an array property B) Create an intermediate node type (junction) and relate both sides to it C) Duplicate relationships for each pair D) Store the relationship IDs in a map property Answer: B Explanation: An intermediate node (e.g., :ENROLLMENT) models many‑to‑many cleanly, allowing additional properties on the relationship.

Practice Exam

Question 12. Which of the following is NOT a valid Cypher data type? A) String B) Integer C) Float D) Timestamp Answer: D Explanation: Neo4j supports temporal types like Date, Time, LocalDateTime, but not a generic Timestamp type. Question 13. In Neo4j, which command is used to view the execution plan without running the query? A) PROFILE B) EXPLAIN C) SHOW PLAN D) ANALYZE Answer: B Explanation: EXPLAIN returns the predicted execution plan, while PROFILE runs the query and shows actual metrics. Question 14. 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 in the database Answer: B Explanation: db.labels() lists every label that appears on nodes, useful for schema inspection.

Practice Exam

Explanation: Parameters ($name) are supplied by the driver at runtime, improving performance and preventing injection. Question 18. What is the effect of the SET n:Label1:Label2 clause? A) Replaces existing labels with Label1 and Label2 B) Adds Label1 and Label2 to the node while preserving existing labels C) Removes all labels and adds only Label1 and Label2 D) Creates a relationship between Label1 and Label2 Answer: B Explanation: SET with multiple labels adds them to the node; it does not delete pre‑existing labels. Question 19. Which Cypher function returns the length (number of relationships) of a path? A) size(p) B) length(p) C) count(p) D) distance(p) Answer: B Explanation: length(p) computes the number of relationships traversed in the path variable p. Question 20. In Neo4j, what does the apoc.export.csv.all procedure do? A) Imports CSV data into the graph B) Exports the entire database to a CSV file C) Generates a schema diagram in CSV format

Practice Exam

D) Performs a backup of the transaction log Answer: B Explanation: The APOC library’s apoc.export.csv.all writes all nodes and relationships to a CSV file for external use. Question 21. Which of the following statements about relationship direction in Neo4j is true? A) Direction is only a visual aid; queries ignore it. B) Direction matters for pattern matching unless an undirected pattern (-[]-) is used. C) Relationships must always be directed from lower‑ID to higher‑ID. D) Neo4j stores both directions automatically for every relationship. Answer: B Explanation: By default, Cypher respects relationship direction; using -[]- makes the pattern direction‑agnostic. Question 22. What does the CALL db.schema.visualization() procedure provide? A) A textual description of all indexes B) A JSON representation of the graph’s schema for visualization tools C) The number of nodes per label D) A list of all stored procedures Answer: B Explanation: This procedure returns a JSON graph describing node labels, relationship types, and property keys, useful for visual schema tools. Question 23. In Neo4j, which command is used to delete an index on a label’s property? A) DROP INDEX ON :Label(prop)

Practice Exam

A) GraphQL API B) Neo4j Bloom C) APOC json functions D) Full‑text schema indexes Answer: C Explanation: APOC provides functions like apoc.load.json to ingest JSON and apoc.convert.toJson to convert graph structures back to JSON. Question 27. Which of the following is a valid way to create a composite index on two properties in Neo4j? A) CREATE INDEX ON :Person(name, age) B) CREATE INDEX person_name_age IF NOT EXISTS FOR (p:Person) ON (p.name, p.age) C) CREATE COMPOSITE INDEX ON :Person(name, age) D) CREATE INDEX ON :Person(name) AND :Person(age) Answer: B Explanation: The modern syntax CREATE INDEX person_name_age IF NOT EXISTS FOR (p:Person) ON (p.name, p.age) creates a composite index on name and age. Question 28. In Neo4j, which clause would you use to rename a node label? A) RENAME LABEL B) SET n:NewLabel REMOVE n:OldLabel C) ALTER LABEL D) UPDATE LABEL Answer: B Explanation: Labels are manipulated with SET and REMOVE; to rename, you add the new label and remove the old one.

Practice Exam

Question 29. Which of the following statements about graph modeling vs. relational modeling is correct? A) Graph models require foreign keys to represent relationships. B) Graph models store relationships as first‑class entities, enabling direct traversal. C) Graph databases cannot enforce uniqueness constraints. D) Graph schemas must be defined before any data can be inserted. Answer: B Explanation: In property graphs, relationships are first‑class, stored directly on the graph, unlike foreign keys in relational tables. Question 30. What does the EXISTS function test in a Cypher WHERE clause? A) Whether a node or relationship exists in the database B) Whether a property key exists on a node or relationship C) Whether a path has a certain length D) Whether an index exists for a label Answer: B Explanation: exists(n.prop) returns true if the property prop is present on node n. Question 31. In Neo4j, which keyword is used to combine results from two separate MATCH clauses while preserving row independence? A) UNION B) WITH C) MERGE D) OPTIONAL MATCH Answer: B

Practice Exam

D) A failed transaction rolls back all its changes. Answer: C Explanation: Neo4j provides read‑committed isolation by default; there is no read‑uncommitted mode. Question 35. In Neo4j, which command creates a full‑text schema index? A) CREATE FULLTEXT INDEX idx FOR (n:Label) ON EACH [n.prop] B) CALL db.index.fulltext.createNodeIndex("idx",["Label"],["prop"]) C) CREATE INDEX ON :Label(prop) TYPE FULLTEXT D) CREATE FULLTEXT INDEX idx ON :Label(prop) Answer: B Explanation: The APOC/Neo4j built‑in procedure db.index.fulltext.createNodeIndex creates a full‑text index on node properties. Question 36. Which of the following is a primary benefit of using labels instead of generic node types? A) Labels enable automatic sharding of the graph. B) Labels allow selective indexing and constraint application per group. C) Labels guarantee that a node will have at most one relationship. D) Labels replace the need for properties entirely. Answer: B Explanation: Labels let you define indexes and constraints that apply only to nodes with that label, improving performance and data integrity. Question 37. When using LOAD CSV WITH HEADERS, which clause is required to treat each line as a map of column names? A) AS line

Practice Exam

B) FROM

C) WITH

D) UNWIND

Answer: A Explanation: LOAD CSV WITH HEADERS FROM 'url' AS line binds each row to a map where keys are column headers. Question 38. Which Neo4j tool is specifically designed for bulk importing large CSV files into a fresh database? A) neo4j-admin import B) neo4j-shell C) neo4j-import (deprecated) D) neo4j-backup Answer: A Explanation: neo4j-admin import efficiently loads massive CSV datasets during database creation, bypassing the transactional engine. Question 39. Which clause can be used to conditionally set a property only when it does not already exist? A) SET n.prop = coalesce(n.prop, value) B) ON CREATE SET n.prop = value (used with MERGE) C) SET IF NOT EXISTS n.prop = value D) Both A and B Answer: D Explanation: ON CREATE SET works with MERGE to set on creation only; coalesce can preserve an existing value.

Practice Exam

Explanation: type(r) yields the relationship type string (e.g., "FRIENDS"). Question 43. In Neo4j, which clause is used to limit the size of a traversal to avoid exponential blow‑up? A) LIMIT after MATCH B) WHERE length(p) < n C) USING BFS D) CALL apoc.path.expandConfig with maxLevel Answer: D Explanation: apoc.path.expandConfig allows setting maxLevel (depth) to cap traversal expansion. Question 44. Which of the following statements about Neo4j’s causal consistency model is true? A) Reads are always served from the primary node only. B) Causal consistency guarantees that a read sees all writes that happened-before the read in the same session. C) It provides eventual consistency across the cluster. D) It requires manual synchronization of transaction logs. Answer: B Explanation: Causal consistency ensures that a client’s subsequent reads reflect its prior writes, even when reading from followers. Question 45. Which Neo4j command can be used to list all active transactions? A) CALL db.transactions() B) SHOW TRANSACTIONS C) CALL dbms.listTransactions()

Practice Exam

D) SHOW ACTIVE TRANSACTIONS

Answer: C Explanation: CALL dbms.listTransactions() returns details about currently running transactions. Question 46. Which of the following is not a built‑in procedure in Neo4j’s standard library? A) db.labels() B) db.relationshipTypes() C) db.indexes() D) db.backup() Answer: D Explanation: Neo4j does not expose a db.backup() procedure; backups are performed via neo4j-admin backup or external tools. Question 47. In Cypher, which keyword is used to rename a variable within a query block? A) AS B) RENAME C) WITH (by re‑assigning) D) SET Answer: A Explanation: AS allows aliasing, e.g., RETURN n AS person. Question 48. Which of the following best describes the difference between MERGE and CREATE? A) MERGE only creates nodes, CREATE only matches existing ones.

Practice Exam

A) String B) Binary (BinData) C) ObjectId D) UUID Answer: B Explanation: The BSON type Binary (BinData) stores arbitrary binary data, including images and files. Question 52. Which command creates a sharded collection in MongoDB? A) sh.enableSharding("db") followed by sh.shardCollection("db.coll", {key: 1}) B) db.createCollection("coll", {sharded:true}) C) sh.addShard("replicaSet/host:port") D) db.coll.ensureSharding() Answer: A Explanation: First enable sharding for the database, then shard a specific collection with a shard key. Question 53. What is the default write concern for MongoDB when a client does not specify one? A) { w: 0 } (unacknowledged) B) { w: 1 } (acknowledged by primary) C) { w: "majority" } D) { w: 2 } Answer: B Explanation: By default, MongoDB acknowledges writes after they are written to the primary's memory.

Practice Exam

Question 54. Which of the following operators adds a new field to a document during an update? A) $set B) $push C) $inc D) $addToSet Answer: A Explanation: $set creates the field if it does not exist or overwrites it if it does. Question 55. In MongoDB, which command creates a unique index on the email field of the users collection? A) db.users.createIndex({email: 1}, {unique: true}) B) db.users.ensureIndex({email: 1}, {unique: true}) C) db.users.createUniqueIndex({email: 1}) D) Both A and B (deprecated vs. current) Answer: D Explanation: Both commands create a unique index; ensureIndex is older but still works, while createIndex is the recommended modern method. Question 56. Which aggregation pipeline stage filters documents based on a condition? A) $match B) $project C) $group D) $lookup