Amazon Interview Question

How did you implement the solution (for the coding portion) optimized for cost in dollars?