# Puzzle 3) Cab and its Rates

Submitted by Amit Shukla, on August 05, 2017

**Puzzle**

In Gwalior city a new cab company formed. This cab company has its own methodology to calculate the amount. The cab in Gwalior has following formula based upon its meter reading. The meter reading is rounded up to the next higher multiple of 4. For instance, if the meter reading is 39 paisa, then it is rounded up to 40 paisa. The resultant is multiplied by 12. The final result is round off to the nearest multiple of 25 paisa. Now you have to tell that if 45 paisaare meter reading of cab then how much amount customer have to pay.

**Important points of puzzle:**

- A new cab company formed in Gwalior city.
- This company has its own methodology to calculate amount based upon its meter reading.
- The meter reading is rounded up to next higher multiple of 4.
- Resultant multiplied by 12.
- The final result is round off to nearest multiple of 25 paisa.
- Now you have to tell that is 45 paisa is meter reading then how much amount should be paid.

**Answer**

The amount is 5.75Rs or 575 paisa.

**Reason**

The meter reading is 45 and the next multiple of 4 is 48 so reading is converted to 48. Now 48 is multiplied by 12 and the result is 576. Now he nearest multiple of 25 is 575. Hence, the result is 575 paisa or 5.75Rs.

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.