JobsJob TrackerJob alerts

Mastek ยท 11 questions

All 11Coding 6Behavioral 2
  • Linked List Manipulation and OperationsCoding
  • Longest Substring Without Repeating CharactersCoding
  • Compute hierarchy level of each employee with SQLCoding
  • Standard HR QuestionsBehavioral
  • Output of C++ code snippets and pointersCoding
  • Truck driver apple toll puzzle
  • Woman born in 1945 being 30 years old today
  • Discuss project not mentioned on resumeBehavioral
  • Doubly Linked List implementation and explanationCoding
  • Doubly Linked List complexity and Tree TraversalsCoding
  • OS, DBMS, and SQL fundamentals
โ† Mastek questions
  1. Interview questions
  2. Mastek
  3. Truck driver apple toll puzzle

Truck driver apple toll puzzle

Filed under Mastek

The question

A truck driver has three bags of 10 apples each and must pass 10 tolls. At each toll, he must pay a number of apples equal to the number of bags he has in the truck. The goal is to maximize the remaining apples at the end, noting that he can pay the required apples from a single bag instead of all bags.

No write-up yet. Related questions below have one.

Related Mastek questions

  • Linked List Manipulation and Operations
  • Compute hierarchy level of each employee with SQL
  • Output of C++ code snippets and pointers
  • Woman born in 1945 being 30 years old today
  • Discuss project not mentioned on resume
โ† Output of C++ code snippets and pointersWoman born in 1945 being 30 years old today โ†’

Collected from public candidate posts and coding forums. Updated Nov 2026.