Skip to content

AEM Interview Questions for Developers, with Answers

28 AEM developer interview questions with short, sourced answers and code: Sling and OSGi, Oak indexes, HTL, Sling Models, Dispatcher, Cloud Manager, GraphQL.

Written in December 2026 and checked against Adobe's AEM as a Cloud Service documentation on Experience League, the HTL specification and the Apache Sling and Jackrabbit Oak documentation.

On this page
  1. 1. What is AEM built on?
  2. 2. How does Sling resolve a request URL?
  3. 3. Should a servlet be registered by path or by resource type?
  4. 4. What's the difference between an OSGi bundle and a content package?
  5. 5. How do you configure an OSGi service per environment?
  6. 6. Sling Scheduler or Sling Jobs for background work?
  7. 7. How should code get a ResourceResolver?
  8. 8. What's the difference between JCR and Oak?
  9. 9. A query logs "Traversed N nodes". What do you do?
  10. 10. Why HTL and not JSP?
  11. 11. How does HTL protect against XSS?
  12. 12. Why doesn't data-sly-test see the item of a data-sly-list on the same element?
  13. 13. What's a proxy component?
  14. 14. Where do editable templates live, and what are they made of?
  15. 15. How do client libraries reach the browser?
  16. 16. What is a Sling Model, and what should it adapt from?
  17. 17. Why does my model come back null in HTL?
  18. 18. What does the Sling Model Exporter do?
  19. 19. How should Dispatcher filters be written?
  20. 20. How does cache invalidation work on Cloud Service?
  21. 21. Which requests does the Dispatcher never cache?
  22. 22. What changed for developers from AEM 6.5?
  23. 23. Which Cloud Manager pipelines are there?
  24. 24. How is content published on Cloud Service?
  25. 25. How do you test changes without a full pipeline run?
  26. 26. Content Fragment or Experience Fragment?
  27. 27. How does the AEM GraphQL API work, and why use persisted queries?
  28. 28. Headless, Edge Delivery Services or the Universal Editor?

An AEM developer interview asks you to explain how Sling turns a URL into a rendered resource, how OSGi services are built and configured, how the repository is indexed, how HTL and Sling Models render a component, how the Dispatcher caches, what AEM as a Cloud Service changed, and how headless delivery works. Adobe's Sites Developer Expert exam objectives cover the same ground, and the AEM certification study map pairs them with tutorials. Answers below are for AEM as a Cloud Service, with AEM 6.5 noted where it differs.

1. What is AEM built on?

Three Apache projects. AEM is built on Sling, runs its Java code in the Apache Felix implementation of OSGi, and stores everything in a JCR repository implemented by Jackrabbit Oak. How author, publish and the Dispatcher are laid out on top of that is in the AEM architecture guide.

2. How does Sling resolve a request URL?

It splits the URL into a resource path, selectors, an extension and a suffix. In Sling's own example, /a/b.s1.s2.html/c/d.s.txt with a resource at /a/b gives selectors s1.s2, extension html and suffix /c/d.s.txt. Sling then looks up a script or servlet for the resource type, follows its supertypes when nothing matches, and prefers the candidate matching the most selectors.

3. Should a servlet be registered by path or by resource type?

By resource type. Sling's documentation strongly recommends it, because path-bound servlets can't be access controlled with repository ACLs:

@Component(service = Servlet.class)
@SlingServletResourceTypes(
    resourceTypes = "mysite/components/page",
    selectors = "data",
    extensions = "json",
    methods = HttpConstants.METHOD_GET)
public class PageDataServlet extends SlingSafeMethodsServlet {
    @Override
    protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)
            throws IOException {
        response.setContentType("application/json");
        response.getWriter().write("{\"path\":\"" + request.getResource().getPath() + "\"}");
    }
}

On publish, page.data.json also needs a Dispatcher allow rule; the syntax is in Dispatcher filter rules.

4. What's the difference between an OSGi bundle and a content package?

