Interview Deck Flashcards

1
Q

Explain the AEM stack (architecture).

A

Java Platform– AEM is a Java web application. It requires server-side Java Runtime Environment.

Granite Platform– Adobe’s open web stack. It forms the technical foundation on which AEM is built.

OSGi Framework– OSGi is dynamic software component system for Java. In this system, an application is composed of an assemblage of bundles that can be dynamically installed, started, stopped, and uninstalled without shutting down the application.

CQSE Servlet Engine– AEM includes the built-in CQSE servlet engine which runs as a bundle within the OSGi framework.

JCR Content Repository– CRX content repository is an implementation of Java Content Repository
Specification (JCR). All data within AEM is stored here.

Sling Content Delivery– AEM is built using Sling, a Web application framework based on REST principles that provides easy development of content-oriented applications. Sling uses CRX Content Repository as its data store.

AEM Modules– WCM, DAM, Workflow, etc.
Customer Applications– Websites that run on AEM.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the major tech stack upgrades in AEM since CQ?

A

Jackrabbit Oak – offers improved performance and scalability compared to JCR

Sightly – new templating language that enforces separation of markup from logic and offers XSS protection

Touch UI – built using Coral UI framework, it supports touch enabled devices

Search– default search engine has been upgrade to Apache Solr

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is headless AEM?

A

It allows content stored in the JCR to be retrieved and used without rendering the content within an AEM content page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the layers in OSGi?

A

Bundles– jar components with extra manifest headers

Services– holds the service-side of the framework;
keeps the service registry and manages it
Life-Cycle– manages and keeps track of the frameworks and bundles lifecycle state; used to install/uninstall framework objects and start/stop them
Modules– the bundle space; holds the bundles that are installed on the framework
Security– optional layer; when active, validates the bundle signatures and controls component access rights; extends the Java 2 security architecture
Execution Environment– bottom layer on which bundles live; selected to fit the underlying hardware or operating system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the benefits of OSGi?

A

Reduced complexity - bundles hide internals, expose via services
Reuse - Modular code
Dynamic Updates - Easy deployment, keep the system running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the differences between JAR and bundle?

A
Both have pom files
Jar:
  Packaging tag of "jar" in pom.xml 
  Consume by calling methods
Bundle:
  Used in OSGI runtime
  Packaging tag of "bundle" in pom.xml
  Consume by calling services
  Bundle is a jar with extra manifest headers.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the differences between package and bundle?

A

Both have pom files

Package:

Contains content, files, or even other bundles
Deployed into the Package Manager
Packaging tag of “content-package” in pom.xml

Bundles:

Jar with extra manifest headers
Install via Felix Console
Packaging tag of “bundle” in pom.xml

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How do you install an OSGi bundle using the CRX repository?

A

Copy the bundle into the /apps/install folder.***

Create the project directory, then install the bundle from the package manager

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is REST principle?

A

Uniform Interface– individual resources are identified using URLs but are different from the representation sent to the client
Stateless Interactions– none of the clients context is to be stored on server side between request; all necessary information to service the request is contained in URL, query parameters, body, or headers
Cacheable– clients can cache the responses, but only on those defined as cacheable to prevent client from sending inappropriate data
Client-Server– clients and server are separated from each other and neither side is concerned with the other.
Layered System– client cannot tell if it’s connect to the end server or intermediate; intermediate layer helps enforce security policies and enable load-balancing
Code on Demand– optional constraint where server temporarily extends functionality of a client by the transfer of executable code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Differences between REST and SOAP.

A

REST:

Representational State Transfer
Uses URI for business logic
Is architectural style
Inherits security measures

SOAP:

Simple Object Access Protocol
Uses service inference for business logic
Uses own security
Only XML data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Describe the Apache Sling script resolution process.

A
HTTP Request
Content resolution
Get resource type
Locate script
Match script
Include options.
Execute script.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a sling model?

A

Sling models are annotation driven POJOs (Plain ol’ Java Object) which are mapped automatically from Sling objects like resources, request objects and OSGI services. The use of annotations helps reduce complexity/lines of code.

