Solution
The first step can be to divide the three pills into identical halves or to split them in the middle. Then all three would have a left part and right part, after which you can place three left parts as a pile and three right parts as a separate pile. Now, every one of the two piles consists of 1/2 of tablet A and two halves of tablet B (or one tablet B). Now, take out one tablet A more from the bottle and reduce/ divide it into 1/2 or left and right parts. Put the two halves in a pile, the left one on the left stack and the right on the right bundle.
In this way, every pile now consists of 2 halves of tablet A and two halves of tablet B or one tablet A and one tablet B. You can now take one bank someday and the second one pile on the following day.
Explanation by Example
- Let us say we have 10 A pills and 10 B pills.
- According to the puzzle, you have one A pill and two B pills in hand, and both look identical. So here remaining pills of A are nine and of B is 8.
- Now, take out one more pill of A. You have four pills in your hands that are identical, so the catch here is all four are similar, and you have to eat one from each of them without wasting it.
- You have to partition them into two halve. Yes, you are getting it right. That is the left half and right half.
- You must be wondering. They are identical. This makes no sense. Stick to this explanation, and you will find out the logic.
- Finally, you have four left parts and four right parts. Here we can surely say that among the four left parts, two belong to the A pill category and the other two belongs to the B pill category.
- The same is the case with the right half.
- You have to eat the left half on one day and the right half on another day.
- Because two left halves make a full tablet.
Check out this problem - 8 Queens Problem
Frequently Asked Questions
How to approach a puzzle interview problem?
- Thinking about problem
- Clarity regarding problem
- Use brute force first
- Try to make logic
- Get the solution
Why are puzzles asked in interviews?
To see how you will approach a real-time and tricky situation.
What do you mean by puzzle reasoning?
It simply means analyzing the data given in the puzzle and arranging data to get the correct solution.
Conclusion
This article is about Interview puzzles and how they can be used in daily life and check our approach in an interview. We have seen two pills each day problem directly related to our lives, and we must have encountered this situation sometimes.
Recommended Readings:
Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, etc. on Coding Ninjas Studio.
Also check out some of the Guided Paths on topics such as Interview Puzzles, Data Structure and Algorithms, Competitive Programming, Operating Systems, Computer Networks, DBMS, System Design, etc. as well as some Contests, Test Series, Interview Bundles, and some Interview Experiences curated by top Industry Experts only on Coding Ninjas Studio.