Design and Implement a Parameterized Configuration Library
Resolve local configuration rules deterministically by parameters, priority, and specificity while snapshots refresh atomically.
Design and implement a client-side configuration library that is deployed with an application and resolves configuration locally.
The source reports an API conceptually shaped as getConfig(configKeyName, Map<String, String> params), parameter rules such as country=India and device=Android, and a focus on priority when several rules match.
For this exercise, assume configurations arrive as versioned immutable local snapshots; a key may have an optional typed default; lookups return typed values and diagnostics; structural or type-invalid snapshots are rejected before whole-snapshot activation; concurrent readers see either the complete old or complete new snapshot; and lookup performs no network I/O.
Define and implement a deterministic total precedence policy with explicit numeric priority as its primary key; justify any secondary tie rules rather than assuming one required tuple.
Building a distributed control plane, cross-process consensus, experimentation analytics, secrets storage, and a configuration authoring UI are outside scope.