Compute FanCash Earned on an Order With Tier Multipliers

Last updated: November 29, 2026

Quick Overview

Given a shopper's loyalty tier, the order lines, a set of boosted categories that earn double, and a per-order cap, compute FanCash earned in cents, excluding gift cards, shipping and tax and never going negative on over-discounted lines.

Fanatics
Coding & Algorithms
Software Engineer
Fanatics
November 29, 2026
Software Engineer
Online Assessment
Coding & Algorithms
Easy

0

0

0 solved


Given a shopper's loyalty tier, the order lines, a set of boosted categories that earn double, and a per-order cap, compute FanCash earned in cents, excluding gift cards, shipping and tax and never going negative on over-discounted lines.

FanCash is Fanatics' loyalty currency shared across commerce, collectibles and betting, so earning rules have to be exact and consistent across services. The assessment checks integer money handling, rounding discipline, and clean handling of exclusions and caps.

What the Interviewer Expects
  • Represent money as integer cents, never floats
  • Apply discounts at the line level and clamp at zero
  • Exclude non-earning categories
  • Round once at the end rather than per line
  • Apply the order cap last
Key Topics to Cover
Integer money
Rounding
Business rules
Basis points
Edge cases
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Rules change: boosts now stack (2x tier plus 2x category). How do you keep the code readable?
  • How should earned FanCash be reversed on a partial return?
  • Where should rounding policy live so web, app and stores agree?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Inputs: tier (ROOKIE 1%, ALL_STAR 1.5%, MVP 3% of eligible spend), lines as (category, unit_price_cents, qty, discount_cents), boosted categories (2x), and a cap in cents. Output: whole cents ...

High-Level Design

Express rates in basis points so everything is an integer. Accumulate paid_cents * bps * multiplier across lines without dividing, then divide by 10,000 once. Rounding per line would lose up to a ce...


Submit Your Answer
Markdown supported

Related Questions