# Puzzle 2) Manish and his Birthday Cake

Submitted by Amit Shukla, on August 04, 2017

**Puzzle**

Manish’s friends brought a cake for him on his birthday. The cake is completely round in shape. There are total eight persons including Manish in the Manish’s birthday party. Everyone wants cake and Manish is only allowing to do 3 straight cuts on cake. Besides he wants that everyone gets the same size of piece. Now you have to tell that how can Manish cut his cake so that each person in party get same amount of cake?

**Important points of puzzle:**

- Manish friends brought a cake for Manish.
- The shape of cake is perfect round.
- There are total 8 persons in party.
- Manish is only allowing to do only 3 straight cuts on cake.
- How can Manish cuts cake so that each person in party got equal amount of cake?

**Answer**

Manish have to cut two straight lines which are perpendicular to each other. And one straight cut form the middle of height of cake.

**Reason**

The first cut divide cake into two equal parts. The second cut which is perpendicular with first cut divides the cake into 4 equal parts and the third cut which is from middle of height cuts cake into 8 equal parts.

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.