Quant Interview Question #quant
Key Takeaways
The optimal strategy for maximizing the number of accepted cards is to accept the first card and then accept every card that is larger than the previously accepted card. This strategy can be implemented using a simple algorithm that keeps track of the maximum accepted card so far.
Full Transcript
The cards numbered 1 through 8 are shuffled and revealed one at a time. Whenever a card appears, you must immediately accept or reject it. However, every accepted card must be larger than the previously accepted card. There is no restriction on how many cards you may accept. You want to maximize the number of accepted cards. Determine the optimal strategy and the expected number of accepted cards under this strategy. Post your answers in comments.
Original Description
Can you solve this quant interview question?
More on: Algorithm Basics
View skill →Related Reads
📰
📰
📰
📰
Trapping Rain Water: Understanding Data Structure Choices from a Beginner’s Perspective
Medium · Programming
The Grid Problem That Looks Easy Until You Need the Lexicographically Smallest Path
Medium · Programming
The Algorithm That’s Practically O(1) — But Provably Isn’t
Medium · Programming
Knight Attack Made BFS Feel Like a Recipe, Not a Template
Medium · Python
🎓
Tutor Explanation
DeepCamp AI