Bird
0
0

You want to implement a feature flag in Spring Boot that disables a new payment method only for users in a "betaTesters" group. Which approach correctly combines feature flags with user context?

hard📝 Application Q15 of 15
Spring Boot - Advanced Patterns
You want to implement a feature flag in Spring Boot that disables a new payment method only for users in a "betaTesters" group. Which approach correctly combines feature flags with user context?
ACheck if feature flag is enabled and user belongs to betaTesters before allowing payment
BEnable feature flag globally and ignore user groups
CDisable feature flag and allow all users access
DUse feature flag only in frontend without backend checks
Step-by-Step Solution
Solution:
  1. Step 1: Understand combining feature flags with user context

    Feature flags can be combined with user group checks to control feature access precisely.
  2. Step 2: Evaluate options for correct logic

    Check if feature flag is enabled and user belongs to betaTesters before allowing payment correctly checks both the flag and user group before enabling the feature.
  3. Final Answer:

    Check if feature flag is enabled and user belongs to betaTesters before allowing payment -> Option A
  4. Quick Check:

    Feature flag + user group check = controlled access [OK]
Quick Trick: Combine flag check with user group for precise control [OK]
Common Mistakes:
  • Ignoring user groups when using feature flags
  • Relying only on frontend checks
  • Enabling feature globally without restrictions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes