Draft - Set, Map, and Graph in an API Service
Authoring skeleton - backend focus (CS113 backend structures)
Three short topics
- Set for deduplication of incoming records.
- Map for keyed lookup and missing-key behavior.
- Graph for relationships between records.
PBL context
Use a set for deduplication, a map for keyed records, and a graph for relationships; explain each choice. Context: a small API service handling a batch of records.
Backend layers to author
- Deduplicate a batch with a set; define equals/hashCode behavior.
- Index records by key in a map; define missing-key policy.
- Link related records in a graph and query neighbors.
- Justify each representation with expected lookup costs.
Evidence checklist to author
Test duplicate records, missing keys, equal keys with different values, and disconnected graphs; verify counts and lookups.
Publication checklist
Complete examples, a CodeRunner exercise, and tests before removing the draft/hide flags, enabling submissions, or confirming the course and week.
Code Runner Challenge
Authoring draft - set map graph api exercise is not ready
View IPYNB Source
// CODE_RUNNER: Authoring draft - set map graph api exercise is not ready
public class SetMapGraphDraft {
public static void main(String[] args) {
throw new UnsupportedOperationException("Draft: author the set/map/graph exercise and tests before publication.");
}
}
SetMapGraphDraft.main(null);
Lines: 1
Characters: 0
Output
Click "Run" in code control panel to see output ...