Declared with @Model(adaptables = Resource.class)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain how sling is content-centric.

A

Each HTTP request is mapped onto content in the form of a resource node, instead of static file path resolution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the commonly used Sling APIs?

A

ValueMap – easy way to access a resource’s properties
ResourceResolver– defines service API which may be used to resolve Resource objects
ResourceResolverFactory - used to access ResourceResolver instances
ResourceProvider– API for providers of resources
Resource– pieces of content on which Sling acts; an Adaptable to get adapters to other types
ResourceWrapper– wrapper for any Resource delegating all method calls to the wrapped resource by default
ResourceUtil– provides helper methods for dealing with resources

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Do you use JCR or Sling Resource API to update individual resources, and why?

A

JCR is lower level and slightly faster, but Sling is higher level which makes it more abstract and easier to code.

Best practice is to use higher level apis when possible.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

After updating the resource using Sling Resource API, what must you do to finish?

A

Commit the changes and close the resource resolver.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which provider service scans CRX repository for artifacts and provides them to the OSGi installer?

A

Sling JCR Installer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the JCR?

A

Java Content Repository - Content repository that combines features of the traditional relational database with those of a conventional file system:

Hierarchy– content can be addressed by path
Semi-structured content– can store structured documents, like XML, (which can have variable fields)
Access Control and Locking– can restrict access to different parts of the content hierarchy based on policies or ACLs; also supports locking of content to prevent conflicts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What kind of indexing does AEM now use?

A
Oak indexing which is not enabled by default. AEM also supports:
Solr
Apache Lucene
Property Index
Traversal Index
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

You want to install bundles through CRX only in the author instance. Which folder name can you use for that purpose?

A

install.author

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

You want to request a JSON representation of the content. What do you have to do with the request?

A

Change the extension to .json

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Why we need TAR Compaction?

A

If we are using Tar files as the storage, it tends to grow in size and starts claiming disk space every time when data is created or updated as data in tar files are never overwritten rather it keeps adding new versions. To mitigate the same, AEM has garbage collection mechanism which is known as ‘Tar Compaction’ to remove the unused data and reclaim the disk space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Explain David’s content model.

A

David Model:

Data First, Structure Later. Maybe.
Drive the content hierarchy, don’t let it happen.
Workspaces are good for versioned JCR projects.
Beware of Same Name Siblings.
References considered harmful.
Files are Files.
IDs are evil.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What’s the difference between Event Handler and Event Listener?

A

EventHandler:
Used at the Sling level
Watches for Sling properties?

EventListener:
Used at the JCR level
Watches for node changes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is the difference between Live Copy and Language Copy?

A

Live Copy
Copy of specific site content which automatically updates along with the original source
Inherits content from its source page
Use if you intend to reuse content at multiple locations

Language Copy
Copy of an existing site that is to be translated to another language; no live relationship
One time copy of the content
Use if you intend to translate content

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

If you are creating a site with multiple locales that must be synchronized, which should you pick and why?

A

Use Language Copy. While it does not have the same live relationship that Live Copy has, you can update the Language Copy. Use Update & Translate workflows to synchronize changes between the source and language copy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are Rollout Configurations?

A

Rules/instructions that determine which properties will be synchronized/always carried out on a deployment, how and when.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What is workflow?

A

Workflows are designed to coordinate and automate steps needed to complete a task. It can automate experience manager activities and interact with AEM assets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

What are the different types of steps present in workflow?

A

Process step – executes an ECMA script or calls an OSGi service to perform automatic processing
Participant step – enables you to assign ownership for a particular action; requires the owner to manually acknowledge the step
Container step – starts another workflow model that executes as a child workflow
OR, AND, and GOTO Split Step – Logical operator branching steps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What are examples of inbuilt workflow present in AEM?

A