A bundle is a JAR of Java code that Felix starts and wires; a content package is a ZIP of repository content such as components, templates and configuration. On Cloud Service both travel in one deployment: an all container package that embeds ui.apps, ui.config, ui.content and the bundles. That project layout is built step by step in the AEM as a Cloud Service learning path.

5. How do you configure an OSGi service per environment?

Declare the configuration with the OSGi metatype annotations and read it on activation:

@ObjectClassDefinition(name = "Mysite Feed Client")
public @interface FeedConfig {
    @AttributeDefinition(name = "Endpoint")
    String endpoint() default "https://feeds.example.com/v1";

    @AttributeDefinition(name = "Read timeout (ms)")
    int readTimeout() default 5000;
}

@Component(service = FeedClient.class)
@Designate(ocd = FeedConfig.class)
public class FeedClient {
    private String endpoint;

    @Activate
    @Modified
    protected void activate(FeedConfig config) {
        this.endpoint = config.endpoint();
    }
}

Values go in a .cfg.json file named after the PID inside a run-mode folder, and can read $[env:NAME] variables and $[secret:NAME] secrets set in Cloud Manager. Here that's /apps/mysite/osgiconfig/config.publish.prod/com.mysite.core.FeedClient.cfg.json:

{
  "endpoint": "$[env:FEED_ENDPOINT]",
  "readTimeout": 5000
}

Cloud Service supports only author and publish combined with dev, rde, stage and prod as run modes; AEM 6.5 also accepts custom run modes.

6. Sling Scheduler or Sling Jobs for background work?

On Cloud Service, Sling Jobs: Adobe's development guidelines say not to use the Sling Commons Scheduler, because execution can't be guaranteed. On AEM 6.5 the Scheduler still works, but a job survives a restart. Jobs are persisted under /var/eventing/jobs and processed at least once, so the consumer must be safe to run twice:

// a nightly run: Quartz cron with a seconds field
jobManager.createJob("mysite/catalog/sync")
    .properties(Map.of("root", "/content/mysite/en"))
    .schedule().cron("0 0 2 * * ?").add();

@Component(service = JobConsumer.class,
           property = JobConsumer.PROPERTY_TOPICS + "=mysite/catalog/sync")
public class CatalogSyncConsumer implements JobConsumer {
    @Override
    public JobResult process(Job job) {
        String root = job.getProperty("root", String.class);
        // idempotent work on root
        return JobResult.OK;
    }
}

Return FAILED to have the job retried and CANCEL to stop for good. Build the cron string with the Quartz cron expression generator.

7. How should code get a ResourceResolver?

Through a service user. The administrative resolver is deprecated because it gives far too much access; ask for a service resolver with a subservice name instead:

Map<String, Object> auth = Map.of(ResourceResolverFactory.SUBSERVICE, "catalog-reader");
try (ResourceResolver resolver = resolverFactory.getServiceResourceResolver(auth)) {
    Resource root = resolver.getResource("/content/mysite/en");
}

The name is mapped to a system user in the ServiceUserMapperImpl.amended factory configuration, as bundle:subservice=[user]. On Cloud Service the system user and its ACL come from repoinit; see defining groups and ACLs in code.

8. What's the difference between JCR and Oak?

JCR is the standard Java API you code against (Node, Session, Query); Oak is the implementation of that standard AEM is built on. Oak keeps nodes in a segment store for standalone instances or a document store for clusters. On AEM 6.5 you choose and size that store yourself (see node stores and data stores in AEM 6.5); on Cloud Service Adobe runs it.

9. A query logs "Traversed N nodes". What do you do?

Find the query, then rewrite it to hit an existing index or add one. On Cloud Service a custom index ships as code in ui.apps, must be of type lucene and named <indexName>-<productVersion>-custom-<customVersion>. There's no manual reindex: the repositories are reindexed during the deployment, before the switch. The steps are in fixing AEM traversal warnings, and you can draft the index from the query with the Oak index definition generator.

10. Why HTL and not JSP?

