Language

English (en)

Date Uploaded

Summer 8-31-2026

Activity source

Original (with AI assistance). Anthropic’s Claude Code was used as a development tool for drafting materials, starter code, and tests, under the author’s direction and review. The in-assignment “Oracle” is an offline mock of an LLM; an optional extension connects it to Google’s Gemini API.

Summary

Students defend Wikipedia from vandals with data structures instead of infrastructure: a sliding-window edit-velocity tracker (hash map of queues), a hand-built binary min-heap, and a budget-bounded top-K selection decide which few suspicious edits earn a question to an expensive, rate-limited Oracle — a stand-in for a real LLM.

Extended Summary

This is a genuine CS2 data-structures assignment wrapped in an AI-era systems story. A provided pipeline replays ~600 real Wikipedia edits; students implement the four pieces that make it work: a per-user sliding window (hash map of queues, amortized O(1)), a suspicion score they design themselves inside three test-enforced guardrails, a binary min-heap built by hand on an array (sift-up/sift-down), and a “Most Wanted” report (hash map + sorting + top-k). The centerpiece is guided discovery: rather than being told the bounded-heap top-K algorithm, students derive it from a sequence of questions about what the least is they must keep to know the best B so far. The Oracle that judges escalated edits is a free offline mock — motivated explicitly as a stand-in for a slow, rate-limited LLM — and an optional extension connects it to Google’s Gemini free tier. Zero infrastructure: one TSV data file, no accounts, no libraries beyond a test runner; parallel starter/solution/test suites ship in Python, Java, and C++ with a language-neutral handout. About 5–8 hours; a required write-up covers Big-O analysis (bounded heap vs. sort) and abstraction. A companion graduate version (Kafka + Flink + real LLM) is submitted separately.

Student Learning Objectives

  • Implement and analyze a sliding-window counter with amortized O(1) eviction (hash map of queues).
  • Build a binary min-heap from scratch on an array, with correct sift-up/sift-down index arithmetic.
  • Derive the bounded-heap top-K-from-a-stream algorithm and justify O(c log B) vs. O(c log c) in Big-O.
  • Design a scoring function under explicit constraints, and choose data structures under a resource budget.
  • Reason about ADTs/abstraction: what an interface promises and what can change behind it.

Assignment Type

Out-of-Class

Course level

200

Used in course?

no

Type of Student-AI Collaboration Required

Human-generated with AI assistance or revision

Type of AI Task(s)

Problem Solving

Second Type of AI Task

Other (enter in Notes to Administrator field)

Uploader/Author Affiliation

Faculty

Creative Commons License

Creative Commons Attribution 4.0 International License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Document Type

Teaching Material

Share

COinS