A practice prompt we wrote. No company or candidate report names it, so it carries no company tag.
How to answer
Start with the records the food bank already keeps: its inventory system knows when each lot arrived and when it left, which gives you days in the warehouse before you buy a single scale. “Spoils before it reaches families” can happen in at least three places, each with a different fix, so run the decomposition method around one question: where does the food die? Get a loss number per stage before you choose a solution. Here is what the method looks like on a food bank:
- Draw the flow and say it aloud. Donors (grocery rescue pickups, farms, food drives) to the dock, the dock to dry, cooler and freezer storage, storage to partner pantries, pantry shelves to families. Food can die at every arrow.
- Ask which food, what “spoils” means, and what the date rule is. Produce, dairy and bread behave nothing like canned goods. Ask whether spoiled means thrown out, or arrived too close to its date to hand out. Then ask what staff do with product past its “Best if Used By” date. The USDA’s Food Safety and Inspection Service says on its food product dating page that, except for infant formula, dates are not an indicator of a product’s safety, and that food showing no signs of spoilage may be donated past its “Best if Used By” date. If staff discard shelf-stable food on the date, part of the “spoilage” is a policy the director can change this week, with no software, once they’ve checked their state’s own date rules.
- Name who throws food away, and who loses if the number looks bad. The warehouse manager’s team and the pantry coordinators do the discarding, and agency relations staff work with the pantries. The operations director owns the problem and the budget. Pantries may fear a smaller allocation if they report losses, and a grocer who sees its donation binned may stop giving.
- Measure pounds lost per stage, with pounds handed out beside it. Pounds discarded at each stage as a share of pounds that entered that stage, by category. The baseline is whatever the existing records show for last quarter, or the first weeks of weighing if they show nothing. Pounds distributed is the guardrail, because you can cut spoilage to zero by refusing produce.
- Find which records already know where food waits. Ask whether the inventory system records discards, how long lots sit between receipt and shipment, whether donations are weighed at the dock, and what pantries report back, and who owns each record.
- Find the biggest loss, then build. Say what you would build if storage dominates, and what you would build if pantries do.
Routing is the tempting wrong turn, because trucks are the visible part. If the food dies in the cooler or on a pantry shelf, faster trucks change nothing.
Follow-ups
What the interviewer may ask next, once your first answer is on the table.
- Where would you put the first scale or scanner, and what record does it write?
- Pantries record losses weekly on paper. How does that change the plan?
- Donors deliver without notice. What do you build for the first month?
Where answers go wrong
- Optimizes delivery routes before measuring whether the food spoils in storage or at partner pantries.
Answer this in two minutes
Write the answer you would say out loud. The clock starts with your first word.
Compare with the model answer
Model answer
“I’ll split the flow into stages, get a loss number for each from the records they already have, and build only for the stage that loses most.”
Clarify. “Which categories spoil, and does ‘spoil’ mean discarded or received too short-dated to distribute? I’ll assume perishables, meaning produce, dairy and bakery, and count both kinds of loss, labeled separately. And what happens to a can or a box of cereal on its ‘Best if Used By’ date? If it goes in the bin that day, some of this spoilage is a rule, not a storage problem, and changing the rule costs nothing, once we’ve checked the state’s own date rules.”
People and metric. “The operations director owns the problem. The warehouse manager and agency relations are my users. My metric is pounds discarded at each stage as a share of pounds that entered it, by category, with pounds distributed beside it so nobody hits the target by turning donors away. Last quarter’s numbers, if the records hold them, are the baseline.”
Split the flow. “Intake, storage, outbound, pantry. Before building anything I want a rough loss per stage. On day one I pull receipts, shipments and discards from the inventory system, as an export with one row per lot, and run this:”
-- lot_movement(lot_id, category, received_at,
-- shipped_at, disposed_at, pounds)
SELECT category,
count(*) AS lots,
round(percentile_cont(0.5) WITHIN GROUP (
-- a lot still in the building counts its days so far
ORDER BY extract(epoch FROM coalesce(shipped_at, disposed_at, now()) - received_at) / 86400
)::numeric, 1) AS median_days,
round(coalesce(sum(pounds) FILTER (WHERE disposed_at IS NOT NULL), 0)
/ sum(pounds), 3) AS discarded -- share of pounds
FROM lot_movement
WHERE received_at >= now() - interval '90 days'
GROUP BY category
ORDER BY discarded DESC;
category lots median_days discarded
produce 14200 4.5 0.142
bakery 5100 2.0 0.118
dairy 3300 6.0 0.061
dry 21800 21.0 0.004
“Read aloud, that says produce waits a median of 4.5 days in a building where it may have a week of life, and 14% of its pounds go in the bin. Dry goods wait 21 days and almost none is thrown out. So storage and allocation are the first suspects for perishables, before any truck. If the system doesn’t record discards, the last column reads zero, and the median still tells me where food waits. If it records them as shrink, I add a stage and a reason to that record before I buy anything. I’d guess a few hundred lots a day, which makes this a small-data problem: a tablet form writing to a couple of tables is enough, hosted wherever their inventory data already lives.”
The first scale. “It goes at the warehouse disposal point, not the dock. The dock scale probably exists already, and if discards are recorded at all, they lack a stage and a reason. Nothing reaches the dumpster or the compost bin without a weigh-in and a reason. The dock form writes the lot, and the disposal scale writes against it:”
CREATE TABLE intake_lot (
lot_id bigserial PRIMARY KEY,
donor_id text NOT NULL,
category text NOT NULL CHECK (category IN ('produce', 'dairy', 'bakery', 'protein', 'dry')),
pounds numeric(7,1) NOT NULL CHECK (pounds > 0),
received_at timestamptz NOT NULL DEFAULT now(),
temp_f numeric(4,1), -- cold items only
est_days_left int -- the receiver's estimate
);
CREATE TABLE disposal (
disposal_id bigserial PRIMARY KEY,
site_id text NOT NULL, -- warehouse or branch
weighed_at timestamptz NOT NULL DEFAULT now(),
stage text NOT NULL CHECK (stage IN ('dock', 'dry', 'cooler', 'freezer', 'outbound', 'pantry_return')),
category text NOT NULL CHECK (category IN ('produce', 'dairy', 'bakery', 'protein', 'dry')),
lot_id bigint REFERENCES intake_lot, -- row from the dock intake form; null when the label is gone
pounds numeric(7,1) NOT NULL CHECK (pounds > 0),
reason text NOT NULL CHECK (reason IN ('arrived_spoiled', 'expired_in_storage', 'temperature', 'damaged', 'unclaimed'))
);
“The reason ‘arrived_spoiled’ is the important one: it separates a donor problem from a storage problem.”
Pantries on paper. “Weekly paper sheets tell me which pantries lose food, not which day or which lot. That is enough to rank them. I pick the five pantries that take the most perishables, they photograph the sheet each week, and we key it in ourselves. Pantry sheets go in a separate pantry_loss(pantry_id, week_start, category, pounds) table, because their grain is a pantry-week, not a weigh-in. I would not ship pantry software until the numbers say pantries are where the loss is.”
Donors without notice. “For the first month I build two things. A dock intake form that writes the intake_lot row: donor, category, pounds, a temperature reading for cold items, and the receiver’s estimate of days of life left. And a morning ‘use first’ list of perishable lots sorted by days left, which agency relations offers to the pantries picking up that day. That is first-expired, first-out made visible, and it needs no advance notice from donors.”
Sequence. “Existing records first, then weighing where they are silent, because the loss per stage decides everything after. Then the use-first list, which helps whatever the answer is. Only then the stage-specific fix: cooler space and rotation if storage dominates, smaller and more frequent pantry allocations if pantries do, donor feedback if food arrives spoiled.”
Failure modes. “On a busy day staff skip the scale, so I compare weighed discards with the number of dumpster pickups. Pantries may underreport losses if they fear a smaller allocation, so agency relations says up front that the data will not cut anyone’s share. And a cooler that fails overnight is invisible without a temperature logger, so I ask whether one exists.”
Close. “So in two weeks the director gets one loss number per stage from records they already have, a use-first list running every morning, and a decision about which stage we build for next. I won’t build routing unless trucks turn out to be where the food dies.”