DAM MetaData Writeback – This workflow manages XMP write-back to the original binary and sets the last modified date in jcr. To propogate metadata changes to select renditions of the asset, add the name of the renditions to the XMP Writeback Process workflow step of DAM Metadata WriteBack workflow. By default, this step is configured with the original rendition.
Approve for Adobe Campaign – Workflow handling the edition, review and approval of a newsletter to be sent using Adobe Campaign.
DAM Update Asset – By default, upon image upload to DAM, one of the many processes inside this workflow is to generate a web rendition of the uploaded image. The default setting of CQ’s Image API is to always render the web-enabled version of the uploaded image. This combination helps to limit the size and quality of the image displayed, thus reducing the page load time.
Download Asset
DAM Parse Word Document

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

What is dialog, design dialog, and cq:dialog?

A
cq:dialog:
Page level configuration
TouchUI
name = cq:dialog
Stored under page's jcr:content
Get value from properties object
jcr:primaryType is nt:unstructured
dialog:
Page level configuration
Classic UI
name = dialog
Stored under page's jcr:content
Get value from properties object
jcr:primaryType is cq:Dialog
design_dialog:
Template level configuration
Design Mode
name = design_dialog
Stored under design page located under /etc/design/default
Get value from currentStyle object
jcr:primaryType is cq:Dialog
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is the use of the EditConfig node?

A

EditConfig nodes are used to edit the configuration of components. Examples include adding properties, child nodes, listeners, and customizing the layout.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

What is the difference between sling:resourceSuperType and sling:resourceType?

A

sling: resourceSuperType – used to achieve resource type inheritance from the specified component
sling: resourceType – primary resource type used to render content; absolute or relative path used to locate the script

34
Q

How do you extend an OOTB component?

A

Add the property “sling:superResourceType” to your custom component’s node with the value of the component you want to inherit

35
Q

What are overlays?

A

Overlaying is the process of globally overriding the out of the box components. This is done by copying the node structure and replicating it under /apps, and allows for easy enhancements

36
Q

What is the difference between overlaying and extending a component?

A

Overlaying – Globally overriding an out of the box component by copying its contents into the /apps folder. Allows for easy enhancements

Extending – A custom component that’s built to inherit from another out of the box component using the sling:superResourceType property

37
Q

Difference between parsys and iparsys.

A

parsys – It is a placeholder called “Paragraph System”, where we can drag and drop or add other components or scripts at page level.

iparsys - The inherited paragraph system is a paragraph system that also allows you to inherit the created paragraphs from the parent. it is similar to parsys except that it allows to inherits parent page “paragraph system” at template level. You can also cancel paragraph inheritance at a level at any time. It has two checkbox options to cancel/disable the inheritance.

Cancel Inheritance - If selected, the components in this paragraph system are not passed down to the child pages.
Disable Inheritance - If selected, components of this paragraph system on this page are not inherited from the parent page.

38
Q

What is parbase?

A

Parbase is a key component as it allows components to inherit attributes from other components.

39
Q

Difference between jcr:primaryType and jcr:mixinTypes

A

jcr: primaryType - Required on initial creation and is the user defined node type, sort of like a class in Java.
jcr: mixinTypes - An additional type that exists in addition to the primaryType and supports additional properties/child nodes.

40
Q

Difference between allowedPaths, allowedChildren and allowedParents?

A

allowedPaths - Path of a page that is allowed to be based on this template.

allowedChildren - Path of a template that is allowed to be a child of this template.

allowedParents - Path of a template that is allowed to be a parent of this template.

41
Q

What is componentGroup, cq:isContainer and cq:noDecoration property?

A

componentGroup - Group under which the component can be selected in the Sidekick.

cq: isContainer - Checks if this component is a container component. For example a paragraph system component.
cq: noDecoration - If true, the component is not rendered with automatically generated div and css classes.

42
Q

What is serviceFactory?

A

An OSGi service factory is a special class ServiceFactory, which can create individual instances of service objects for different bundles. Sometimes a service needs to be differently configured depending on which bundle uses the service. For example, the log service needs to be able to print the logging bundle’s id, otherwise the log would be hard to read.

43
Q

What are advantages of services?

A
Separates interface from implementation
Lookup is based on Interface name
Direct method invocation
Good design practice
Enables reuse, substitutability, loose coupling and late binding.
44
Q

