Prepare for a Bungie game-services discussion with a tiny economy and a visible account history. The routing question is distinct from the accounting question. Write the exchange limits before multiplying rates.
What to prepare for Bungie
Bungie's engineering careers page distinguishes areas of game engineering, and Bungie.net publishes API documentation. The company's SWE bank includes a two-day conversion question. Use its two-stage constraint for coding and the public platform surface as context for a separate account-projection mock. Bungie's engineering roles, Bungie.net public platform API reference
Choose the best two-day exchange under one exchange per day
Start with one unit of a given currency. On day one, keep it or use one directed exchange. On day two, keep the result or make one directed exchange back to your first currency. Rates are positive. Return the most you could end up with in your starting currency. For A→B ×2 on day one and B→A ×0.8 on day two, the best is 1.6. PracHub practice question
def best_return(start, day1, day2):
balances = {start: 1.0}
for a, b, rate in day1:
if a == start:
balances[b] = max(balances.get(b, 0.0), rate)
return max([balances[start]] + [balances.get(a, 0.0) * rate for a, b, rate in day2 if b == start])
assert best_return('A', [('A', 'B', 2)], [('B', 'A', 0.8)]) == 1.6
assert best_return('A', [('A', 'B', 2)], [('B', 'A', 0.4)]) == 1.0
assert best_return('A', [('A', 'B', 2), ('B', 'C', 3)], [('C', 'A', 9)]) == 1.0
Collect the maximum obtainable balance per intermediate currency after day one. Scan day-two rates returning to the starting currency. This costs O(edge count) time and O(currencies) state. The one-exchange restriction makes cycles unreachable within a day. If a changed prompt allows arbitrary repeated trades, you must reason about profitable cycles before claiming a finite maximum.
Walk through a boundary case
The first day can turn A into two B, then the second day can turn two B into 1.6 A. If the second rate becomes 0.4, holding the original A is better. Add a tempting B-to-C rate on the first day and show why you cannot take it after A-to-B under the one-exchange rule. In the reward mock, add two legitimate grants for the same item and replay one grant to exercise both kinds of identity.
Apply each reward grant once
Use grant ID for delivery deduplication and item ID for aggregation. Two distinct grants of the same item can both increase quantity. Set up a regression test where the first grant is repeated while another grant adds to the same item.
from collections import Counter
def inventory(grants):
seen, items = (set(), Counter())
for grant, item, count in grants:
if grant not in seen:
seen.add(grant)
items[item] += count
return dict(items)
assert inventory([('a', 'coin', 2), ('a', 'coin', 2), ('b', 'coin', 3)]) == {'coin': 5}
assert inventory([]) == {}
Design and debugging follow-up
Discuss a player reward received just as the profile service became unavailable. Persist a reward event with its grant ID, and have the profile projection catch up by sequence. During a partial outage the UI can distinguish a pending projection from a reward denial. Construct a trace where two distinct rewards share an item ID and one event is retried.
What to bring to a mock interview
Bring a gameplay or API project story that names the author of the state and the observable read latency. Test duplicates and a late arrival before talking about performance.