HTL escapes every expression according to its display context and has no way to embed Java, so logic moves into Sling Models or Use-API objects. JSP leaves escaping to the developer. More in what HTL is and how it differs from JSP.

11. How does HTL protect against XSS?

Through display contexts. Text gets text escaping, attributes get attribute, and href, src and a few other attributes get uri validation by default. Inside script and style, set the context yourself:

<a href="${teaser.link}" title="${teaser.title}">${teaser.title}</a>
<div class="cmp-teaser__text">${teaser.text @ context='html'}</div>
<script>var teaserId = "${teaser.id @ context='scriptString'}";</script>

The html context still removes risky markup, while unsafe disables escaping, so it needs a reason in code review. Every context is listed in HTL expression options.

12. Why doesn't data-sly-test see the item of a data-sly-list on the same element?

Block statements run in a fixed priority order in which data-sly-test comes before data-sly-list, so the test runs once, before the first item exists. Move it to a child element, as in the examples for conditional rendering with data-sly-test.

13. What's a proxy component?

A component in your project whose sling:resourceSuperType points at a shared, versioned component such as a Core Component. Content references the proxy, and Adobe's guidelines say never to point content directly at a versioned component, so an upgrade doesn't force a content migration. The proxy can stay empty or override parts of its parent; the Core Components you can proxy are listed in Core Components and how to use them.

14. Where do editable templates live, and what are they made of?

Under /conf/<folder>/settings/wcm/templates, built from structure, initial content, layout and page policies. Template authors change them in the browser, so a new page layout doesn't need a deployment. Building one step by step is in editable vs static templates.

15. How do client libraries reach the browser?

A cq:ClientLibraryFolder sits under /apps and, with allowProxy set to true, is served from /etc.clientlibs/. Pages load it by category through a data-sly-call to AEM's clientlib template:

<sly data-sly-use.clientlib="/libs/granite/sightly/templates/clientlib.html"
     data-sly-call="${clientlib.all @ categories='mysite.site'}"/>

Skip embed and dependencies on new libraries: Adobe now discourages both.

16. What is a Sling Model, and what should it adapt from?

An annotated Java class that Sling fills before your HTL reads it. Which injectors work depends on the adaptable: adapt from Resource for properties alone, and from SlingHttpServletRequest when you need script variables such as currentPage.

@Model(adaptables = SlingHttpServletRequest.class,
       adapters = Teaser.class,
       resourceType = "mysite/components/teaser",
       defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL)
public class TeaserImpl implements Teaser {

    @ValueMapValue
    private String title;

    @ScriptVariable
    private Page currentPage;

    @PostConstruct
    protected void init() {
        if (title == null) {
            title = currentPage.getTitle();
        }
    }

    @Override
    public String getTitle() {
        return title;
    }
}
<div class="cmp-teaser" data-sly-use.teaser="com.mysite.core.models.Teaser">${teaser.title}</div>

For the move away from WCMUsePojo, see Sling Models vs WCMUsePojo.

17. Why does my model come back null in HTL?

A required injection failed, or the model adapts from the wrong object. Injected fields are required by default, so one missing property fails the whole adaptation. Set DefaultInjectionStrategy.OPTIONAL or mark the field optional, use injector-specific annotations such as @ValueMapValue in place of the generic @Inject, and read the log for the adaptation error.

18. What does the Sling Model Exporter do?

@Exporter(name = "jackson", extensions = "json") registers a servlet that returns the model as JSON under the model selector, as in teaser.model.json. It suits clients that read component JSON. For structured content, Content Fragments and GraphQL fit better; the headless tutorial from fragments to a React app builds one end to end.

19. How should Dispatcher filters be written?

Deny everything, then allow what the site needs by path, selector and extension. The Dispatcher documentation recommends that allowlist, and when several rules match a request, the last one applies:

/0001 { /type "deny" /url "*" }
/0100 { /type "allow" /method "GET" /path "/content/mysite/*" /extension "html" }
/0110 { /type "allow" /method "GET" /path "/content/mysite/*" /selectors "data" /extension "json" }

