A sandwich with optional toppings
At a deli you build a sandwich by choosing of breads and of proteins. Then, for each of toppings (lettuce, tomato, onion), you independently decide to add it or skip it.
How many different sandwiches are possible?
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
Sign in to join the discussion · reading is open to everyone
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.
Related questions
Building a lunch box from three traysCustomizing a phone case in three stepsA four-symbol locker code with repeats allowedAssembling a robot from four part binsWill every room get a guest?
All questions →