chrisjacksonn/interview-sim / skills/sim
sim
VerifiedRun a timed coding assessment simulation in the terminal. Use for OA practice, GCA or ICA mocks, mock interviews, pairing rounds, take-homes, and pasted job postings.
questions/gca/checkout-rules/mutants/accepts_a_free_deal.py
View on GitHub"""Deliberately wrong: accepts a deal price of zero, so three for nothing
Used by tools/qa.py to prove the hidden suite can tell this from correct.
"""
class Checkout:
def __init__(self):
self._prices = {}
self._deals = {}
self._counts = {}
@staticmethod
def _whole(value):
return isinstance(value, int) and not isinstance(value, bool) and value > 0
def set_price(self, sku, price):
if not isinstance(sku, str) or not sku or not self._whole(price):
return False
self._prices[sku] = price
return True
def set_deal(self, sku, quantity, price):
if not isinstance(sku, str) or sku not in self._prices:
return False
if not self._whole(quantity) or quantity < 2:
return False
self._deals[sku] = (quantity, price)
return True
def scan(self, sku):
if not isinstance(sku, str) or sku not in self._prices:
return False
self._counts[sku] = self._counts.get(sku, 0) + 1
return True
def clear(self):
self._counts = {}
def total(self):
running = 0
for sku, count in self._counts.items():
price = self._prices[sku]
deal = self._deals.get(sku)
if deal is None:
running += count * price
continue
quantity, deal_price = deal
lots, rest = divmod(count, quantity)
running += lots * deal_price + rest * price
return running
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |