Limited Time Offer:Up to 20% off Hello Interview Premium
Up to 20% off Hello Interview Premium 🎉
Hello Interview
Your Dashboard
System Design
Code
Low Level Design
Behavioral
AI Coding
New
ML System Design
Salary Negotiation
Interview Guides
Blog
System Design
Low Level Design
AI Coding
Behavioral
New
Interview Questions
Success Stories
System Design
Low-Level Design
New
Ask The Community
Discord
Mock Interviews
1:1 Mentorship
Refer a Friend
Pricing
Sign in / Sign up
Search
⌘K
Pricing

Tutor

Probability That the Last Kept Ball Is Blue

You are given a bag that initially contains 2 red balls and 2 blue balls. You will repeatedly draw one ball from the bag at random until all balls have been kept (i.e., permanently removed from the bag). The rules for keeping or returning a ball are as follows: If you draw a red ball, you keep it and remove it from the bag. If you draw a blue ball: If it is not the second blue ball in a row, you put it back into the bag. If it is the second blue ball in a row, you keep it and remove it from the bag. Note: The “second blue in a row” means you drew a blue ball immediately after having drawn a blue ball in the previous turn. This process continues until all balls have been kept. Write a function to compute the probability that the last ball you keep is a blue ball, following the rules above.

Asked at:

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Company
​
Level
All Regions
Region

Late June, 2025

Google

Google

Junior

Your account is free and you can post anonymously if you choose.

Hello Interview Premium

Recent interview questions
System Design Guided Practice
Exclusive content
Learn More
Questions
Meta SWE Interview QuestionsAmazon SWE Interview QuestionsGoogle SWE Interview QuestionsOpenAI SWE Interview QuestionsEngineering Manager (EM) Interview Questions
Learn
Learn System DesignLearn DSALearn BehavioralLearn ML System DesignLearn Low Level DesignGuided Practice
Links
FAQPricingGift PremiumHello Interview Premium
Legal
Terms and ConditionsPrivacy PolicySecurity
Contact
About UsProduct Support

7511 Greenwood Ave North Unit #4238 Seattle WA 98103


© 2026 Optick Labs Inc. All rights reserved.