How do you create a service class?

A

@component - defines the class as a component

@service - defines the service interface that is provided by the component

45
Q

What are the annotations used in OSGi?

A

@Component - annotates an implementation class and is used to declare it as a component type. It is the only required annotation. If this annotation is not declared for a Java class, the class is not declared as a component.

@Service - defines whether and which service interfaces are provided by the component. This is a class annotation.

@Reference - defines references to other services made available to the component by the Service Component Runtime.

@Property - defines properties which are made available to the component through the ComponentContext.getProperties() method. These tags are not strictly required but may be used by components to defined initial configuration. Additionally properties may be set here to identify the component if it is registered as a service, for example the service.description and service.vendor properties.

46
Q

What are the difference between OSGI components and services?

A

Component - Components can’t reference other components, they can only reference services.

Components are consumers

Service - Services are components but they provide function to components and can be injected into them.

Services are providers
47
Q

How do you call a service?

A

Use SCR annotations to let SCR inject the service in your component:(Generally in Servlet)
     @Reference
      private MyService myService;

Use sling.getService() method(Generally in JSP)
      MyService service=sling.getService(MyService.class);

Use SlingScriptHelper.getService() method (into Java Use-API class ie Handler class )
      MyService service=getSlingScriptHandler().getService(MyService.class);
48
Q

What is ServiceFactory?

A

It’s a class that can create individual instances of service objects for different bundles.

49
Q

What is a PID?

A

The PID is a globally unique string that can be used to identify services in the Felix console

50
Q

How to register a servlet using Java annotations?

A

There are two ways.

Use @SlingServlet annotation
Use @Property(name = “sling.servlet.resourceTypes”, value = “sling/servlet/default”)
Both define the values of the properties resourceTypes, selectors, extensions, and methods

51
Q

How do you register a servlet in AEM?

A

There are two standard approaches.

By path @SlingServlet( paths={“/bin/customservlet/path”} )
By resourceType @SlingServlet( resourceTypes = “sling/servlet/path”)
If the path property is set, the resourceType property is ignored.

52
Q

What is the difference between binding a Servlet by resource type rather than paths?

A

By resourcetype:
Registering a Servlet by resource type is the preferred approach in Sling in order to wire rendering logic to requested resources (“resource comes first” approach)
Access to JCR ACLs
Suffix handling

By path:
Statically mapped to a path
Paths need to be explicitly allowed

53
Q

Why configure a Sling Servlet to be called on a resource type instead of a path?

A

The path may be impacted by dispatcher rules around permissions.
A resource type allows for Sling inheritance.
Access to JCR ACLs
Suffix handling

54
Q

How to get session in Servlet?

A

There are two approaches.

Get session from SlingHttpServletRequest.
Session session = slingHttpServletRequest.getResourceResolver().adaptTo(Session.class)
Get session from ResourceResolverFactory.
resolver = resourceResolverFactory.getServiceResourceResolver(param);
Session session = resolver.adaptTo(Session.class);

55
Q

What is a Resource object?

A

Resources are pieces of content on which Sling acts

56
Q

What is ResourceResolver object?

A

The ResourceResolver defines the service API which may be used to resolve Resource objects.

57
Q

What is a Session object?

A

The Session object provides read and write access to the content of a particular workspace in the repository.

58
Q

What is a client library?

A

A library for your clients
A feature of AEM that allows you to manage client side resources like Javascript, CSS, images, fonts etc… It also allows for debugging, minifying, and merging client-side code.

59
Q

How do you debug client library files in a web browser?

A

Add this to the end of your URL: ?debugClientLibs=true

60
Q

How do you rebuild client libraries?

A

Yes, via url: /libs/granite/ui/content/dumplibs.rebuild.html, we can invalidate or rebuild the clientlibs.

61
Q

Is there a console where I can see all client libraries and their dependencies?

A

Yes: http://server/libs/cq/ui/content/dumplibs.html

62
Q

What are categories, dependencies, embed and allowProxy properties in AEM?

A

Categories - the list of identifiers to publish a clientlib under

