← 返回 stripe 的题目列表Feature Flag Library with Environment-Based Conditional Activation
类型:online_judge
stripe
Design and implement a feature flag library that provides a function to determine whether a feature flag is on. The function takes the flag's name and an optional map of key-value pairs, such as flag.is_on("give_discount", {"user": "user_name", "product": "product_id"}).
Design everything necessary for engineers to create and modify feature flags. The feature flag library should support services in multiple environments, allowing for flexible feature activation under different conditions. Provide complete design details and implementation suggestions.
Example
Input
{"flag_name": "give_discount", "params": {"user": "test_user", "product": "prod123"}}