Practice graph query patterns vocabulary: traversal queries, subgraph matching, path expressions, I/O bound graph queries, and Cypher vs. Gremlin performance characteristics.
0 / 5 completed
1 / 5
What is a 'traversal query' in graph database terminology?
A traversal query navigates the graph by following edges from node to node. It is the fundamental graph operation — unlike SQL table scans, traversals follow relationship pointers, making them fast for connected data but sensitive to graph depth.
2 / 5
A query is described as 'I/O bound on the graph.' What does this mean?
An I/O-bound graph query spends most of its time reading data from storage rather than computing. Deep traversals or queries touching large disconnected subgraphs are prone to this — graph databases optimize for this by keeping frequently traversed nodes in memory.
3 / 5
What is 'subgraph matching' in a graph query context?
Subgraph matching (or graph pattern matching) finds all subgraphs within a larger graph that are isomorphic to a query pattern. It is computationally expensive (NP-complete in general) but central to applications like fraud detection and chemistry informatics.
4 / 5
In Cypher (Neo4j's query language), how is a path expression typically written?
Cypher uses ASCII-art path notation: (a)-[:KNOWS*1..3]->(b) means 'find nodes a and b connected by 1 to 3 directed KNOWS edges'. This declarative syntax makes Cypher readable and expressive for graph pattern matching.
5 / 5
What is a key practical difference between Cypher and Gremlin for graph queries?
Cypher (Neo4j) is declarative: you describe the graph pattern you want and the engine finds it. Gremlin (Apache TinkerPop) is imperative/functional: you chain traversal steps. Both are powerful but favor different styles — Cypher is often more readable, Gremlin is more portable.