In this article
How to use this list
Read each question, say your own answer aloud, then read the answer below it. Each answer follows the primary pages listed under sources. Check version details against your own project's AEM version. For the habits that carry across every technical round, see the coding interview guide.
The role and Sling Models
What does an AEM backend developer do?
An AEM backend developer writes the Java side of an AEM site: models that expose content to components, services, servlets, and the configuration that connects them. They also work with the caching layer in front of the site. In an interview, say which parts you have built yourself, such as a model, a service or a Dispatcher rule, rather than listing the whole platform.
Why it is asked: it shows how much you have owned. Read the full explanation: Java interview questions for the language base.
What is a Sling Model?
A Sling Model is a plain old Java object (POJO) that is mapped automatically from a Sling object, typically a resource but also a request. It can also receive services from the OSGi framework. In the simplest case the class is annotated with @Model and the type it can be adapted from (from the documentation: Apache Sling, Sling Models).
Why it is asked: models are where most component logic lives. Read the full explanation: Sling Models documentation.
What does adaptables mean in @Model?
The adaptables value declares what the model can be created from. The documentation's simplest example is @Model(adaptables=Resource.class), and it notes that adaptables can be a resource or a request. Which one you pick is largely set by the injectors you need: a model that only reads properties can adapt from a resource, while one that needs request data must adapt from the request.
@Model(adaptables = Resource.class)
public class TitleModel {
@ValueMapValue
private String propertyName;
}Why it is asked: it checks that you know where injection data comes from. Read the full explanation: Sling Models documentation.
How does a model read a property from the component's content?
Annotate a field with @ValueMapValue. The documentation says a property named after the field, here propertyName, is looked up from the resource, after it is first adapted to a ValueMap, and then injected. In the code above, the field receives the stored value of that property when the model is created.
Why it is asked: it is the most common model task. Read the full explanation: Sling Models documentation.
How does a model use an OSGi service?
Use @OSGiService, which injects an OSGi service by type, with an optional filter (from the documentation: Sling Models documentation). The service must exist as a registered component for the injection to succeed. Keep heavy logic in the service and let the model only shape data for the component.
Why it is asked: it tests separation between presentation models and business logic. Read the full explanation: Sling Models documentation.
Can a Sling Model use constructor injection?
Yes, but the documentation says a constructor is used for injection only if it is annotated on method level with @Inject. Without an @Inject constructor, the model is built through its default constructor (or one that takes the adaptable), and field injection still happens. Constructor injection helps keep injected values final and makes the class easier to test.
Why it is asked: it separates people who read the documentation from people who copy snippets. Read the full explanation: Sling Models documentation.
How do you make injected fields optional, and what does @PostConstruct do?
Injected fields are required by default, so a missing property makes the model fail to be created. Setting defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL on @Model, or marking a single field @Optional, lets the model be created with a missing value. A method annotated @PostConstruct runs after injection, so it is the place for initialisation logic that needs the injected values (see Sling Models documentation).
Why it is asked: missing optional content is the most common model bug. Read the full explanation: Sling Models documentation.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →Dispatcher and caching
What is the Dispatcher, and is it just a load balancer?
The Dispatcher is Adobe Experience Manager's caching and load-balancing tool, used with an enterprise-class web server. It is not only a load balancer. The Adobe documentation says static content is handled with the speed and ease of a static web server, while dynamic content is generated as needed. Load balancing is the practice of distributing the computational load of the website across several instances of AEM (from the documentation: Adobe, Dispatcher, last updated March 2026).
Why it is asked: it checks that you know the cache is part of the architecture. Read the full explanation: Adobe Dispatcher documentation.
How does the Dispatcher cache a page?
The Adobe documentation says the Dispatcher "places the cached documents in the root of the Web server". A later request for the same path can then be served by the web server without reaching AEM (from the documentation: Adobe Dispatcher documentation).
Why it is asked: it tests whether you can reason about where a request is answered. Read the full explanation: Adobe Dispatcher documentation.
How does cache invalidation work, and are files deleted?
It depends on the mechanism. On a content update, the Dispatcher deletes the changed files from the cache. With auto-invalidation, for the file types listed in the /invalidate rules, it deletes nothing: AEM touches the statfile, a file whose timestamp reflects the last content update, in the nearest parent folder. A cached file older than the statfile is treated as out of date and fetched again on the next request. Documents without auto-invalidation stay in the cache until they are physically deleted, for example by a content update (from the documentation: Adobe Dispatcher documentation).
Why it is asked: invalidation is the classic source of "why is the page stale" questions. Read the full explanation: Adobe Dispatcher documentation.
Why might cached pages lose their HTTP headers?
Without a configuration for Hypertext Transfer Protocol (HTTP) header caching, the Dispatcher stores only the HTML code of the page and does not store the HTTP headers (from the documentation: Adobe Dispatcher documentation). A page then comes from the cache without headers that AEM set when it rendered the page. The fix is to configure header caching for the headers you need.
Why it is asked: it is a common production surprise. Read the full explanation: Adobe Dispatcher documentation.
What should not be cached?
Responses that differ per user, such as personalised or logged-in content, should not be served from a shared page cache, because one visitor's response could reach another. A strong answer names the cache rule you would use to exclude them, and says that such content is better loaded through a separate request that is not cached. The rules themselves live in the Dispatcher configuration.
Why it is asked: it tests judgement about correctness against speed. Read the full explanation: Configuring the Dispatcher.
Platform concepts
What are OSGi bundles and services in AEM?
AEM runs on the OSGi framework. Your Java code is packaged as bundles, and bundles register components that other code can use as services, with configuration supplied from outside the code. A good answer explains why: bundles can be started and updated independently, and services keep code loosely coupled. Compare this with dependency injection in Spring Boot.
Why it is asked: nearly every AEM backend task touches a service. Read the full explanation: OSGi Component Service specification.
How do you write an OSGi component with Declarative Services?
Annotate the class with @Component so it is registered as a service, and use @Reference to receive another service. Configuration comes from outside the code: a component can read an OSGi configuration. The model is defined in the OSGi component specification (OSGi Component Service specification). The Sling documentation says OSGi Declarative Services (DS) 1.4 (R7) component property type annotations are the current approach, and the DS 1.2 annotations are the fallback only if you cannot use that approach (Apache Sling, servlets).
Why it is asked: it shows you can build a service, not only inject one. Read the full explanation: OSGi Component Service specification.
How does Sling turn a URL into a script or component?
Sling is content-first. It decomposes the URL into a path, selectors, an extension and a suffix, resolves the path to a resource in the content tree, then uses that resource's resource type together with the selectors, extension and request method to choose the script or servlet that renders it (see Apache Sling, URL decomposition). Be ready to walk one URL through this path, and to say what you would check when the wrong script is chosen.
Why it is asked: it shows whether you understand the request flow, not only the annotations. Read the full explanation: Sling URL decomposition.
What is the JCR, and how does Oak relate to it?
The Java Content Repository (JCR) is a standard interface for a tree of nodes with properties, and AEM stores its content in such a repository. Oak is the repository implementation AEM uses, and it provides the query engine and indexes behind JCR queries (Apache Jackrabbit Oak, query engine). Content is addressed by path, which is why a resource's path and its properties are what Sling Models read.
Why it is asked: content structure drives component design. Read the full explanation: Oak query engine documentation.
When would you write a servlet instead of a Sling Model?
A Sling Model prepares data for a component to render, while a servlet handles a request directly and writes a response, for example a JavaScript Object Notation (JSON) endpoint (Apache Sling, servlets). Choose a model when the output is a rendered component, and a servlet when you need to answer an application programming interface (API) style request. Keep both thin and call a service for the real work.
Why it is asked: it checks that you pick the right tool. Read the full explanation: Sling servlets documentation.
Should you register a servlet by resource type or by path?
Register by resource type, using sling.servlet.resourceTypes, rather than by sling.servlet.paths. A resource-type servlet is chosen through normal resource resolution, so it follows the content, its access rules and the selectors and extensions you declare. A path-bound servlet is fixed at one location outside the content tree, and the Sling documentation steers developers to resource types (Apache Sling, servlets).
Why it is asked: it tests whether you understand Sling's resource-first design. Read the full explanation: Sling servlets documentation.
How do you get and close a ResourceResolver in a service?
A background service should not use a user's session. It obtains a ResourceResolver through a service user, mapped to a narrowly scoped system user, using the resolver factory's service-resolver method. Close the resolver when you finish, for instance with try-with-resources (Apache Sling, service authentication).
Why it is asked: leaked resolvers and over-privileged users are common review findings. Read the full explanation: Sling service authentication.
What is the difference between author and publish instances?
Authors edit content, and publish instances serve it to visitors. Content moves from author to publish through replication (activation), and the Dispatcher sits in front of publish to cache pages. A strong answer says why the split exists: editing needs write access and review, and visitors need a fast, read-mostly system.
Why it is asked: it shows you understand deployment as well as code. Read the full explanation: Adobe Dispatcher documentation.
Why can a repository query be slow?
A query that the repository cannot answer from an index has to walk through content to find matches, which is slow on a large tree. A good answer says you would check how Oak executes the query, add or adjust an index definition where it is justified, and prefer reading by path when you already know where the content is (Apache Jackrabbit Oak, query engine).
Why it is asked: it separates developers who have seen performance problems from those who have not. Read the full explanation: Oak query engine documentation.
Follow-up questions
What do AEM backend developer interviews cover?
Expect Java basics, Sling Models, OSGi services, how requests reach a component, the content repository, the Dispatcher and the author and publish split. Some rounds add a short coding task, so keep the habits from the coding interview guide fresh, and see the full stack developer questions for the wider stack.
Which AEM questions come up most for experienced developers?
Experienced candidates are usually pushed past definitions: why a page is stale after a content change, why an injection failed, or which layer should hold logic. Prepare a story for each, such as the cache invalidation entry above, and see the solution architect questions for the layer-and-trade-off style.
How should I practise AEM answers?
Build one small component with a model and a service, then explain each annotation aloud. Where you reach for a fact you cannot source, say that it depends on your AEM version rather than guessing. The JavaScript questions cover the front-end side of the same component.
Do I need Java to be an AEM backend developer?
Yes: models, services and servlets are Java, so language fundamentals matter. The Java interview questions are a good base.
- A Sling Model is a plain Java object mapped from a resource or request;
@Modelsets the adaptable,@ValueMapValueinjects a property,@OSGiServiceinjects a service. - Constructor injection needs
@Injecton the constructor. - The Dispatcher is a caching and load-balancing tool used with a web server.
- Activation deletes the changed files; auto-invalidation only touches the statfile, and older cached files are re-fetched.
- Without header caching configured, only the HTML of a page is cached, not its headers.
- Register servlets by resource type, and close every
ResourceResolveryou open.
Sources
- Sling Models (Apache Sling documentation) — Apache Sling, 26 Oct 2026
- URL decomposition (Apache Sling documentation) — Apache Sling, 6 Oct 2026
- Servlets and scripts (Apache Sling documentation) — Apache Sling, 26 Oct 2026
- Service authentication (Apache Sling documentation) — Apache Sling, 26 Oct 2026
- Query engine (Apache Jackrabbit Oak documentation) — Apache Jackrabbit Oak, 26 Oct 2026
- Component Service specification (OSGi Compendium) — OSGi Alliance, 26 Oct 2026
- Dispatcher (Adobe Experience Manager Dispatcher documentation) — Adobe Experience League, 17 Mar 2026
- Configuring the Dispatcher (Adobe Experience Manager Dispatcher documentation) — Adobe Experience League, 17 Mar 2026