Most Asked Consul Interview Questions for Freshers (2027)
38 most asked HashiCorp Consul interview questions for freshers: servers, Raft, gossip, ports, DNS, health checks, KV, ACLs and mesh.
The most asked HashiCorp Consul interview questions for freshers cover what Consul does (service discovery, health checking, key/value storage and service mesh), how servers and clients work together with Raft and gossip, the default ports, Consul DNS names such as web.service.consul, and a handful of CLI commands you should be able to type from memory. This page answers 38 of those questions, grouped by level, with beginner scenarios at the end.
It is the entry-level page in our Consul series. Working engineers should move on to the Consul engineer interview questions, which cover multi-datacenter design, ACL strategy and mesh troubleshooting. Facts were checked against HashiCorp's Consul documentation and the Consul release notes in November 2026. The current release is Consul 2.1.0, published on 21 October 2026.
Key takeaways
- Consul provides service discovery, health checks, a key/value store and a service mesh with mutual TLS.
- Every node runs a Consul agent in server or client mode. Servers store state and replicate it with the Raft consensus protocol. Agents find each other and detect failures with gossip (Serf).
- Run 3 or 5 servers per datacenter. A cluster needs a quorum of (N/2)+1 servers to accept writes.
- Default ports: 8500 HTTP API, 8600 DNS, 8300 server RPC, 8301 LAN gossip, 8302 WAN gossip. HTTPS (8501) and plain gRPC (8502) are off by default, and gRPC with TLS uses 8503.
- Services can be found over DNS or the HTTP API. Unhealthy instances are left out of DNS answers.
- Freshers are usually tested on concepts and simple commands, not on enterprise features.
Consul default ports
| Use | Default port | Protocol | Enabled by default |
|---|---|---|---|
| HTTP API and UI | 8500 | TCP | Yes |
| HTTPS API | 8501 | TCP | No |
| gRPC (plain) | 8502 | TCP | No |
| gRPC with TLS | 8503 | TCP | Yes |
| DNS | 8600 | TCP and UDP | Yes |
| Server RPC | 8300 | TCP | Yes |
| LAN gossip (Serf) | 8301 | TCP and UDP | Yes |
| WAN gossip (Serf) | 8302 | TCP and UDP | Yes |
Consul interview questions for freshers
1. What is HashiCorp Consul?
Consul is a networking tool that keeps a registry of services and their health, answers lookups over DNS and HTTP, stores key/value configuration, and can act as a service mesh that encrypts and authorises service-to-service traffic. It runs on virtual machines, bare metal and Kubernetes.
2. What is service discovery?
Service discovery lets an application find the current network address of another service by name instead of a hard-coded IP. In Consul, services register with the catalog, and clients ask Consul for healthy instances of, for example, payments.
3. What is a Consul agent?
The long-running Consul process on every node. It registers local services, runs their health checks, takes part in gossip and forwards queries to servers. It starts with consul agent and a configuration file or flags.
4. What is the difference between a server and a client agent?
Servers store the catalog, KV data and ACLs, take part in Raft and elect a leader. Clients are lightweight: they run checks, register services and forward requests to servers. A datacenter normally has 3 or 5 servers and many clients.
5. Why 3 or 5 servers rather than 2 or 4?
Raft needs a majority, (N/2)+1, to commit writes. Three servers tolerate one failure and five tolerate two. Four servers still tolerate only one failure, so an even number adds cost without adding fault tolerance.
6. What is Raft in Consul?
Raft is the consensus protocol servers use to agree on one ordered log of changes. One server is the leader and replicates entries to followers. If the leader fails, the remaining servers elect a new one, provided a quorum is still available.
7. What is gossip in Consul?
Consul uses Serf, a gossip protocol, so agents learn about members and detect failures without a central checker. The LAN gossip pool covers all agents in a datacenter. The WAN pool connects servers across datacenters.
8. What is a datacenter in Consul?
A datacenter is a private, low-latency network with its own set of servers and LAN gossip pool. Several datacenters can be joined over WAN gossip so services can be found across them.
9. How do you start Consul for local practice?
consul agent -dev starts a single in-memory server with the UI on port 8500. It is for learning only: nothing persists and security is not configured.
consul agent -dev
consul members
consul catalog services
10. How do you register a service?
Write a service definition file and load it with consul services register, place it in the agent's config directory, or call the HTTP API. Include a name, port and at least one health check.
service {
name = "web"
port = 8080
check {
http = "http://localhost:8080/health"
interval = "10s"
timeout = "2s"
}
}
11. How do you look up a service with Consul DNS?
Query the agent's DNS port, which is 8600 by default: dig @127.0.0.1 -p 8600 web.service.consul. For ports as well as addresses, ask for SRV records. To use plain names from applications, forward the .consul domain from your system resolver to Consul.
12. What health check types does Consul support?
Common types include HTTP, TCP, gRPC, script (runs a command), TTL (the application reports in before the time runs out), Docker and alias checks. A failing check marks the instance critical, and Consul drops it from DNS answers.
13. What is the Consul key/value store used for?
Small configuration values, feature flags, leader locks and coordination data. It is not a general database. Use consul kv put app/config/max_conn 100 and consul kv get app/config/max_conn.
14. What does the Consul UI show?
Services and their health, nodes, KV entries, intentions and ACLs, served from the HTTP port. In development mode it is at http://localhost:8500/ui.
Questions for 1 to 3 years of experience
15. What is the Consul catalog?
The servers' record of every node, service and check in the datacenter. Agents keep it up to date through anti-entropy: each agent compares its local services with the catalog and corrects differences.
16. What is the Consul service mesh?
Consul can give each service an identity and a sidecar proxy, usually Envoy. Proxies encrypt traffic with mutual TLS and enforce intentions. Applications talk to their local proxy, and the proxies handle security and routing.
17. What are intentions?
Rules that allow or deny traffic from one service to another, such as "web may call api". They are stored as service-intentions configuration entries. With a default-deny posture, only listed connections work.
18. What is the Consul ACL system?
ACLs control who can read or change data in Consul. Tokens are linked to policies (and optionally roles) that grant rules on services, keys, nodes and other resources. You start with consul acl bootstrap, which creates the initial management token.
19. How is gossip traffic encrypted?
Generate a key with consul keygen and set it as the encrypt value on every agent. That covers Serf gossip. RPC and HTTP traffic need TLS certificates, which consul tls commands can create for test setups.
20. What are prepared queries?
Stored lookups that can filter services by tags or health and fail over to other datacenters when local instances are unavailable. They are queried as name.query.consul over DNS or through the HTTP API.
21. What do service tags do?
Tags are labels on a service instance, such as v2 or primary. You can filter on them in API queries and DNS, for example primary.db.service.consul.
22. How does Consul run on Kubernetes?
HashiCorp provides a Helm chart and the consul-k8s CLI. Servers run as a StatefulSet. Services can be synced between Kubernetes and the Consul catalog, and mesh workloads use Envoy sidecars managed through Consul Dataplane rather than client agents.
23. What is Consul Dataplane?
A lightweight process that manages the Envoy proxy and connects it to Consul servers over gRPC, without running a full client agent on each node. The ports page notes dataplanes connect on the gRPC port.
24. How do Consul and Vault differ?
Consul handles service networking: discovery, health and mesh. Vault manages secrets, encryption and dynamic credentials. Vault can use Consul as a storage backend, and Consul's mesh can use Vault as its certificate authority. Our Vault interview questions cover that side.
25. What does consul members show?
The agents in the LAN gossip pool with their address, status (alive, left, failed), type (server or client) and datacenter. consul members -wan lists servers in the WAN pool.
26. How do you check which server is the Raft leader?
Run consul operator raft list-peers. It lists servers, their Raft state and whether each is a voter.
Questions that test understanding
27. What happens if a client agent fails?
Gossip detects the failure, the node is marked failed, and services on it become unhealthy so they drop out of DNS. Servers and other clients keep working.
28. What happens if a cluster loses quorum?
Servers cannot elect a leader or commit writes. Reads may still work depending on consistency settings, but registrations and KV writes fail. You restore quorum by bringing servers back or by following the documented outage recovery process.
29. What are the consistency modes for reads?
Default mode reads from the leader with a small chance of stale data during leader change. consistent confirms leadership with a quorum first, at extra latency. stale lets any server answer, which scales reads but may return slightly old data.
30. What is anti-entropy?
The process by which each agent periodically syncs its local view of services and checks with the catalog, so the catalog matches what is really running.
31. How does Consul compare with Kubernetes service discovery?
Kubernetes DNS works inside one cluster. Consul works across clusters, VMs and datacenters, adds health-based filtering for non-Kubernetes workloads, and offers a mesh with intentions. Many teams use both.
32. Why should freshers learn Consul at all?
It appears in hybrid environments that mix VMs and Kubernetes, and in stacks built with Terraform and Vault. Knowing service discovery and health checks also helps with any mesh or load balancer job.
33. What is a blocking query?
An HTTP API request with an index parameter that waits until data changes or a timeout passes. Tools such as consul-template use blocking queries to react to changes without constant polling.
34. What is the difference between leave and fail?
A graceful consul leave tells the cluster the agent is going away, so it is removed cleanly. A failure is detected by gossip when the agent stops responding. Failed nodes stay listed for a while in case they come back.
Beginner scenarios
35. dig returns nothing for web.service.consul.
Check you queried port 8600, that the service is registered (consul catalog services), and that its health check passes. Critical instances are not returned.
36. A new agent cannot join the cluster.
Confirm ports 8301 TCP and UDP are open between nodes, the datacenter name matches, and the gossip encryption key is the same on every agent. Use retry_join in config instead of manual joins.
37. Writes fail with "No cluster leader".
Quorum is lost or servers cannot reach each other on 8300. Check how many servers are up with consul operator raft list-peers and fix network or restart servers.
38. Someone asks to run one Consul server in production.
Explain that one server has no fault tolerance: losing it stops all writes. Recommend three servers spread across failure zones.
How to practise
Run a dev agent, register two services with HTTP checks, stop one service and watch DNS answers change. Then try the Consul FAQs for DevOps interviews, the scenario-based Consul questions and the Consul interview preparation guide. The 200 DevOps interview questions hub covers the wider stack.
Consul often sits next to Terraform in HashiCorp toolchains. The Terraform training and the DevOps training run in our Kharadi, Pune classroom and live online.
Frequently asked questions
What is Consul used for?
Service discovery, health checking, key/value configuration and a service mesh with mutual TLS and intentions.
What port does Consul use?
8500 for the HTTP API and UI, 8600 for DNS, 8300 for server RPC, and 8301 and 8302 for LAN and WAN gossip.
How many Consul servers should I run?
Three or five per datacenter. Three tolerate one failure, five tolerate two.
What is the difference between Consul server and client?
Servers store state and run Raft. Clients register services, run health checks and forward requests to servers.
What is the latest Consul version?
Consul 2.1.0, released on 21 October 2026.
Is Consul only for Kubernetes?
No. It runs on VMs and bare metal as well, and is often used to connect workloads across both.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0