1p3a
Experience
·
Mar 2026
Toast SDE-2 Technical Interview Round 1 Maximum Profit Bread Problem
Interview Experience
📌 Problem: Maximum Profit with 5-Day Selling Constraint You are given two integer arrays cost and sales, where: cost[i] represents the cost of making a sourdough bread on day i sales[i] represents the
Full Details
📌 Problem: Maximum Profit with 5-Day Selling Constraint You are given two integer arrays cost and sales, where: cost[i] represents the cost of making a sourdough bread on day i sales[i] represents the selling price of bread on day i 🧠Constraint: A bread made on day i can only be sold on or after day i + 5. 🎯 Goal: Return the maximum profit achievable by choosing one day to make the bread and a valid future day to sell it. If no profit is possible, return 0.
Free preview. Unlock all questions →
Topics
Arrays