Service Discovery and Configuration Management Questions
Letting services find and configure each other at runtime: service registries, client-side versus server-side discovery, DNS-based discovery, dynamic configuration, feature flags, and secrets distribution. Covers how services stay wired together as instances come and go, how config changes propagate safely, and how to monitor and diagnose the outages that stale endpoints or bad config pushes cause. The connective plumbing of a microservices deployment.
Explain the watch semantics in etcd and in Consul and how they behave during network partitions and leader changes. Discuss how clients should handle missed events, compacted indices or lost watch histories, recommended retry/backoff strategies, and reconciliation approaches to ensure eventual consistency between client state and the source-of-truth.
Sample Answer
Direct answer
The two systems watch in different ways. etcd watches are event streams: the client asks for every change since a given revision (a global counter that increments on every write), and etcd replays each change in order, as long as that history has not been compacted (deleted to save space). Consul watches are blocking queries: the client sends "tell me when the state is newer than index X", and Consul answers with the current state, not the list of changes in between. Either way, a watch is a hint that can break during partitions and leader changes, so a correct client treats it as a cache-invalidation signal (a nudge that something changed, not a guaranteed full description of every change) on top of a list-then-watch loop: on any gap, compaction error, or doubt, it re-reads the full state at a known revision and resumes watching from just after it. That, plus jittered backoff and a periodic full resync, is what makes the client converge on the source of truth.
Terms used below
- Revision (etcd) / index (Consul): a number that increases with every write to the store; each key records the revision or index at which it last changed.
- Compaction (etcd): deleting old revisions so storage does not grow forever; after compacting at revision R, every revision before R is gone.
- Leader: both systems use Raft, a consensus protocol where one elected leader orders all writes and a write commits once a majority (quorum) of nodes stores it.
- Level-triggered vs edge-triggered: edge-triggered delivers each change as an event; level-triggered delivers the current state and lets you work out what changed.
etcd watch semantics
- A watch is opened on a key or prefix with an optional
start_revision. etcd guarantees events are ordered by revision, unique (never delivered twice), reliable (no event skipped within the available history), atomic (all keys changed in one transaction arrive together) and resumable (reconnect withstart_revision = last_seen + 1). - Optional progress notifications tell a watcher "you have seen everything up to revision R" even when nothing changed, so it can advance its resume point on a quiet key.
- Compaction: if you resume from a revision older than the compacted revision, the watch is cancelled with
compact_revisionset. The events you missed no longer exist; you must re-read state. - Partitions and leader changes: etcd's documentation explicitly gives no linearizability guarantee for watches (linearizability: a guarantee that every reader sees writes in the same real-world order they actually happened; without it, a watch can lag reality during trouble), and events cannot be delivered while the cluster is unhealthy. A client connected to a member that has been cut off from the leader can sit on a silent watch that looks healthy. The Go client's
WithRequireLeadercontext option (a per-request setting passed when opening the watch, telling the server to fail the watch fast rather than let it sit silently) makes the server cancel such watches when the member has no leader, so the client reconnects to a healthy member. After a leader change, the client resumes from its last revision and etcd replays anything missed, provided it is still in history.
Demonstration: compacted history and the recovery pattern
This script talks to etcd's JSON gateway (etcd's plain HTTP+JSON front end for its API, so it can be called with ordinary HTTP requests instead of a gRPC client library) with the standard library only. It writes 4 versions of a key, compacts, shows that resuming from an old revision fails, then does the correct recovery (re-list, then watch from the snapshot revision plus one). It was run against a fresh single-node etcd 3.7.2.
Two mechanics in the code are worth naming first: every range read, delete and watch below takes a key plus an optional range_end. Giving a range_end turns a single-key request into a request over every key from key up to (but not including) range_end, which is how the code watches or deletes a whole prefix instead of one exact key. The helper prefix[:-1] + chr(ord(prefix[-1]) + 1) builds that upper bound by taking the prefix's last character and bumping it to the next character (/ becomes 0, the character right after it in ASCII), so the range covers every key starting with the prefix and stops just before anything that does not; the hardcoded P[:-1] + "0" used for the deletes below is that same trick worked out by hand for a prefix that ends in /.
import base64, json, os, urllib.request
ETCD = os.environ.get("ETCD_ADDR", "http://127.0.0.1:2379")
b64 = lambda s: base64.b64encode(s.encode()).decode()
unb64 = lambda s: base64.b64decode(s).decode()
def call(path, body):
req = urllib.request.Request(ETCD + path, data=json.dumps(body).encode(), method="POST")
with urllib.request.urlopen(req) as r:
return json.loads(r.read())
def first_watch_message(prefix, start_rev):
"""Open a watch on the JSON gateway and return its first non-'created' message."""
end = prefix[:-1] + chr(ord(prefix[-1]) + 1) # prefix range end
body = {"create_request": {"key": b64(prefix), "range_end": b64(end), "start_revision": start_rev}}
req = urllib.request.Request(ETCD + "/v3/watch", data=json.dumps(body).encode(), method="POST")
with urllib.request.urlopen(req, timeout=5) as r:
for line in r:
msg = json.loads(line)["result"]
if msg.get("created") and not msg.get("events") and not msg.get("compact_revision"):
continue
return msg
P = "/config/orders/"
call("/v3/kv/deleterange", {"key": b64(P), "range_end": b64(P[:-1] + "0")})
for v in ("100", "200", "300", "400"):
rev = int(call("/v3/kv/put", {"key": b64(P + "timeout_ms"), "value": b64(v)})["header"]["revision"])
call("/v3/kv/compaction", {"revision": rev - 1, "physical": True}) # physical=True waits for the disk space to actually be reclaimed, not just the revision marked invalid
print("wrote 4 versions; latest revision", rev, "; compacted up to", rev - 1)
# A client that disconnected after seeing revision rev-3 tries to resume from rev-2.
msg = first_watch_message(P, rev - 2)
print("resume from", rev - 2, "->", "compact_revision =", msg.get("compact_revision"), "| canceled =", msg.get("canceled"))
# Correct recovery: re-list the prefix (a snapshot AT some revision), then watch from revision+1.
snap = call("/v3/kv/range", {"key": b64(P), "range_end": b64(P[:-1] + "0")})
snap_rev = int(snap["header"]["revision"])
state = {unb64(kv["key"]): unb64(kv["value"]) for kv in snap.get("kvs", [])}
print("re-list at revision", snap_rev, "->", state)
call("/v3/kv/put", {"key": b64(P + "timeout_ms"), "value": b64("500")})
msg = first_watch_message(P, snap_rev + 1)
ev = msg["events"][0]["kv"]
print("watch from", snap_rev + 1, "-> event", unb64(ev["key"]), "=", unb64(ev["value"]), "at mod_revision", ev["mod_revision"])
Output of ETCD_ADDR=http://127.0.0.1:2379 python3 watch_demo.py on a fresh etcd:
wrote 4 versions; latest revision 5 ; compacted up to 4
resume from 3 -> compact_revision = 4 | canceled = True
re-list at revision 5 -> {'/config/orders/timeout_ms': '400'}
watch from 6 -> event /config/orders/timeout_ms = 500 at mod_revision 6
Reading it: the four puts are revisions 2 to 5 (a fresh store starts at revision 1). A client that last saw revision 2 tries to resume from 3, but compacting at revision 4 deleted every revision before 4, so etcd cancels the watch and reports compact_revision = 4 (the oldest revision still available; a separate check confirmed that watching from 4 itself still works). The event at revision 3 (the value 200) is gone for good: that client can never learn it happened. Re-listing returns the current state together with the revision it reflects (5); watching from 6 then catches the next change with no gap and no duplicate.
Consul watch semantics
- A blocking query is an ordinary read with
?index=X: Consul holds the request until the resource's index exceeds X or the wait time expires (default 5 minutes, maximum 10, plus a small random extra of up to wait/16 to spread out timeouts), then returns the current data with a newX-Consul-Indexheader. Theconsul watchcommand and client-library watches are loops over this. - It is level-triggered: if a key changed three times while you were away, you get only the latest value. You can never "miss" the final state, but you can miss intermediate states, so Consul watches are unsuitable when every transition matters (use an append-only log for that).
- A return is not a guarantee of change: timeouts and writes of an identical value also wake the query. Compare the data before acting.
- Index rules from Consul's documentation: if the returned index goes backwards (it can, for example after a snapshot restore, loading an older backup of the cluster's data, which can reintroduce a lower index, or when a query lands on a different server), reset to 0 and do a full read; if it is 0 or less, treat it as 1 so you do not spin in a tight loop.
- Partitions and leader changes: by default reads go to the leader; with no leader, requests fail with a no-cluster-leader error and the client must back off and retry. With
?stale, any server can answer, even without quorum, and theX-Consul-LastContactheader tells you how many milliseconds since that server heard from the leader, so the client can decide whether the answer is too old.X-Consul-KnownLeadersays whether the server believes a leader exists.
Side-by-side
| etcd watch | Consul blocking query | |
|---|---|---|
| Delivers | Every event since a revision | Current state newer than an index |
| Missed changes | Replayed if not compacted; else error | Collapsed into the latest state |
| History loss signal | Watch cancelled with compact_revision | None needed; index going backwards means reset |
| During leader loss | Silent stall unless require-leader is used | No-leader errors, or stale reads with ?stale |
| Resume point | Last revision seen plus one | Last X-Consul-Index |
How clients should handle missed events, compaction and lost history
The correct loop for both systems:
- List: read the full state of the prefix and remember the revision or index it reflects.
- Watch from there: etcd from
revision + 1; Consul with?index=<that index>. - Apply changes idempotently: each update carries its revision; ignore anything older than what you already applied (this handles duplicates after reconnects).
- On compaction error, index going backwards, or any doubt: go back to step 1. Re-listing is always safe; only guessing is dangerous.
- Periodic full resync (for example every 10 minutes) even when the watch looks healthy, to catch a silently stalled watch or a client-side bug.
Retry and backoff
- Exponential backoff with full jitter on reconnect: wait a random time between 0 and
min(cap, base × 2^attempt), for example base 100 ms and cap 30 s. After a leader election, thousands of clients reconnecting at the same instant (a thundering herd) can overload the new leader; jitter spreads them out. - Rate-limit re-lists: a full list of a large prefix is expensive; if many clients hit compaction together, stagger them the same way.
- Consul-specific: rate-limit the blocking loop so that during rapid churn it degrades to polling at a sane rate instead of hammering the servers.
- Timeouts shorter than the stall you can tolerate: without require-leader or progress notifications, a watch on a partitioned etcd member can hang indefinitely; a client-side "no progress for N seconds, reconnect" timer bounds it.
Reconciliation for eventual consistency
(Reconciliation here means continually comparing what should be true against what actually is, and correcting any difference, rather than trusting that every individual event was received.) The client's goal is: its local state equals the source of truth as of some revision, and that revision keeps moving forward. The list-then-watch loop gives that: every path out of a broken watch goes through a full read, which is ground truth by definition. On top of that, the consumer should be a reconciler: compare desired state (from the store) with actual state (what it applied) and act on the difference, rather than acting on individual events. That way a lost, duplicated or out-of-order event only delays convergence; it can never leave the client permanently wrong.
Trade-offs and pitfalls
- Treating the watch as the source of truth: an event stream with no re-list path fails permanently on the first compaction.
- Compacting too aggressively in etcd: short history means slow or restarted clients hit compaction more often, and each re-list costs far more than an incremental catch-up. Size history retention to your longest expected client disconnect.
- Acting on every Consul wake-up: spurious returns cause needless reloads; diff first.
- Stale reads in Consul are the right trade for discovery (availability over freshness) but wrong for a value that guards a critical decision; use the default or
?consistentmode there.
Describe a schema evolution strategy for configuration data and feature flags that ensures backward and forward compatibility across microservices written in different languages. Include approaches for typed versus untyped configs, deprecation policies, defaulting strategies, validation tooling, and how to handle clients that cannot be upgraded simultaneously.
Sample Answer
Direct answer
Treat configuration and feature flags as a public API with a schema, and evolve that schema with the same rules you would use for a wire protocol (the format two programs agree on to exchange data over a network): only additive changes are allowed in place; every removal, rename or type change goes through expand, migrate, contract, and the contract step is gated on evidence that no running client still reads the old shape. Every field needs a safe default defined in the schema (not scattered through code), a validator runs in CI (continuous integration, the automated checks on every change) and again at publish time, and old clients are protected either by staying tolerant readers or by the config service serving them a shape they understand.
Key terms
- Backward compatible: new code can read old config. (A client upgraded today still works with last month's config documents.)
- Forward compatible: old code can read new config. (A client that has not been upgraded still works after someone publishes a config containing new fields.) In a polyglot fleet (services written in several different languages) you need both, because you never upgrade every service at once.
- Typed config: the structure is declared in a schema language (Protocol Buffers/Protobuf, Google's compact binary encoding format with a schema; Avro, a similar binary format popular in the Kafka/Hadoop ecosystem; JSON Schema, a way to declare rules for plain JSON; CUE, a newer schema and validation language) and code is generated or validated against it.
- Untyped config: free-form key/value strings or JSON blobs that each service interprets however it likes.
- Tolerant reader: a client that ignores fields it does not recognise and applies a default for fields that are missing, instead of failing.
- Expand/contract: a change done in two phases. Expand adds the new shape alongside the old; clients migrate; contract removes the old shape once nobody reads it.
1. Typed vs untyped: pick typed, with an escape hatch
| Typed (Protobuf / JSON Schema / CUE) | Untyped (string key/value, raw JSON) | |
|---|---|---|
| Catching mistakes | At publish time, before any service sees it | At runtime, in whichever service parses it first |
| Cross-language | Generated code gives every language the same field names, types and defaults | Each language re-implements parsing; subtle divergence (is "1" true?) |
| Evolution rules | Enforceable by tooling (breaking-change detectors) | Enforced only by review and memory |
| Flexibility | Needs a schema change to add a field | Anything goes |
Recommendation: typed by default. Use Protobuf (Protocol Buffers: each field is declared with a small integer field number as well as a name, and that number, not the name, is what actually goes out on the wire) when services already speak it. Its binary encoding has well-known compatibility rules: a reader identifies fields by number, skips any field number it does not recognise instead of failing, and proto3 (the current version of the Protobuf language) runtimes preserve those unknown fields when they re-serialise a message, so a service that only forwards a config through does not silently drop fields it does not understand. Otherwise use JSON Schema when configs are hand-edited JSON/YAML. Keep a small, explicitly untyped extensions map for team-local experiments, with the rule that anything read by more than one service must graduate into the schema.
2. The compatibility rules (write them down, enforce them in CI)
Safe in place:
- Add an optional field with a default.
- Add an enum value, provided every reader has an explicit "unknown value" branch.
- Widen a numeric range that readers already validate against (for example, if
max_retrieswas declared 0 to 5 and every reader already validates against that range, raising the allowed maximum to 10 is safe: an old reader that never sees a value above 5 behaves exactly as before, and a new reader that receives 8 accepts it correctly; narrowing the range is the unsafe direction, since an old reader might already rely on a value the new, smaller range would reject).
Never in place (always expand/contract):
- Removing or renaming a field. In Protobuf, also never reuse a removed field's number or name: mark them
reserved(a declaration that tells the compiler "never assign this number or name again"). Otherwise, because Protobuf identifies fields by number rather than by name, an old client that still expects field 3 to meanretrieswill read whatever new field 3 means today as if it were stillretries, silently misinterpreting it. - Changing a type (
int32milliseconds to a duration string, a bool to an enum). - Changing the meaning or unit of a field while keeping its name. This is the most dangerous because every tool says it is compatible.
- Making an optional field required.
Tooling: buf breaking (a command from the buf CLI, a common Protobuf tool) checks Protobuf schemas against the previous version and fails the build on incompatible changes. For JSON Schema, a CI job validates every stored config document against both the new schema and the previous one. The config service validates again at publish time, so nobody can bypass CI by editing the store directly.
3. Defaulting strategy
- Defaults live in the schema, and generated code in every language reads them from there, so Go and Python agree on what "missing" means.
- Distinguish "absent" from "zero". In proto3, a plain
int32 retries = 3;cannot tell "not set" from "set to 0": both look identical on the wire. Declare such fieldsoptional(which gives presence tracking: the generated code adds a separate "was this field actually set" flag alongside the value) or wrap them (use a message type like Protobuf's well-knownInt32Valueinstead of a bareint32, so "unset" is a distinct, checkable state), because "0 retries" and "use the default" are different decisions. - A default must be safe, not just valid. The default for a timeout should be the value that keeps the system working if the field disappears, not
0. - Unknown enum values fall back explicitly, for example to the most conservative behaviour, and increment a metric so you know it happened.
4. Feature flags: same discipline, shorter life
Feature flags are configuration that changes behaviour per request or per user.
- Type every flag (boolean, string, number, structured JSON variant) and require a code-side default at every evaluation site. The OpenFeature standard (a vendor-neutral flag evaluation API from the CNCF, the Cloud Native Computing Foundation) builds this in: calls look like
getBooleanValue("new-checkout", false), so an unreachable flag service or a deleted flag returns the default instead of throwing. - Never change a flag's type or meaning under the same key. Create a new key and retire the old one.
- Deprecation has an owner and an expiry date set at creation. Release flags (temporary switches for a rollout) should be removed within weeks of reaching 100%; permanent operational flags (kill switches) are documented as permanent.
5. Deprecation policy
- Mark the field deprecated in the schema (Protobuf has
[deprecated = true]; generated code then warns at compile time in most languages). - Announce a removal date, with a support window long enough for the slowest-releasing consumer. A common rule is "two release cycles of the slowest consumer or 90 days, whichever is longer".
- Measure readers before removing. The client library records which config fields each service actually reads and reports it (field name, service name, library version). Removal is allowed only when that report shows zero readers for the window.
- Remove, and reserve the name/number.
6. Clients that cannot be upgraded at the same time
This is the real constraint, and there are three tools for it, in order of preference:
- Tolerant readers everywhere. Every client library ignores unknown fields and applies schema defaults. This alone makes all additive changes forward compatible.
- Expand/contract with dual-write. During the expand window, publishers write both the old and new fields; old clients read the old one, new clients prefer the new one.
- Version negotiation at the config service. Each client sends the schema version it was built with (
schema_version=2) when it fetches config. The service stores config in the newest shape and down-converts on read for older clients, so an embedded device or a vendor-supplied service that can never be rebuilt still gets a shape it understands. This costs converter code in the service, so reserve it for consumers that genuinely cannot move.
Worked example: renaming timeout_ms (an integer) to timeout (a duration string)
Three published config documents and two client generations. The old client was built when only timeout_ms existed and defaults it to 1000 if missing; the new client prefers timeout and falls back to timeout_ms. Version 2 also adds an unrelated new field, retry_budget (the fraction of a service's own request volume it is allowed to spend on retries, so retries cannot multiply into a bigger overload than the original traffic), to show that an old client ignoring a field it does not recognise matters just as much as how it handles a renamed one.
import json
# Config documents as the config service would store them.
v1 = {"schema_version": 1, "timeout_ms": 2500}
v2 = {"schema_version": 2, "timeout_ms": 2500, "timeout": "2.5s", "retry_budget": 0.1} # expand
v3 = {"schema_version": 3, "timeout": "2.5s", "retry_budget": 0.1} # contract
def parse_duration_ms(text):
if text.endswith("ms"):
return int(float(text[:-2]))
if text.endswith("s"):
return int(float(text[:-1]) * 1000)
raise ValueError(f"bad duration {text!r}")
def old_reader(doc):
"""A client built against version 1: knows only timeout_ms."""
return {"timeout_ms": doc.get("timeout_ms", 1000)} # default if missing
def new_reader(doc):
"""A client built against version 2: prefers the new field, falls back to the old."""
if "timeout" in doc:
timeout_ms = parse_duration_ms(doc["timeout"])
else:
timeout_ms = doc.get("timeout_ms", 1000)
return {"timeout_ms": timeout_ms, "retry_budget": doc.get("retry_budget", 0.2)}
for name, doc in [("v1", v1), ("v2", v2), ("v3", v3)]:
print(name, "old client ->", old_reader(doc), "| new client ->", new_reader(doc))
Output:
v1 old client -> {'timeout_ms': 2500} | new client -> {'timeout_ms': 2500, 'retry_budget': 0.2}
v2 old client -> {'timeout_ms': 2500} | new client -> {'timeout_ms': 2500, 'retry_budget': 0.1}
v3 old client -> {'timeout_ms': 1000} | new client -> {'timeout_ms': 2500, 'retry_budget': 0.1}
Read the three lines as the three phases:
- v1 (before): both clients agree on 2500 ms.
- v2 (expand): both fields are written; both clients still agree on 2500 ms, and the new client also picks up the new
retry_budgetfield while the old client simply ignores it (forward compatibility). - v3 (contract, done too early): the old field is gone. The old client does not crash. It silently falls back to its default of 1000 ms, so requests that need 2.5 s start timing out. That silent wrong default is the typical way schema evolution fails in production, and it is why the contract step is gated on measured reader counts (section 5), not on a calendar date alone.
Trade-offs and pitfalls
- "Compatible" by the tool is not compatible by meaning. Changing
timeoutfrom seconds to milliseconds passes every schema check. Put units in field names or use typed durations. - Required fields are forever. Adding one breaks every old publisher; removing one breaks every old reader. Prefer optional with a safe default.
- Down-conversion is a long-term cost. Every schema version you promise to serve is converter code to test. Cap it (for example, the current version plus two older ones) and publish that policy.
- Validation at publish time is the last line of defence, because a bad config reaches every instance within seconds, while a bad code deploy usually rolls out gradually.
- Flag debt is schema debt. Hundreds of stale flags are hundreds of untested code paths. The expiry date at creation is what keeps them from accumulating.
Implement in Python a thread-safe ServiceResolver class that resolves a service name to IP addresses using socket.getaddrinfo and caches results per-service with a configurable TTL. Provide methods: resolve(service_name) -> list of IPs, and invalidate(service_name). The cache should refresh after TTL expiry and avoid duplicate simultaneous DNS queries when multiple threads request the same service concurrently.
Sample Answer
Direct answer
Keep one lock that protects two small dictionaries: a cache of service -> (IPs, expiry time) and an in-flight table of service -> pending lookup. A caller that finds a fresh cache entry returns it immediately. A caller that finds nothing fresh either becomes the leader for that service (registers a pending lookup, releases the lock, calls getaddrinfo) or, if a lookup is already pending, becomes a follower and waits on it. This pattern is called single-flight: however many threads ask for the same name at once, only one DNS query goes out. The DNS call must happen outside the lock, otherwise one slow lookup would block every other service's cache hits.
Approach
- Why a TTL cache at all?
socket.getaddrinfoasks the operating system resolver, which may go over the network to a DNS server. Doing that on every request adds latency and load. Caching for a TTL (time-to-live), a fixed number of seconds after which the answer is treated as expired, trades a little freshness for a lot of speed.getaddrinfodoes not return the DNS record's own TTL, so the class takes a configured one. - Monotonic clock. Expiry uses
time.monotonic(), which never jumps backwards when the wall clock is corrected by NTP (the network time protocol). Usingtime.time()could make entries live far too long or expire instantly after a clock step. - Leader/follower with
threading.Event. The leader stores the result (or the exception) on a small_InFlightobject and sets its event. Followers wake up and read the same result, so all concurrent callers see one consistent answer. - Errors are propagated, never cached. A failed lookup is raised to every waiting caller, and the next call retries. (Caching negative results briefly is a deliberate extension, discussed below.)
invalidate()also detaches an in-flight lookup. If someone invalidates while a lookup is running, that lookup's answer might predate the change that triggered the invalidation, so the leader checks that its flight is still the registered one before caching.- Injectable
lookupandclock. This makes the concurrency and TTL behaviour testable without a network and without sleeping through real TTLs.
Code
import socket
import threading
import time
class _Entry:
# __slots__ is optional: it just tells Python this class only ever has these two
# attributes, so instances skip the usual per-object __dict__ and use less memory.
# Correctness does not depend on it; it is worth doing here because many of these
# can exist at once, one per cached service.
__slots__ = ("ips", "expires_at")
def __init__(self, ips, expires_at):
self.ips = ips
self.expires_at = expires_at
class _InFlight:
"""One pending lookup that concurrent callers wait on (single-flight)."""
__slots__ = ("done", "ips", "error")
def __init__(self):
self.done = threading.Event()
self.ips = None
self.error = None
class ServiceResolver:
def __init__(self, ttl_seconds=30.0, port=None,
lookup=socket.getaddrinfo, clock=time.monotonic):
if ttl_seconds <= 0:
raise ValueError("ttl_seconds must be positive")
self._ttl = ttl_seconds
self._port = port
self._lookup = lookup # injectable for tests
self._clock = clock # monotonic: immune to wall-clock jumps
self._lock = threading.Lock() # guards _cache and _inflight only
self._cache = {} # service_name -> _Entry
self._inflight = {} # service_name -> _InFlight
def resolve(self, service_name):
with self._lock:
entry = self._cache.get(service_name)
if entry is not None and self._clock() < entry.expires_at:
return list(entry.ips) # fresh hit, copy out
flight = self._inflight.get(service_name)
leader = flight is None
if leader:
flight = _InFlight()
self._inflight[service_name] = flight
if not leader: # follower: wait for the leader
flight.done.wait()
if flight.error is not None:
raise flight.error
return list(flight.ips)
try: # leader: DNS call OUTSIDE the lock
# type=socket.SOCK_STREAM asks getaddrinfo for TCP-capable results only (as
# opposed to UDP), which is also what keeps it from returning the same IP
# twice for two socket types we do not care about.
infos = self._lookup(service_name, self._port,
type=socket.SOCK_STREAM)
# getaddrinfo returns a list of 5-tuples: (family, socktype, proto, canonname,
# sockaddr). sockaddr is itself a tuple, (ip, port) for IPv4 or (ip, port,
# flowinfo, scopeid) for IPv6, so info[4] is the sockaddr and info[4][0] is
# always the IP string. The set comprehension collects and dedupes them.
ips = sorted({info[4][0] for info in infos})
if not ips:
# gaierror ("getaddrinfo error") is the same exception type getaddrinfo
# itself raises on a real failure, so every caller handles an empty
# result the same way it would handle a genuine DNS failure.
raise socket.gaierror(f"no addresses for {service_name}")
flight.ips = ips
with self._lock:
# Only cache if nobody called invalidate() while we were resolving.
if self._inflight.get(service_name) is flight:
self._cache[service_name] = _Entry(ips, self._clock() + self._ttl)
except Exception as exc:
flight.error = exc # errors are never cached
finally:
with self._lock:
if self._inflight.get(service_name) is flight:
del self._inflight[service_name]
flight.done.set()
if flight.error is not None:
raise flight.error
return list(flight.ips)
def invalidate(self, service_name):
with self._lock:
self._cache.pop(service_name, None)
# Detach any lookup already running: its answer may predate the
# change that triggered this invalidation, so it must not be cached.
self._inflight.pop(service_name, None)
# ---------------- demo driver: deterministic, no network needed ----------------
if __name__ == "__main__":
calls = {"n": 0}
calls_lock = threading.Lock()
gate = threading.Event()
def fake_lookup(host, port, type=0):
with calls_lock:
calls["n"] += 1
gate.wait() # hold the lookup open
return [(socket.AF_INET, socket.SOCK_STREAM, 6, "", ("10.0.0.7", 0)),
(socket.AF_INET, socket.SOCK_STREAM, 6, "", ("10.0.0.5", 0)),
(socket.AF_INET, socket.SOCK_STREAM, 6, "", ("10.0.0.5", 0))]
now = {"t": 1000.0}
r = ServiceResolver(ttl_seconds=30, lookup=fake_lookup, clock=lambda: now["t"])
results = []
def worker():
results.append(r.resolve("payments.internal"))
threads = [threading.Thread(target=worker) for _ in range(20)]
for t in threads:
t.start()
while calls["n"] == 0: # wait until the leader is inside the lookup
time.sleep(0.001)
time.sleep(0.05) # let the other 19 queue up as followers
gate.set()
for t in threads:
t.join()
print("threads:", len(results), "| lookups:", calls["n"], "| answer:", results[0])
print("all threads got the same list:", all(x == results[0] for x in results))
now["t"] += 10
r.resolve("payments.internal")
print("cached hit at t+10s, lookups still:", calls["n"])
now["t"] += 21
r.resolve("payments.internal")
print("after TTL expiry (t+31s), lookups:", calls["n"])
r.invalidate("payments.internal")
r.resolve("payments.internal")
print("after invalidate(), lookups:", calls["n"])
# invalidate() while a lookup is in flight: that answer must not be cached
slow_gate = threading.Event()
def slow_lookup(host, port, type=0):
slow_gate.wait()
return [(socket.AF_INET, socket.SOCK_STREAM, 6, "", ("10.0.0.9", 0))]
r2 = ServiceResolver(ttl_seconds=30, lookup=slow_lookup, clock=lambda: now["t"])
t = threading.Thread(target=r2.resolve, args=("orders.internal",))
t.start()
while "orders.internal" not in r2._inflight:
time.sleep(0.001)
r2.invalidate("orders.internal")
slow_gate.set()
t.join()
print("invalidate during in-flight lookup, cached afterwards:", "orders.internal" in r2._cache)
def failing_lookup(host, port, type=0):
raise socket.gaierror("Name or service not known")
bad = ServiceResolver(ttl_seconds=5, lookup=failing_lookup)
try:
bad.resolve("nope.internal")
except socket.gaierror as e:
print("failure propagates, not cached:", e, "| cache size:", len(bad._cache))
Output from running the file as shown:
threads: 20 | lookups: 1 | answer: ['10.0.0.5', '10.0.0.7']
all threads got the same list: True
cached hit at t+10s, lookups still: 1
after TTL expiry (t+31s), lookups: 2
after invalidate(), lookups: 3
invalidate during in-flight lookup, cached afterwards: False
failure propagates, not cached: Name or service not known | cache size: 0
The demo pins everything that matters: the fake lookup returns fixed addresses, the clock is a variable the driver advances, and the 20 threads are held at a gate so that they genuinely overlap. The output shows one DNS call for 20 concurrent callers, deduplicated and sorted IPs, a cache hit inside the TTL, a refresh after it, a forced refresh after invalidate(), an invalidation racing an in-flight lookup, and a failure that is raised but not cached.
Key points
- Lock scope is tiny. The lock is held only to read or change the two dictionaries, never across I/O. Different services never wait on each other's DNS.
- Copies out.
resolve()returnslist(...)so a caller that mutates its result cannot corrupt the cache. - Deduplication.
getaddrinfocan return one entry per (family, socket type, protocol) combination, so the same IP often appears more than once; the set removes duplicates. Asking forSOCK_STREAMalso cuts duplicates at the source. - IPv4 and IPv6. Both families are returned by default. Pass
family=socket.AF_INETin the lookup call if callers cannot use IPv6.
Complexity
- Cache hit: O(1) dictionary lookup under the lock, plus O(k) to copy k addresses.
- Miss: one
getaddrinfocall per service per TTL window, regardless of how many threads ask, plus O(m log m) to sort m results. - Memory: O(S × k) for S cached services with k addresses each, plus O(S) for pending lookups.
Edge cases
| Case | Behaviour |
|---|---|
| Many threads ask for the same service at once | One lookup; the rest wait on the event and share the result. |
| Many threads ask for different services | Lookups run in parallel because the lock is released during I/O. |
Lookup raises (gaierror, timeout) | Every waiter gets the same exception; nothing is cached; the next call retries. |
| Lookup returns an empty list | Treated as an error rather than caching "no instances". |
invalidate() during an in-flight lookup | The running lookup's answer is not cached; the next caller starts a fresh lookup. |
| TTL of zero or negative | Rejected in the constructor. |
| Wall-clock jumps | Irrelevant, because expiry uses the monotonic clock. |
Trade-offs and extensions
- Stale-while-revalidate. At expiry, every caller for that service waits for the refresh. For hot services you can instead return the expired value immediately and refresh in the background, so latency never spikes at the TTL boundary. The cost is serving data slightly older than the TTL.
- Serve-stale-on-error. If the DNS server is down, returning the last known addresses (and counting that you did) keeps traffic flowing. The risk is routing to instances that have gone away, so cap how stale you will go.
- Negative caching. Caching a failure for a few seconds protects the DNS server from a retry storm when a name genuinely does not exist.
- Timeouts.
getaddrinfohas no timeout parameter. A hung resolver would hold followers forever, so production code often runs the lookup in a worker pool and has followers usedone.wait(timeout). - Jittered expiry. If thousands of processes cache the same name with the same TTL, they refresh in lockstep. Adding a small random jitter to the expiry spreads that load.
Design a feature-flag service that supports per-user and per-segment targeting, deterministic percentage rollouts, and a global kill-switch, serving roughly a million evaluations per second at low latency across multiple regions. Cover the runtime evaluation model, how a flag change propagates to evaluators, storage and caching, and how you'd keep a full audit trail and roll back a bad flag fast.
Sample Answer
Direct answer
The key decision is to evaluate flags inside the application process, not over the network. Each service embeds an SDK (software development kit, the client library) that holds the full rule set in memory and evaluates a flag with a hash and a few comparisons, so a million evaluations per second is a million local function calls with no network hop and no central bottleneck. A central control plane stores flags as versioned, immutable documents with an append-only change log, and pushes each new version to regional relays that stream it to every SDK within seconds. Percentage rollouts use a deterministic hash of flag and user, so a user's answer never flickers. Rollback is "publish the previous version", and the kill switch is a rule evaluated before all others.
Terms first
- Feature flag: a named switch whose value is decided at runtime per request, so behaviour changes without a deploy.
- Targeting: rules like "users in segment
beta-testersgeton", "country = DE getsoff". - Segment: a reusable named group of users, defined either by a rule (
plan = enterprise) or an explicit list of IDs. - Deterministic percentage rollout: "25% of users" chosen by hashing, so the same user always lands in the same group without storing anything.
- Kill switch: a way to force a flag (or all flags of a feature) to its safe value instantly.
- SSE (server-sent events): a long-lived HTTP response over which a server pushes messages to a client; simpler than WebSockets for one-way updates.
- Control plane: the central service that owns the source of truth for every flag and pushes changes out; it never evaluates a flag for live traffic itself, it only distributes the rules.
- Relay: a regional fleet of servers between the control plane and the SDKs. It holds a cached copy of the current rules and streams changes to every SDK connected to it, so the control plane itself is never in the request-serving path.
- Exposure event: a small record ("user U-482 saw flag new-checkout as on") sampled and logged when a flag is evaluated, used afterwards to measure the flag's effect. It plays no part in serving the flag.
Requirements I am designing to
- 1,000,000 evaluations per second in total, low latency (target: microseconds per evaluation, so it can sit on every request path).
- Several regions; a region losing contact with the control plane must keep evaluating correctly on last-known rules.
- Flag change visible everywhere in seconds; rollback in seconds; every change attributable and reversible.
Architecture
flowchart LR
UI[Admin UI and API] --> CP[Control plane: validation, approvals]
CP --> DB[(Primary DB: flag versions and change log)]
CP --> BUS[Change stream]
BUS --> R1[Region A relay fleet]
BUS --> R2[Region B relay fleet]
CP --> SNAP[Versioned snapshots in object storage]
R1 -->|SSE stream| S1[Service SDKs, in-process eval]
R2 -->|SSE stream| S2[Service SDKs, in-process eval]
SNAP -.->|bootstrap and fallback| S1
SNAP -.->|bootstrap and fallback| S2
S1 --> EXP[Sampled exposure events]
Runtime evaluation model
Each flag is a small document: variations (on/off, or variants like A/B), an ordered rule list, a default, and a version number. The SDK evaluates in a fixed order:
- Kill switch / flag off → return the off variation. Checked first so nothing else can override it.
- Individual targets (explicit user IDs).
- Segment rules in order ("in segment
beta-testers" →on). - Percentage rollout on the fallthrough (reached only if none of the rules above matched): hash bucket below the threshold →
on. - Default.
Traced example: user user-000004 requests the new-checkout flag at a live 25% rollout. Step 1, the kill switch: not tripped. Step 2, individual targets: user-000004 is not on the explicit list. Step 3, segments: not a member of any targeted segment. Step 4, percentage rollout: bucket("new-checkout", "s1", "user-000004") comes out to 1,531, and 1,531 is below the 25% threshold of 2,500, so the flag resolves to on right here. Step 5, the default, is never reached for this user.
A global kill switch is a special entry in the rule set ("emergency: all flags tagged checkout return their off variation") that the SDK checks before any flag, so one change disables a whole feature area.
Browsers and mobile apps should not receive the full rule set (it exposes targeting logic and user lists), so they call a thin server-side evaluation endpoint on the relay that returns only their evaluated values.
Deterministic percentage rollouts
Hash flag_key : salt : user_id into 10,000 buckets (the salt is an arbitrary fixed string with no meaning of its own beyond changing the hash's output); the user is in a 25% rollout when their bucket is below 2,500. Including the flag key means different flags pick independent user groups; the salt lets you deliberately reshuffle a flag.
import hashlib
def bucket(flag_key, salt, user_id):
"""Map (flag, user) to a stable bucket in [0, 10000)."""
h = hashlib.sha256(f"{flag_key}:{salt}:{user_id}".encode()).digest()
return int.from_bytes(h[:8], "big") % 10_000
def in_rollout(flag_key, salt, user_id, percent):
return bucket(flag_key, salt, user_id) < percent * 100 # 25% -> buckets 0..2499
users = [f"user-{i}" for i in range(100_000)]
at10 = {u for u in users if in_rollout("new-checkout", "s1", u, 10)}
at25 = {u for u in users if in_rollout("new-checkout", "s1", u, 25)}
other = {u for u in users if in_rollout("new-search", "s1", u, 10)}
print("10% cohort:", len(at10), " 25% cohort:", len(at25))
print("everyone in 10% still in 25%:", at10 <= at25)
print("overlap with a different flag's 10%:", len(at10 & other))
Output (Python 3, run as shown):
10% cohort: 9997 25% cohort: 25083
everyone in 10% still in 25%: True
overlap with a different flag's 10%: 986
Raising a rollout from 10% to 25% only adds users (nobody who had the feature loses it), and a second flag's 10% overlaps this one's at about 10% of 10% (986 of 100,000), which is what independent selection looks like. Every SDK in every language must implement the identical hash, so the algorithm is part of the service's contract and is covered by cross-language test vectors (the same fixed set of (flag, salt, user) inputs and their expected bucket numbers, run against every language's SDK, so a Python evaluation and a Java evaluation of the same user never disagree).
How a change propagates
- Admin saves a change. The control plane validates it (schema, no dangling segment references, approval if the flag is tagged production-critical), writes flag version N+1 and a change-log entry in one transaction, then publishes to the change stream.
- It also writes a full versioned snapshot to object storage (fronted by a CDN, content delivery network), used for SDK bootstrap and as a fallback.
- Regional relays consume the stream and push the delta (only what changed since the SDK's last known version, not the whole rule set) to every connected SDK over SSE. Each message carries the version, and the SDK ignores anything older than what it has, so reordering or replays are harmless.
- If the stream drops, the SDK keeps evaluating on its current rules, reconnects with backoff, and falls back to polling the snapshot. It never goes blank: an SDK that has not loaded rules yet returns the code-level default for every flag, which must be the safe value.
Worked example: capacity arithmetic
Inputs (assumptions to state in the interview): 20,000 application instances running the SDK, 2,000 flags, about 2 KiB per flag document, exposure events sampled at 1%.
evals_per_s = 1_000_000
sdk_instances = 20_000 # app processes running the evaluator (assumption)
flags, bytes_per_flag = 2_000, 2_048
ruleset = flags * bytes_per_flag
print(f"per-instance eval rate: {evals_per_s / sdk_instances:.0f}/s")
print(f"full ruleset: {ruleset / 2**20:.1f} MiB held in memory per instance")
print(f"one flag change fanned out to all instances: {sdk_instances * bytes_per_flag / 2**20:.1f} MiB")
print(f"full resync of every instance (e.g. after a relay restart): {sdk_instances * ruleset / 2**30:.1f} GiB")
exposure_sample = 0.01
print(f"exposure events at 1% sampling: {evals_per_s * exposure_sample:,.0f}/s")
changed_since_reconnect = 5 # flags changed while an SDK was briefly disconnected (assumption)
delta_bytes = changed_since_reconnect * bytes_per_flag
print(f"delta resume after missing {changed_since_reconnect} changes: {delta_bytes / 2**10:.1f} KiB per instance, "
f"vs the {ruleset / 2**20:.1f} MiB full ruleset ({ruleset / delta_bytes:.0f}x less)")
print(f"same delta, fleet-wide: {sdk_instances * delta_bytes / 2**20:.1f} MiB vs the {sdk_instances * ruleset / 2**30:.1f} GiB full resync")
Output (Python 3, run as shown):
per-instance eval rate: 50/s
full ruleset: 3.9 MiB held in memory per instance
one flag change fanned out to all instances: 39.1 MiB
full resync of every instance (e.g. after a relay restart): 76.3 GiB
exposure events at 1% sampling: 10,000/s
delta resume after missing 5 changes: 10.0 KiB per instance, vs the 3.9 MiB full ruleset (400x less)
same delta, fleet-wide: 195.3 MiB vs the 76.3 GiB full resync
What this tells you: evaluation load is trivial (50 per second per instance), memory is small (about 4 MiB), and a normal change is cheap (about 39 MiB of fan-out). The dangerous number is the 76.3 GiB full resync: if every SDK reconnects at once and downloads everything from the relays, that is a thundering herd (a mass of clients all retrying the same operation at the same moment, turning ordinary load into a spike large enough to overwhelm whatever they are hitting). Mitigations: SDKs reconnect with jittered backoff (waiting a random, growing interval before retrying, so reconnects do not all land on the same instant), resume with "I have version N, send deltas" (5 changed flags costs 10.0 KiB per instance against the 3.9 MiB full ruleset, about 400x less, and 195.3 MiB fleet-wide against the 76.3 GiB full resync), and bootstrap full snapshots from the CDN rather than the relays.
Storage and caching
- Source of truth: one relational database in a primary region (flag documents keyed by
(flag_key, version), never updated in place). Writes are rare (humans making changes), so single-region writes are fine; reads never touch it on the evaluation path. - Regional caches: relays hold the current rule set in memory, rebuilt from the latest snapshot on start. The SDK's in-memory copy is the cache that serves all traffic.
- Multi-region: if the primary region is down, evaluation continues everywhere on last-known rules; only editing is unavailable. That is the right trade: editing flags during a regional outage is rare and can use a documented break-glass path in a standby region.
Audit trail and fast rollback
- The change log is append-only: actor, time, flag, old and new version, diff, reason or ticket link, approvals. Nobody, including admins, can edit or delete an entry; it is streamed to the company's audit store as well.
- Rollback = publish the previous version as N+2. Because versions are immutable, "restore version 41" is one click and propagates at the same speed as any change (seconds), and the rollback itself appears in the audit log.
- Kill switch for emergencies needs no approval and flips the flag to off; everything else can require review.
Trade-offs and pitfalls
- Local evaluation vs central evaluation. Central evaluation (every check is an RPC, remote procedure call) makes the flag service a dependency of every request: 1M requests per second of load, a network hop on every call, and an outage takes down every product. Local evaluation costs rule distribution and a multi-language SDK effort. At this scale local wins; with only a few services and low volume, a central endpoint would be simpler.
- Large list segments (millions of user IDs) do not fit in every SDK. Keep those as server-side segment lookups or push them only to services that need them.
- Stale flags accumulate as debt: track last-evaluated time from exposure events and nag owners of flags that have been 100% on for 30 days.
- Consistency across a request: two services may briefly see different versions during a push. For flows where that matters, evaluate once at the edge and pass the result downstream in a header.
Explain how Kubernetes service discovery works for ClusterIP and headless services. Given YAML expressed inline as apiVersion: v1; kind: Service; metadata.name: backend; spec.clusterIP: None; selector.app: backend, describe how DNS records are created, how clients discover endpoints (A vs SRV), and when to use headless services vs ClusterIP.
Sample Answer
Direct answer
A Kubernetes Service is a stable name for a changing set of pods (pod: Kubernetes' smallest deployable unit, one or more containers that run and are scheduled together) picked by a label selector (a rule that matches objects by their key/value labels, such as app=backend). The cluster DNS server (CoreDNS in most clusters) publishes a record for it. For a normal ClusterIP service, the name resolves to one virtual IP, and the node's networking layer spreads connections across the pods behind it. For a headless service (clusterIP: None, like the backend example), there is no virtual IP: the name resolves directly to the IP of every ready pod, so the client sees the individual pods and chooses among them itself. Use ClusterIP by default; use headless when the client must address specific pods (databases, StatefulSets) or balance per request itself (gRPC).
The example
Written out as YAML, the service in the question is:
apiVersion: v1
kind: Service
metadata:
name: backend
spec:
clusterIP: None # this line makes it headless
selector:
app: backend # pods carrying label app=backend are its endpoints
How the records get created
- The EndpointSlice controller watches pods matching
app=backendand writes their IPs (and whether each is ready, i.e. passing its readiness probe, a periodic check the kubelet, the per-node agent that runs and monitors pods, performs against the pod to decide if it should receive traffic) into EndpointSlice objects. - CoreDNS watches Services and EndpointSlices through the Kubernetes API and answers queries from that in-memory view. Nothing is written to a zone file; records change as soon as CoreDNS sees the update.
- Names follow the pattern
<service>.<namespace>.svc.<cluster-domain>, where the cluster domain is usuallycluster.local. Inside the same namespace, a pod can just usebackend, because its resolver search path (a list of domain suffixes the pod's DNS client tries in order, configured automatically by Kubernetes) fills in the rest.
Say backend lives in namespace shop and has three ready pods at 10.244.1.5, 10.244.2.7 and 10.244.3.9. (The SRV row below assumes the service declares a named port; the note right after the table covers what changes for the question's actual YAML, which declares none.)
| Query | ClusterIP service (clusterIP auto-assigned, say 10.96.40.12) | Headless service (clusterIP: None) |
|---|---|---|
A record for backend.shop.svc.cluster.local | one answer: 10.96.40.12 | three answers: 10.244.1.5, 10.244.2.7, 10.244.3.9 (ready pods only) |
| Per-pod A records | none | <hostname>.backend.shop.svc.cluster.local for each pod; pods without an explicit hostname get a system-assigned name (CoreDNS uses the dashed IP, such as 10-244-1-5) |
SRV record for _http._tcp.backend.shop.svc.cluster.local | one record: port 8080, target backend.shop.svc.cluster.local | one record per ready pod, each targeting that pod's own name |
Important detail about the question's YAML: it declares no ports. SRV records are only published for named ports, so this exact service has A records but no SRV records. Adding
ports:
- name: http
port: 8080
protocol: TCP
creates _http._tcp.backend.shop.svc.cluster.local. With N ready pods and M named ports, a headless service publishes N x M SRV records.
How clients discover endpoints: A vs SRV
- A lookup (what almost every client does): resolve the name, get IP addresses, connect to a port the client already knows (from config). With ClusterIP you always get the same single IP, which is simple and cache-safe. With headless you get the current pod list and must pick one yourself.
- SRV lookup: resolve
_http._tcp.backend...and get the port and target name as well, so the port does not have to be configured separately. Useful for clients that support SRV and for services whose port differs by environment. Most HTTP libraries do not look up SRV, so treat it as an option, not the default.
What actually happens on a ClusterIP connection
The ClusterIP is not a real machine. kube-proxy (the per-node component that programs each node's packet-forwarding rules for Services) or an eBPF replacement such as Cilium (eBPF: a way to run small, fast programs inside the Linux kernel to handle packets, which projects like Cilium use instead of kube-proxy's traditional rules) programs rules on every node so that a packet sent to 10.96.40.12:8080 is rewritten to one of the pod IPs. That choice happens per connection. So a client holding one long-lived connection (gRPC, a framework built on HTTP/2 that keeps one TCP connection open and sends many requests over it instead of opening a new connection per request; or a database connection pool) sticks to one pod for every request on that connection, which is the main reason people reach for headless services: the client, not the cluster's per-connection routing, gets to decide where each request goes.
When to use which
| Use ClusterIP when | Use headless when |
|---|---|
| clients are ordinary HTTP services that open many short connections | clients need a stable identity per pod (StatefulSet: a Kubernetes workload type that gives each of its pods a stable, numbered name and stable storage instead of treating them as interchangeable, e.g. db-0, db-1 for replication or Kafka brokers, the server processes that make up a Kafka message-queue cluster, each one individually addressable) |
| you want the cluster to hide pod churn completely | the client does its own per-request load balancing across long-lived connections (gRPC client-side balancing) |
| DNS caching in the client is uncontrolled (a single stable IP never goes stale) | a peer-discovery protocol needs to list all members (clustered caches, databases forming a quorum: a majority of members that must agree before the group accepts a decision, such as electing a leader) |
Pitfalls
- Client DNS caching with headless services. Some runtimes cache DNS answers for a long time (older JVM, the Java Virtual Machine that runs Java programs, settings were the classic case: it cached a resolved name indefinitely by default unless configured otherwise). The pod list then goes stale and traffic keeps hitting pods that are gone. Set a short cache time and re-resolve periodically.
- Not-ready pods are hidden. Headless DNS returns ready pods only. For clusters that must find peers before they are ready (bootstrapping a quorum), set
publishNotReadyAddresses: trueon the service. - No ports means no SRV, as above. It is a common surprise when a client expects SRV.
- Headless does not balance anything. If the client just takes the first IP, all traffic lands on one pod.
Unlock Full Question Bank
Get access to all 15 Service Discovery and Configuration Management interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.