LearnThatStack Ace your next interview
Database Technologies

Elasticsearch.

Start free Change topic Change
Practice · Questions

All questions

Showing of 49
Beginner 13
01

What is Elasticsearch and what are its main use cases?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Elasticsearch is a distributed search and analytics engine built on Apache Lucene. It stores data as JSON documents behind a RESTful API, and new data becomes searchable in near real time, within about one second. It scales horizontally by adding nodes, and it keeps copies of the data on several nodes for reliability.

Its main use cases are:

  • Full-text search on websites, documents and e-commerce products.
  • Log analytics on application, system and security logs, often with the ELK stack of Elasticsearch, Logstash and Kibana.
  • Real-time analytics, such as business metrics and application performance monitoring.
  • Data aggregation for complex analysis and reporting.
  • Geospatial search and analytics by location.

You search and analyze the data with the Query DSL, a JSON-based query language.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

Explain the basic architecture of Elasticsearch.

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Elasticsearch stores data in indices, splits each index into shards, and spreads the shards over the nodes of a cluster. Its building blocks are:

  • A node is a single running instance of Elasticsearch.
  • A cluster is a collection of nodes that work together.
  • An index is a collection of documents with similar characteristics. In relational terms it is closer to a table than to a database.
  • A document is the basic unit of information, stored as JSON.
  • A shard is a subset of an index's data. Elasticsearch distributes the shards across the nodes.
  • A replica is a copy of a primary shard. It adds redundancy and also serves searches, which raises search throughput.

A replica never sits on the same node as its primary. In the layout below, Index A has two primary shards and Index B has one, and every primary has a replica on another node. So losing any one node loses no data.

Cluster
├── Node 1
│   ├── Index A (Primary Shard 0)
│   └── Index A (Replica Shard 1)
├── Node 2
│   ├── Index A (Primary Shard 1)
│   └── Index B (Primary Shard 0)
└── Node 3
    ├── Index A (Replica Shard 0)
    └── Index B (Replica Shard 0)
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

What is the difference between Elasticsearch and traditional relational databases?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Elasticsearch is built to search and analyze data across many machines, while a relational database stores records and changes them safely in transactions. Elasticsearch keeps denormalized JSON documents spread over nodes. A relational database keeps normalized rows in tables and joins them at query time.

Elasticsearch Relational database
Data model Document-oriented JSON Tables with rows and columns
Schema Flexible Fixed
Scaling Horizontal, by adding nodes Mostly vertical
Guarantees Near real-time search ACID transactions
Relationships Denormalized data Normalized data with JOINs
Interface RESTful API SQL queries
Workload Optimized for read-heavy search Balanced reads and writes

Elasticsearch is the better fit for search, analytics and unstructured data. A relational database is the better fit for transactional work that needs ACID properties, such as orders and payments. Many systems use both. The database stays the source of truth, and Elasticsearch holds a copy of the data for search.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

How do you perform CRUD operations on documents?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

You perform CRUD on Elasticsearch documents with the document APIs. Each operation is one HTTP request to a path made of the index name and the document ID.

To create a document, or replace it if the ID exists, send PUT with the JSON body. This is called indexing a document.

PUT /users/_doc/1
{
  "name": "John Doe",
  "email": "john@example.com",
  "age": 30
}

To read it, send GET to the same path.

GET /users/_doc/1

To change only some fields, use the update API. It merges the partial doc into the stored document.

POST /users/_update/1
{
  "doc": {
    "age": 31
  }
}

To delete it, send DELETE to the same path.

DELETE /users/_doc/1

For many documents, the bulk API sends many operations in one request. The body is newline-delimited JSON, with an action line before each document. Bulk requests are much faster than one request per document, which matters for large loads.

POST /_bulk
{"index": {"_index": "users", "_id": "1"}}
{"name": "Alice", "age": 25}
{"index": {"_index": "users", "_id": "2"}}
{"name": "Bob", "age": 30}
Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What is the difference between index and create operations?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