Dependencies - specifies other client libraries the current one depends on (causes your page to have extra requests to other clientlibs)

embed - Embeds code from other libraries into the current one. If node F embeds nodes G and H, the resulting HTML will be a concatenation of content from nodes G and H.

allowProxy - If a client library is located under /apps, this property allows access to it via proxy servlet.

63
Q

Where are the generated client library files stored/cached in CQ?

A

They are in /var/clientlibs

64
Q

If the builds were being deployed manually, what would you suggest as a change?

A

Set up Jenkins to use for automated deployments.

65
Q

What is the dispatcher?

A

Dispatcher is AEM’s caching and/or load balancing tool. It essentially acts like a reverse proxy server, fielding http requests from a client (typically a web browser) and sending responses back

66
Q

Have you seen the dispatcher used with any web server other than Apache? For example, nginx.

A

(Answer will vary depending on experience)

67
Q

What is Sightly/HTL?

A

HTL stands for HTML Template Language and is was formerly known as Sightly. It was introduced in AEM 6.0 and takes the place of JSP.

68
Q

What is advantages of sightly/HTML Template Language?

A

Increased Security - HTL is well protected against cross site scripting (XSS) by having HTML tag context-aware escaping of variables to prevent injection.

Simplified Development - Its features are purposely limited to ensure that it stays simple and straight-forward.
Wider range of implicit objects as compared to JSP.
Reduced Costs - Increased security, simplified development and improved team collaboration, translates for AEM projects in reduced effort, faster time to market (TTM), and lower total cost of ownership (TCO).

69
Q

What are the Use-API in sightly?

A

Java Use-API - Enables an HTL file to access helper methods in a custom Java class. This allows all complex business logic to be encapsulated in the Java code, while the HTL code is embedded into the HTML

JavaScript Use-API - Enables an HTL file to access helper code written in JavaScript. This allows all complex business logic to be encapsulated in the JavaScript code, while the HTL code is embedded into the HTML

70
Q

What is the use of unwrap in sightly?

A

Unwrap attribute - Remove the outer elements (i.e. HTML Tags) leaving just the output of the expression

71
Q

What are the implicit objects present in sightly?

A

Enumerable Objects:
properties:
properties of the current resource
pageProperties:
properties of the current page
inheritedPageProperties:
inherited properties of the current page

Java-backed Objects:
    component
    currentDesign
    currentPage
    request
    resource
    resourceDesign
    resourcePage
    wcmmode
72
Q

Are you a back-end, front-end, or full-stack developer? What is a typical development process and how do you fit in?

A

A creative design team typically provides wireframes and design comps.
A front-end developer slices-and-dices the comps into front-end code (HTML, CSS, and javascript), often after discussing with an AEM Lead howt o break down a page into modular components (to determine what is part of each component on a page and what can be leveraged across multiple pages)
A back-end AEM developer creates template, component stubs, and skeletons.
A front-end or back-end developer gets the front-end code into AEM.
A back-end developer implements Sling Models, OSGi components, and any other back-end functionality needed.
A developer implements any authoring functionality needed (e.g. component dialogs, customizations to OOTB AEM authoring tools).

73
Q

How do you create a login functionality?

A

Submit button
POST form / ajax
Verify against user table
Return request

74
Q

What technology have you worked on in AEM?

A

(Your answer will vary depending on your own experience.)

75
Q

What workflows or event handlers have you developed?

A

(Your answer will vary depending on your own experience.)

76
Q

What OSGi services have you worked on?

A

(Your answer will vary depending on your own experience.)

77
Q

Explain the changes in AEM 6.4 for Sling model.

A

Sling nested multi-fields

78
Q

Define what a Template is in AEM

A

A template enables you to define a consistent style for the pages in your application. A template is comprised of nodes that specify the page structure.

79
Q

Where is the content stored from cq:dialog or dialog nodes?

A

Design dialog data is stored under /etc./designs folder.

Dialog data is stored under /content folder.

80
Q

What is REST?

A

It’s the representational State Transfer architecture. It provides interoperability between computer systems on the internet in a loosely coupled fashion.