Bird
0
0

In a Spring Boot application, how can you implement a feature flag that activates a new payment option exclusively for users belonging to a "betaTesters" role?

hard📝 Conceptual Q8 of 15
Spring Boot - Advanced Patterns
In a Spring Boot application, how can you implement a feature flag that activates a new payment option exclusively for users belonging to a "betaTesters" role?
ADeploy a separate Spring Boot instance for beta testers with the feature flag enabled
BEnable the feature flag globally and rely on frontend to hide the payment option for other users
CUse a feature flag without user context, assuming all users get the new payment option
DCheck the feature flag status and verify the user's role before enabling the payment option
Step-by-Step Solution
Solution:
  1. Step 1: Understand user-specific feature flags

    Feature flags combined with user context allow selective feature activation.
  2. Step 2: Analyze options

    Check the feature flag status and verify the user's role before enabling the payment option correctly combines feature flag check with user role verification. Enable the feature flag globally and rely on frontend to hide the payment option for other users relies on frontend only, which is insecure. Use a feature flag without user context, assuming all users get the new payment option ignores user context. Deploy a separate Spring Boot instance for beta testers with the feature flag enabled is inefficient and complex.
  3. Final Answer:

    Check the feature flag status and verify the user's role before enabling the payment option -> Option D
  4. Quick Check:

    Combine feature flags with user roles for selective activation [OK]
Quick Trick: Combine feature flags with user roles for targeted feature rollout [OK]
Common Mistakes:
  • Relying solely on frontend to hide features
  • Ignoring user context in feature flag checks
  • Creating separate deployments for feature targeting

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes