First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Algorithms
In Neo4j Graph Data Science, which procedure is used to run the Label Propagation community detection algorithm on a projected graph named 'myGraph'?
- gds.louvain.stream
- gds.triangleCount.stream
- gds.labelPropagation.stream Correct answer.
- gds.wcc.stream
Explanation
Label Propagation is exposed through the gds.labelPropagation namespace, and the stream mode returns one row per node with its assigned communityId. The other algorithms belong to different namespaces and detect communities or counts by different methods.
Question 2Algorithms
Which GDS graph projection mode creates an in-memory graph that can be used by multiple concurrent algorithm executions?
- cypher projection
- named projection Correct answer.
- native projection
- anonymous projection
Explanation
A named projection persists in the graph catalog under a given name, so several algorithm runs and modes can reference it until it is dropped. Anonymous projections are tied to a single query and cannot be reused by later executions.
Question 3Algorithms
Which GDS centrality algorithm measures how many shortest paths between other node pairs pass through a given node?
- Betweenness Centrality Correct answer.
- Closeness Centrality
- Degree Centrality
- PageRank
Explanation
Betweenness Centrality scores a node by the fraction of shortest paths between all other node pairs that traverse it, which identifies brokers in a network. Degree Centrality counts direct connections, Closeness measures average distance, and PageRank uses random-walk influence.
Question 4Algorithms
A practitioner wants to detect tightly knit communities by optimizing modularity in Neo4j GDS. Which algorithm is the most appropriate choice?
- Node Similarity
- Louvain Correct answer.
- Strongly Connected Components
- Dijkstra Source-Target
Explanation
Louvain is a hierarchical modularity-optimizing community detection algorithm available as gds.louvain. The other options solve connectivity, pathfinding, or similarity problems rather than modularity-based clustering.
Question 5Algorithms
Which GDS procedure estimates the memory required before running an algorithm on a named projected graph?
- gds.graph.list
- gds.alpha.ml.oneHotEncoding
- gds.graph.project
- gds.algorithmName.estimate Correct answer.
Explanation
Most GDS algorithms provide an estimate mode (for example, gds.pageRank.estimate) that reports required memory without executing the computation. This lets practitioners validate capacity before committing to a long-running job.
Question 6Algorithms
Which algorithm should be used to find the shortest weighted path between a single source node and a single target node in a projected graph?
- Dijkstra Source-Target Correct answer.
- Minimum Spanning Tree
- Breadth First Search
- Apriori
Explanation
Dijkstra Source-Target computes the least-cost path between a specified source and target using relationship weights. Breadth First Search ignores weights, Minimum Spanning Tree builds a tree over the whole graph, and Apriori is a frequent-itemset algorithm.
Question 7Algorithms
Which mode of a GDS algorithm writes computed results back to the Neo4j database as node properties or relationships?
- stats
- mutate
- stream
- write Correct answer.
Explanation
The write mode persists algorithm output to the stored graph, such as setting a community property or creating SIMILAR relationships. The stream, stats, and mutate modes keep results in memory or return them without persisting.
Question 8Algorithms
Which GDS algorithm is designed to compute similarity between nodes based on the overlap of their neighbor sets?
- FastRP
- Node Similarity Correct answer.
- K-Nearest Neighbors
- HashGNN
Explanation
Node Similarity compares node neighborhoods using Jaccard or overlap metrics to produce similarity scores. FastRP and HashGNN generate embeddings, and K-Nearest Neighbors operates on existing node property vectors.
Question 9Algorithms
A data scientist runs gds.pageRank.mutate on a named graph and then wants to use the resulting scores as relationship weights in a subsequent algorithm. Which mode behavior makes this possible?
- Stats mode returns aggregate statistics that can be applied manually.
- Stream mode returns scores to the client for external processing.
- Write mode persists scores so a new projection can include them.
- Mutate mode stores scores in the in-memory graph for reuse without writing to the database. Correct answer.
Explanation
Mutate mode adds algorithm output to the in-memory graph, so later executions on the same named graph can reference the mutated property as a weight. This avoids a round trip to the stored database.
Question 10Algorithms
When projecting a graph for a weighted shortest-path algorithm, what does the 'relationshipWeightProperty' configuration control?
- It converts relationship types into node labels.
- It assigns a default weight of one to every relationship.
- It filters out relationships that lack the specified property.
- It names the relationship property whose values are used as edge weights. Correct answer.
Explanation
relationshipWeightProperty tells the projection which relationship property holds the numeric cost used by weighted algorithms such as Dijkstra. Without it, algorithms treat each relationship as having equal cost.
Question 11Algorithms
Which statement accurately describes the difference between the 'stats' and 'stream' modes of GDS algorithms?
- Both return summary statistics, but stream also writes properties.
- Stats returns per-node results while stream returns only aggregates.
- Both return per-node rows, but stats persists them to the database.
- Stream returns per-node rows while stats returns only summary statistics. Correct answer.
Explanation
Stream mode yields one result row per node or relationship, whereas stats mode computes the algorithm and returns only summary metrics such as node counts and runtime. Neither mode persists results to the stored graph.
Question 12Algorithms
A projection is created with undirected orientation and then used with PageRank. What effect does undirected orientation have on the algorithm's input?
- Relationships are ignored unless they have a weight property.
- Relationships are collapsed into self-loops on each node.
- Each stored relationship is treated as two directed edges, one in each direction. Correct answer.
- Each stored relationship is treated as a single directed edge in its original direction.
Explanation
Undirected orientation in a GDS projection makes each relationship traversable in both directions, effectively creating reciprocal directed edges. PageRank then propagates influence along both directions, which changes scores compared with natural orientation.
Question 13Algorithms
Which configuration parameter in a GDS algorithm limits the number of iterations to prevent excessive runtime?
- tolerance
- concurrency
- maxIterations Correct answer.
- relationshipWeightProperty
Explanation
maxIterations caps how many iterations an iterative algorithm such as PageRank or Label Propagation performs. Concurrency controls parallelism, tolerance sets a convergence threshold, and relationshipWeightProperty configures edge weights.
Question 14Algorithms
A practitioner wants to compute Weakly Connected Components on a projection that includes both FOLLOWS and LIKES relationships. Which projection approach is appropriate?
- Use a Cypher projection that selects both relationship types as the relationship query. Correct answer.
- Project only one relationship type at a time and union the results manually.
- Use the 'undirected' orientation only, which automatically includes all relationship types.
- Convert both relationship types into node labels before projecting.
Explanation
A Cypher projection can specify a relationship query matching multiple types, such as MATCH (a)-[r:FOLLOWS|LIKES]->(b), so both are included in the in-memory graph. Native projection also supports listing multiple types, but orientation alone does not add types.
Question 15Algorithms
Which algorithm would best identify influential nodes in a directed citation network where importance flows along citation edges?
- PageRank Correct answer.
- Triangle Count
- Euclidean Similarity
- Louvain
Explanation
PageRank models influence that propagates along directed relationships and is well suited to citation or link networks. Triangle Count, Louvain, and similarity algorithms answer different structural questions.
Question 16Algorithms
What does the 'dampingFactor' parameter control in the GDS PageRank algorithm?
- The maximum number of iterations allowed before stopping.
- The weight applied to relationships that lack a weight property.
- The probability that a random walker follows an outgoing relationship rather than jumping to a random node. Correct answer.
- The minimum score a node must reach to be included in results.
Explanation
The damping factor represents the probability of continuing along an edge versus teleporting to a random node, typically set near 0.85. It shapes how much influence distant nodes contribute to a node's score.
Question 17Algorithms
In Label Propagation, what does the 'nodeWeightProperty' configuration allow?
- It controls how many labels a node may retain after convergence.
- It weights each node's vote during label propagation. Correct answer.
- It determines the initial label assigned to each node.
- It sets the weight of every relationship in the projection.
Explanation
nodeWeightProperty lets nodes contribute with different influence when propagating labels, so higher-weighted nodes sway their neighbors more. Relationship weights are configured separately during projection.
Question 18Algorithms
A graph has 10 million nodes and the practitioner runs gds.betweenness.stream without sampling. What is the primary performance concern?
- Memory usage is negligible because betweenness stores no per-node state.
- Stream mode cannot return more than 10,000 rows.
- The algorithm requires exact all-pairs shortest paths, which is computationally expensive on large graphs. Correct answer.
- Betweenness requires a weight property and will fail without one.
Explanation
Exact Betweenness Centrality computes shortest-path contributions from every node, which scales poorly on large graphs. GDS offers a sampling parameter to approximate scores and reduce runtime.
Question 19Algorithms
Which GDS procedure removes a named projected graph from the graph catalog and frees its memory?
- gds.graph.delete
- gds.graph.remove
- gds.graph.clear
- gds.graph.drop Correct answer.
Explanation
gds.graph.drop removes the named projection from the catalog and releases the associated memory. The other procedure names do not exist in the GDS graph catalog API.
Question 20Algorithms
A team wants to use the results of FastRP embeddings as node features for downstream similarity search inside GDS. Which execution mode should they choose to avoid persisting embeddings to the database while still enabling a follow-up algorithm on the same named graph?
- stream
- write
- mutate Correct answer.
- stats
Explanation
Mutate mode stores the embeddings as node properties in the in-memory graph, allowing subsequent algorithms such as K-Nearest Neighbors to consume them without writing to the database. Stream would require external handling and write would persist to storage.
Question 21Algorithms
A practitioner configures Label Propagation with 'consecutiveIds: true' after observing that community IDs are non-contiguous. What is the trade-off of this setting?
- It disables convergence detection and always runs maxIterations.
- It requires a relationship weight property to be present.
- It increases memory usage because an additional mapping structure is maintained. Correct answer.
- It reduces accuracy because labels are renumbered arbitrarily.
Explanation
consecutiveIds renumbers community identifiers into a contiguous range, which simplifies downstream processing but adds memory overhead for the mapping. It does not alter the detected communities themselves, only their identifiers.
Question 22Algorithms
When running Node Similarity with the 'topK' parameter set to 10, how are results affected?
- Each node's similarity vector is truncated to 10 dimensions.
- The algorithm considers only the 10 most common relationship types.
- Only the 10 globally highest similarity pairs are returned.
- Each node reports similarity to its 10 most similar neighbors. Correct answer.
Explanation
topK limits output per node to its K highest-scoring similar neighbors, which controls result volume and runtime. It is a per-node cutoff rather than a global pair limit or dimensionality reduction.
Question 23Algorithms
A projection is created with a Cypher node query that returns duplicate node entries. What is the recommended behavior to avoid projection errors?
- The node query must return unique nodes, so duplicates should be eliminated with DISTINCT. Correct answer.
- GDS silently deduplicates all returned nodes.
- Duplicates are permitted only when the graph is undirected.
- Duplicates are allowed and create parallel node copies in the in-memory graph.
Explanation
Cypher projections require the node query to return each node once; adding DISTINCT to the query prevents duplicate-node errors. GDS does not automatically deduplicate arbitrary query output.
Question 24Algorithms
A team needs to find the highest-scoring path between a source and target where relationship weights represent travel time and some weights are negative. Which statement about GDS Dijkstra is accurate?
- Dijkstra automatically converts negative weights to their absolute values.
- Dijkstra rejects any weight property and always uses hop counts.
- Dijkstra assumes non-negative weights, so negative weights can produce incorrect results. Correct answer.
- Dijkstra supports negative weights as long as no cycle is present.
Explanation
Dijkstra's greedy shortest-path logic requires non-negative edge weights; negative weights violate its correctness assumptions. GDS does not sanitize negative weights, so results can be wrong rather than flagged.
Question 25Algorithms
A practitioner observes that Louvain produces different community assignments across runs on the same graph. Which explanation best accounts for this behavior?
- Louvain always returns a single community when the graph is undirected.
- Louvain is deterministic and differences indicate a corrupted projection.
- Louvain depends on PageRank scores that change every run.
- Louvain uses randomized node ordering, so results can vary between runs. Correct answer.
Explanation
Louvain's local moving phase processes nodes in a randomized order, which can lead to different modularity optima across runs. Setting a random seed or accepting variation is part of interpreting its output.
Question 26Algorithms
In the Neo4j Graph Data Science library, which algorithm category does Dijkstra's shortest path belong to?
- Community detection algorithms
- Path finding algorithms Correct answer.
- Node embedding algorithms
- Centrality algorithms
Explanation
Path finding algorithms compute routes between nodes, and Dijkstra is the canonical weighted single-source shortest path method in this category. Centrality ranks node importance, community detection partitions the graph, and node embedding produces vector representations.
Question 27Algorithms
Which GDS algorithm computes the total number of shortest paths that pass through each node, making it useful for identifying bridge nodes in a network?
- ArticleRank
- Degree Centrality
- Triangle Count
- Betweenness Centrality Correct answer.
Explanation
Betweenness Centrality counts how often a node lies on shortest paths between other node pairs, so high scores mark nodes that act as bridges or bottlenecks. Degree Centrality only counts incident relationships, Triangle Count measures local clustering, and ArticleRank is a PageRank variant for citation-like graphs.
Question 28Algorithms
A practitioner wants to detect densely connected groups in a social network and needs each node assigned to exactly one community. Which algorithm produces a single community membership per node?
- PageRank
- FastRP
- Node Similarity
- Louvain Correct answer.
Explanation
Louvain performs hierarchical modularity optimization and assigns each node to one community, which fits a hard partitioning requirement. Node Similarity produces pairwise similarity relationships, PageRank produces importance scores, and FastRP produces embedding vectors.
Question 29Algorithms
Which GDS algorithm computes the number of triangles each node participates in and can be used to estimate the global clustering coefficient of a graph?
- Strongly Connected Components
- Triangle Count Correct answer.
- Label Propagation
- K-Nearest Neighbors
Explanation
Triangle Count returns per-node triangle counts, and the GDS implementation can also report the global clustering coefficient and average clustering. The other algorithms address similarity, reachability, or community detection rather than triangle structure.
Question 30Algorithms
Which GDS algorithm is suited to computing the influence of nodes in a graph where importance propagates through random walks and is damped at each step?
- Breadth First Search
- Jaccard similarity
- Minimum Spanning Tree
- PageRank Correct answer.
Explanation
PageRank models a random walker that follows relationships with probability given by the damping factor and otherwise jumps randomly, so scores reflect propagated influence. Breadth First Search explores hop distance, Jaccard measures neighbor overlap, and Minimum Spanning Tree extracts a spanning subgraph.
Question 31Algorithms
Which GDS algorithm finds the connected components of a graph while ignoring relationship direction, so any two nodes linked by a path of any orientation end up in the same component?
- Weakly Connected Components Correct answer.
- Topological Sort
- Strongly Connected Components
- Louvain
Explanation
Weakly Connected Components treats relationships as undirected, so nodes joined by any path belong to one component. Strongly Connected Components requires mutual reachability along directed paths, which is a stricter condition.
Question 32Algorithms
Which GDS algorithm produces a spanning tree that connects all nodes in a projection while minimizing the total relationship weight?
- Yen's k-Shortest Paths
- Minimum Spanning Tree Correct answer.
- All Pairs Shortest Path
- A* Shortest Path
Explanation
Minimum Spanning Tree selects a subset of relationships that connects every node with the smallest possible sum of weights and no cycles. The other options compute paths between specific node pairs rather than a global spanning structure.
Question 33Algorithms
In GDS, which algorithm is used to compute node embeddings that can later feed a k-nearest-neighbors similarity pipeline?
- Dijkstra Source-Target
- FastRP Correct answer.
- Harmonic Centrality
- Maximum Flow
Explanation
FastRP is a fast random projection method that produces fixed-length embedding vectors per node, which are commonly consumed by KNN or similarity pipelines. The other options compute paths, flows, or centrality scores rather than embeddings.
Question 34Algorithms
A practitioner runs gds.labelPropagation.stream on a projection and wants each node labeled with its detected community. Which configuration parameter controls how many relationships a node must have before its label can change?
- nodeWeightProperty
- maxIterations Correct answer.
- concurrency
- relationshipWeightProperty
Explanation
maxIterations bounds how many label propagation rounds are executed, which directly limits how far labels can spread across the graph. The weight properties influence how votes are counted, and concurrency controls parallel execution rather than propagation depth.
Question 35Algorithms
A data scientist wants to compare node similarity using the overlap of neighbors normalized by the total number of distinct neighbors in either set. Which similarity metric does this describe in GDS Node Similarity?
- Pearson similarity
- Overlap similarity
- Cosine similarity
- Jaccard similarity Correct answer.
Explanation
Jaccard similarity divides the size of the intersection of two neighbor sets by the size of their union. Overlap divides by the smaller set size, Cosine uses vector dot products, and Pearson measures linear correlation of vectors.
Question 36Algorithms
When running gds.betweenness.stream on a large graph, which configuration parameter allows approximate scores by sampling a subset of source nodes?
- relationshipWeightProperty
- tolerance
- deltaThreshold
- samplingSize Correct answer.
Explanation
samplingSize limits how many source nodes are used as starting points for the Brandes-style traversal, producing an estimate rather than exact betweenness. tolerance and deltaThreshold are convergence controls used by other algorithms such as PageRank and Label Propagation.
Question 37Algorithms
Which GDS procedure is used to compute the closeness centrality of every node and return the results directly to the client without writing to the database?
- gds.closeness.stream Correct answer.
- gds.closeness.write
- gds.closeness.mutate
- gds.closeness.stats
Explanation
The stream mode returns computed values as a result stream to the calling client. Write mode persists properties, mutate mode stores values in the in-memory graph, and stats mode returns only summary statistics.
Question 38Algorithms
A practitioner needs to compute the number of relationships each node has in a projection and wants the result stored on the in-memory graph for a subsequent filtering step. Which execution mode fits this requirement?
- write
- stats
- mutate Correct answer.
- stream
Explanation
Mutate mode stores algorithm output on the in-memory projected graph so later algorithm configurations can reference it without a database round trip. Write mode persists to the database, stream returns rows to the client, and stats returns only summary metrics.
Question 39Algorithms
A team wants to project a graph where node properties are carried into the in-memory graph so that an algorithm can reference them. Which projection option accomplishes this?
- relationshipWeightProperty
- undirectedRelationshipTypes
- nodeProperties Correct answer.
- aggregation
Explanation
The nodeProperties map in a graph projection specifies which node properties are loaded into the in-memory graph and under what names. relationshipWeightProperty concerns relationship weights, undirectedRelationshipTypes changes orientation, and aggregation controls parallel relationship handling.
Question 40Algorithms
A practitioner runs gds.nodeSimilarity.write with a similarityCutoff of 0.5 and topK of 5. What is the effect of combining these two parameters?
- Each node keeps its five highest-scoring neighbors regardless of score
- Each node keeps at most five neighbors scoring above 0.5 Correct answer.
- Each node keeps all neighbors scoring above 0.5 regardless of count
- Each node keeps only neighbors whose score is exactly 0.5
Explanation
topK caps the number of similar neighbors retained per node, and similarityCutoff removes any pair whose score falls below the threshold, so both constraints apply together. The retained set is therefore the top five neighbors that also exceed 0.5.
Question 41Algorithms
A practitioner needs to find the shortest path between two specific nodes in a weighted graph and expects to run the query many times with different source and target pairs. Which GDS algorithm is designed for this pattern?
- All Pairs Shortest Path
- Strongly Connected Components
- Label Propagation
- Dijkstra Source-Target Shortest Path Correct answer.
Explanation
Dijkstra Source-Target computes a single weighted shortest path between a specified source and target, which matches repeated pairwise queries. All Pairs Shortest Path computes a much larger distance matrix and is better suited to global analysis.
Question 42Algorithms
A practitioner wants to find several distinct routes between a source and target, ranked by total weight, rather than only the single best route. Which GDS algorithm supports this?
- Dijkstra Source-Target
- Yen's k-Shortest Paths Correct answer.
- Breadth First Search
- A* Shortest Path
Explanation
Yen's algorithm enumerates k loopless shortest paths between a source and target, ranked by cost. Dijkstra and A* return a single best path, and Breadth First Search explores by hop count without weighted ranking.
Question 43Algorithms
A team runs gds.louvain.mutate and then wants to inspect the modularity score achieved by the detected communities. Which output field of the mutate result provides this?
- modularity Correct answer.
- communityCount
- nodePropertiesWritten
- ranLevels
Explanation
The mutate summary includes a modularity field reporting the quality of the detected partition. communityCount reports how many communities exist, ranLevels reports hierarchy levels processed, and nodePropertiesWritten applies to write mode.
Question 44Algorithms
Which GDS algorithm should be used to determine whether every node in a directed graph can reach every other node within its component, requiring mutual reachability?
- Degree Centrality
- Strongly Connected Components Correct answer.
- Triangle Count
- Weakly Connected Components
Explanation
Strongly Connected Components requires directed paths in both directions between every pair of nodes in a component, which matches mutual reachability. Weakly Connected Components ignores direction and would group nodes that cannot reach each other.
Question 45Algorithms
A practitioner observes that a maximum flow computation returns a value lower than the sum of capacities leaving the source. Which explanation is most consistent with the algorithm's behavior?
- The algorithm ignores relationship capacities
- Flow values are always rounded down to integers
- A cut elsewhere in the network constrains the achievable flow Correct answer.
- The source node was projected with no properties
Explanation
Maximum flow is limited by the minimum cut separating source from sink, so capacities leaving the source do not by themselves determine the result. A bottleneck downstream can cap the total flow below the source's outgoing capacity.
Question 46Algorithms
A practitioner wants to measure how central a node is by summing the reciprocal of shortest path distances from that node to all others, giving partial credit for distant nodes. Which algorithm computes this?
- Harmonic Centrality Correct answer.
- Eigenvector Centrality
- Closeness Centrality
- Degree Centrality
Explanation
Harmonic Centrality sums reciprocal distances, so unreachable nodes contribute zero instead of making the measure undefined. Closeness Centrality instead uses the reciprocal of the average or total distance, which behaves differently on disconnected graphs.
Question 47Algorithms
A graph projection is built with multiple node labels and a Cypher projection query that returns a weight property used by Dijkstra. Which condition must hold for the weighted path computation to behave as intended?
- The weight property must be identical for every relationship
- The weight property must be a string that can be parsed at query time
- The weight property must be stored on nodes rather than relationships
- The weight property must be numeric and present on the projected relationships Correct answer.
Explanation
Weighted path algorithms read numeric relationship weights from the projected relationship property named by relationshipWeightProperty. If the property is missing or non-numeric, the algorithm cannot use it as a cost.
Question 48Algorithms
A practitioner runs PageRank twice on the same projection with identical configuration and observes different score orderings near ties. Which factor best explains this?
- PageRank recomputes the projection with a different orientation each run
- PageRank initializes scores randomly and stops at a tolerance rather than exact convergence Correct answer.
- PageRank uses sampling that varies with concurrency settings
- PageRank is nondeterministic because it deletes relationships between runs
Explanation
Iterative algorithms stop when the change between iterations falls below tolerance, so near-tied nodes can order differently depending on initialization and floating-point accumulation. Setting a fixed initial value or a tighter tolerance improves reproducibility.
Question 49Algorithms
A team compares two community detection runs: Louvain and Label Propagation, on the same projection. Which statement best characterizes a key methodological difference between them?
- Louvain is deterministic, while Label Propagation always produces identical results
- Louvain only works on undirected graphs, while Label Propagation only works on directed graphs
- Louvain requires node properties, while Label Propagation requires relationship weights
- Louvain optimizes modularity hierarchically, while Label Propagation spreads labels by neighbor majority Correct answer.
Explanation
Louvain builds a hierarchy of communities by greedily maximizing modularity, whereas Label Propagation iteratively adopts the most frequent neighbor label. Both can run on undirected projections and neither strictly requires weights.
Question 50Algorithms
A practitioner applies K-Nearest Neighbors over FastRP embeddings and notices that most nodes receive no similarity relationships. Which configuration choice is most likely to increase the number of retained neighbors?
- Increasing the topK parameter for KNN Correct answer.
- Reducing the embedding dimension of FastRP
- Increasing the damping factor of FastRP
- Switching the projection to undirected orientation
Explanation
KNN retains the topK most similar neighbors per node, so raising topK allows more relationships to be created. Embedding dimension and projection orientation affect representation and graph structure but do not directly set the retention count, and FastRP has no damping factor.