The index operation writes a document whether or not its ID already exists, while the create operation writes it only if the ID is new.

  • Index, PUT /index/_doc/id, creates a new document or replaces the entire existing one. Each replace increments the document's _version.
  • Create, PUT /index/_create/id, only creates a new document. If a document with the same ID exists, it fails with a 409 Conflict error. The index API gives the same check with op_type=create.

Use create when a duplicate ID would be a bug, such as writing events that must be stored once. Use index when the latest version should win.

# Index - will replace if exists
PUT /users/_doc/1
{"name": "John", "age": 30}

# Create - will fail if ID 1 exists
PUT /users/_create/1
{"name": "Jane", "age": 25}

Run in this order, the second request fails, because the first one already wrote ID 1.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

Explain the Query DSL and its main components.

Part of Pro
07

What is the difference between match and term queries?

Part of Pro Visual
08

What is mapping in Elasticsearch and why is it important?

Part of Pro
09

What are the main field data types in Elasticsearch?

Part of Pro
10

What is the difference between text and keyword field types?

Part of Pro
11

What is the analyze API and how is it used?

Part of Pro
12

What is an inverted index and why is it fast?

Part of Pro
13

What is the ELK Stack and what does each part do?

Part of Pro
Intermediate 30
14

What is the difference between Elasticsearch and OpenSearch?

Part of Pro
15

What are the different types of nodes in Elasticsearch?

Part of Pro
16

Explain sharding in Elasticsearch. What are primary and replica shards?

Part of Pro Visual
17

How does Elasticsearch achieve high availability?

Part of Pro Visual
18

Explain document versioning in Elasticsearch.

Part of Pro Visual
19

What are the different refresh options in Elasticsearch?

Part of Pro Visual
20

How does scoring work in Elasticsearch?

Part of Pro
21

What is the difference between query then fetch and DFS query then fetch?

Part of Pro
22

What are compound queries in Elasticsearch?

Part of Pro
23

Explain dynamic mapping in Elasticsearch.

Part of Pro
24

What are analyzers and how do they work?

Part of Pro
25

How would you create a custom analyzer?

Part of Pro Visual
26

What are aggregations in Elasticsearch, and what are their types?

Part of Pro Visual
27

How do you perform date histogram aggregations?

Part of Pro
28

Explain nested aggregations with an example.

Part of Pro
29

How do you monitor Elasticsearch cluster health and performance?

Part of Pro
30

How do you secure an Elasticsearch cluster?

Part of Pro
31

What is Index Lifecycle Management (ILM)?

Part of Pro
32

What are aliases in Elasticsearch and how are they used?

Part of Pro
33

Explain the concept of index templates.

Part of Pro
34

What are Elasticsearch snapshots and how do you implement backup strategies?

Part of Pro
35

How do you implement search suggestions and autocomplete in Elasticsearch?

Part of Pro Visual
36

What is the difference between query context and filter context?

Part of Pro
37

How do you change a mapping that can't be updated in place?

Part of Pro
38

How do you model relationships when Elasticsearch has no joins?

Part of Pro Visual
39

How do you paginate deeply without the from and size penalty?

Part of Pro
40

How does Elasticsearch support vector and semantic search?

Part of Pro
41

What are doc values and why do they matter?

Part of Pro Visual
42

What is the difference between Elasticsearch and Solr?

Part of Pro
43

Explain hot-warm-cold architecture in Elasticsearch.

Part of Pro Visual
Expert 6
44

What is the split-brain problem and how does Elasticsearch prevent it?

Part of Pro Visual
45

What are the best practices for Elasticsearch performance optimization?

Part of Pro
46

What is the difference between index and search performance tuning?

Part of Pro
47

How do you scale an Elasticsearch cluster?

Part of Pro
48

Walk through what happens internally when you index a document.

Part of Pro
49

How do you debug a slow search query in Elasticsearch?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for Elasticsearch? Send them this set.
Pro · $10/mo

44 of 49 Elasticsearch answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git