Tuesday, October 11, 2016

AEM interview questions that I can think of(We will keep on updating)


  1.  What are the basic differences between Overlays and Sling Resource Merger?                             
  2.     What are the two locations where we can find the foundation components starting from                6.0?
               libs/foundation/components:  All components using jsp are available here.
               libs/wcm/foundation/components:  All components developed using sightly are here.
   
      3.     How to add a design in AEM?
              
              Creating and assigning a design(er) in AEM allows us to create a consistent and feel
               across the website and also to share the global content.
               Simple steps to create or add a design to a page is as follows:
                   *Miscadmin
                   *Tools -> Designs --> create a new page -> give title and name and click create.                                    *open page --> page properties --> Advanced --> Design field and ok.
   
       4.    Why we need to include global.jsp if we are creating a component in jsp?
               The global.jsp script which adobe provides by default declare Sling, AEM and JSTL
                taglibs to make component creation easy in AEM.

      5.     Where dialog and design dialogue data is stored?
                  Design dialog data is stored under /etc/designs folder
                  Dialogue data is stored under /content folder


      6.     How do you analyze thread dumps?
              
             JStack can be used to  get the thread dumps.
             Steps to generate the thread dumps are as follows:
             1. ps -ef | grep java <author (or) publish> is to list the java processes that are running
                 on a server.
             2. jstack <PID> >> therad.txt( this to copy the particular java process ID to  thread.txt
                  -file)run for 10 times in interval of 2 sec.
             3. Once you have thread dump you can use any thread dump analyzer tool to find long                               running thread.
                  Linux command is sudo -u user jstack <pid> >> threaddumps.log
                  Some dumpanalysis tools such as tda.
     
      7.   The basic Servlet class that we need to extend when we are trying to create a new                         Servlet?   ----  SlingAllMethodsServlet
         
      8.     In AEM, how servlet will be identified? And how it will be defined?
               In Servlet-  @properties(value = {
                                            @property( name = "sling.servlet.paths", value =  
                    {"/apps/geometrixx/components/content/common/billing/AlertServlet"}) })
     
       9. Question:

<div class="item">
<sly data-sly-test="${properties.jcr:title && properties.jcr:description}">
<h1>${properties.jcr:title}</h1>
<p>${properties.jcr:description}</p>
</sly>

</div> Write an optimized way of above code.

Ans:

<div class="item" data-sly-test="${properties.jcr:title && properties.jcr:description}">
<h1>${properties.jcr:title}</h1>
<p>${properties.jcr:description}</p>

</div>

Question: OPmized for the below
<%@include file="/libs/foundation/global.jsp"%>
<a href="<%= xssAPI.getValidHref(properties.get("link", "#")) %>" <%
String title = properties.get("jcr:title", "");
if (title.length() > 0) {
%>title="<%= xssAPI.encodeForHTMLAttr(title) %>"<%
} %>>
<%= xssAPI.encodeForHTML(properties.get("jcr:description", "")) %>
</a>

Ans:    


<a href="${properties.link|| '#'}“
title="${properties.jcr:title}">
${properties.jcr:description}
</a>



Questions: Questions: Do you know what is the prime type that we use when setting up the configurations?


Ans: sling:OsgiConfig


Questions:   Lets take a scenario, where we have 5pages with  each with different layouts and asked you to adive their team on how many templates that they have to configure..!? what would be your suggestion?

Ans: make the template multifunctional

Questions: Basic building blocks of the bundle?

   Ans: components:   Implementation of Events, Schedulers, Servlets, Models
,           Services:   Interface: Runnable, Servlet, EventHandling, JobConsumer 




Questions:A CQ5 instance hosts multiple websites in different content branches. How is it possible to map a domain to a specific content branch to support multi-domain hosting scenarios?

Ans: These nodes have to be created in the default workspace of the repository via the CRX Content Explorer, required nodetypes in brackets:
1
2
3
4
5
6
7
/etc
   /map                       (sling:Folder)
      /http                   (sling:OrderedFolder)
         /www_geometrixx_fr   (sling:Mapping)
         /www.geometrixx.fr   (sling:Mapping)
         /www_geometrixx_de   (sling:Mapping)
         /www.geometrixx.de   (sling:Mapping)

Questions:  Should you use <cq:include> or <sling:include>?

Ans: When developing AEM components, Adobe recommends that you use <cq:include>.

<cq:include> allows you to directly include script files by their name when using the script attribute. This takes component and resource type inheritance into account, and is often simpler than strict adherence to Sling's script resolution using selectors and extensions.



      
     


2 comments:

  1. Replies
    1. The grep command is used to search text. It searches the given file for lines containing a match to the given strings or words. It is one of the most useful commands on Linux and Unix-like system.

      Delete