Paste your rules into the Dispatcher filter tester to see which requests get through.

20. How does cache invalidation work on Cloud Service?

Publishing or unpublishing a page clears it from the Dispatcher cache, along with parent paths up to the configured statfileslevel. Adobe's CDN works differently: it isn't flushed on invalidation and keeps HTML for the five minutes set by the default Cache-Control. Change that with Cache-Control for browsers and Surrogate-Control for the CDN.

21. Which requests does the Dispatcher never cache?

A URL with a query string or without an extension, a request with an authentication header, and a response sending no-cache, no-store or must-revalidate. Marketing parameters such as utm_source belong in /ignoreUrlParams, which lets pages with only ignored parameters be cached. For one personalized block on a cacheable page, include it separately with Sling Dynamic Include and SSI or ESI.

22. What changed for developers from AEM 6.5?

/apps and /libs are immutable, so code, configuration and indexes arrive only through Cloud Manager. The guidelines also forbid the local file system and in-memory state, limit CRXDE Lite to development author, and drop reverse replication. To find what breaks those rules in a 6.5 codebase, run Adobe's Best Practices Analyzer, which is built on Pattern Detector; the codes in its report are explained in reading a Pattern Detector report.

23. Which Cloud Manager pipelines are there?

A full-stack pipeline deploys Java, OSGi configuration, repoinit, front-end code and web tier config together, with one allowed per environment. The narrower ones are faster: front-end pipelines deploy CSS and JavaScript as a theme, web tier config pipelines deploy Dispatcher files in minutes, and config pipelines carry CDN, WAF and log forwarding settings. The build runs on a JDK you choose; see setting the Cloud Manager build JDK.

24. How is content published on Cloud Service?

Through Sling Content Distribution and a pipeline service outside the AEM runtime, with no replication agents to configure. Code still calls the Replicator API: an AgentFilter for the preview agent targets the preview tier, and Adobe advises fewer than 100 paths per call, with 500 as the limit.

25. How do you test changes without a full pipeline run?

Locally, with the AEM SDK (see what the local SDK contains). In the cloud, a Rapid Development Environment takes bundles, content packages, OSGi configurations and Dispatcher configuration from aio aem:rde:install. Code proven there still goes through Cloud Manager to the regular environments.

26. Content Fragment or Experience Fragment?

A Content Fragment is structured editorial content without layout, and an Experience Fragment is fully laid out content, a fragment of a web page. An Experience Fragment can contain Content Fragments, but not the other way round. Choose by whether the consumer needs data or ready markup; examples are in how Experience Fragments differ from Content Fragments.

27. How does the AEM GraphQL API work, and why use persisted queries?

The schema comes from your Content Fragment Models, and besides per-project endpoints there's a global endpoint at /content/_cq_graphql/global/endpoint.json. A persisted query is stored on the server and run with GET, so the Dispatcher and CDN can cache it; publish sends max-age 60 and s-maxage 7200 by default. Parameters follow a semicolon, encoded:

curl "https://publish-p12345-e67890.adobeaemcloud.com/graphql/execute.json/mysite/articles-by-tag%3Btag%3Dcloud"

For a browser app on another origin, CORS on publish is handled by the Dispatcher, which removes the Origin header before the request reaches AEM. Endpoints and query syntax are in the AEM GraphQL API guide.

28. Headless, Edge Delivery Services or the Universal Editor?

For a new site, Edge Delivery Services: Adobe's tutorials say it is recommended for new projects, while headless and traditional AEM stay supported. Headless fits an app that already has its own front end. For visual editing of such an app, the SPA Editor is deprecated for new projects and the Universal Editor takes its place. More in AEM Edge Delivery Services explained and how the Universal Editor works.

More in Certification and interviews

  • AEM Certification

    The AEM exams Adobe offers now, which role takes which, and a study map to the tutorials here.