Back to problems

Implement transaction network queries

Object-Oriented Programming · Square · Hard

Implement a small transaction tracker for pairwise customer interactions. Each interaction connects exactly two customers, and the resulting relationship is undirected: if customer A transacts with customer B, then B is also considered to have transacted with A. Connectivity is transitive through the recorded graph. The tracker should support recording transactions over time and answering three kinds of queries based on all transactions recorded so far. Part 1 — Ever…

Checking your access…