Hybris Interview Questions

Are you planning to attend an interview for SAP Hybris Developer role but confused on how to crack that interview and also what would be the most probable SAP Hybris Interview Questions that the interviewer may ask? Well, you have reached the right place. Tekslate has collected the most frequently asked SAP Hybris Interview Questions which are often asked in multiple interviews.

Q1) How to run multiple hybris instances in one machine?

Ans. Basically Hybris runs on a tomcat instance. Hybris is shipped with a bundled tomcat. So the question here is actually, how to run multiple tomcats in one machine.

We can run as many hybris we want, till our machine memory permits. To do so, we need to make each instance of tomcat to have its own ports to use. Make below ports unique for each instance. We should add below properties in the local property file of each instance with unique values...

tomcat.http.port=7001

tomcat.ssl.port=7002

tomcat.ajp.port=7009

tomcat.jmx.port=7003

tomcat.jmx.server.port=7004

Q2) Why order is important in items.xml?

Ans. We need to follow an order in items.xml when we declare item types in items.xml. Below are the reasons for it.

Each items.xml is parsed in a single pass. This means, more specific types are dependent on general types. In such cases, they should have been defined before we use them. For example,

SAP Hybris

Here we see that item type product is using other item types, like a catalog. To make this file successfully, it is mandatory that the catalog exists before the product is declared. We must define types in order of inheritance.

NOTE: Impex files are parsed in multiple passes, so the order is not important there.

Each XML file is validated against an item.xsd during the build. If the XML file does not conform to the XSD file, the build will fail.

Q3) What is the role of the halo session?

Ans. The Jalo layer in hybris is deprecated, not the halo session.

Whenever a request is made to the hybris server, it may need current user details, currency, language, timezone, etc to serve that request efficiently. Since HttpSession does not hold all these details, hybris came up with the concept of JaloSession.

Whenever a request comes to Hybris, the filter HybrisInitFilter creates an object of JaloSession. Every JaloSession object is associated with a SessionContext object, which has current user, language, currency, etc and the current HTTP session object.

  • Cron jobs also run in a JaloSession.
  • Each JaloSession is bound to a tenant. This cannot be changed after the instance of JaloSession is created.
  • JaloSession is never made persistent in the database.  

Q4) What are the Model Attributes?

Ans. Sometimes it is necessary to get few data in many JSPs, and we don’t want to pass them as a part of DTO (data objects). For example, the titles (Mr and Mrs, etc). They can be used in many JSPs and tags file, like registration, delivery address, etc.

In such cases, what we do is, create a convenient method in Abstract controllers, and use model attribute annotation for them. In this way, they are available from all JSPs directly using model attributes.

SAP Hybris

These can be accessed directly in JSPs or even tag files. like

Current Language: ${current Language}

Model service creates method vs new operator:

When we try to create a new instance of an item type programmatically, we have two options, using the java way, using a new operator or the hybris way, using the model service.

  • ProductModel product1 = new ProductModel();
  • ProductModel product2 = model service.create(ProductModel.class);
  • The advantages of using a model service method are below:
  • The model service creates method will generate and assign the pk for product object.
  • The create method will initialize the default values, defined in items.xml for mandatory attributes.
  • While calling save all methods, the object is already attached to the context and will be saved. While product1 needs to attach explicitly.

So we should always go for a model service way in hybris.

Q5) Why models are generated in platform extensions?

Ans. Hybris is built over the concepts of extensions. Each extension has it’s own data model. Any extension can use an item type from another extension and extend it as per requirement.

For example, the item type product defined in core extension. The catalog extension has extended the product item type and added the vendor to it.

While building the hybris, the frameworks build according to dependencies. Since the core is built before the catalog extension, it is not aware of the vendor attribute defined in catalog extension. If we keep model class in extensions, then there will e a chance to build failures. Like in our case, vendor attributes will not find a place in the Product Model class.

SAP Hybris

Hybris build framework, creates model classes, even before, building any extension. The platform is the best place to keep them, as every extension is built upon it only. So it is not logical to create model classes in particular extensions when we can define the same data model in various extensions.

Q6) How to split an order into multiple consignments?

Ans. While fulfilling an order, sometimes it is necessary for a business to split the order into multiple orders.

For instance, a customer orders two items A and B, now A has a delivery window of 2 days, while B can be delivered in a minimum of 5 days. Now the business has the option to either ship both items in 5 days. But what if item A is fresh, and will get destroyed in 5 days. There may be a case, where customers want a mandatory delivery of item A within 2 days. In such situations, if a business house doesn’t want to lose a customer, it has no choice but to split the order and ship it multiple times. This is the case of the split consignment.

Now there may be various conditions, which may call for splitting the order into multiple consignments. The above example is just one of them. For example, we may want to split consignment, based on the warehouse from where the item will be picked up. We may want to split consignment, based on product type (fresh or ambient), etc. These situations which decide the business logic to be a case for splitting the consignments are known as splitting strategies. We can have as many as a strategy to split, as we want.

By default, hybris creates only one consignment for an order. This is done by the following service.

SAP Hybris

As you can see, the order Splitting Service accepts a list of strategies, we can create many strategies, and split our order. The actual business logic for splitting will go into strategy class.

Q7) How to set up an svn environment for hybris projects?

Ans. Maintaining a versioning system for any project is one of the most crucial aspects. Hybris projects are not special in this regard. They also do have the same life cycle in terms of development. We need to maintain different environments like SIT, UAT, etc. To provide a local development environment is also equally important.

Since the size of OOB Hybris is huge, it is difficult to put everything in SVN (or GIT). Also, it is not advisable. The hybris is improvising every day. A new release should not give us pain in terms of development.

The best practice for versioning a hybris project could be:

  • Put only a custom folder, containing customized extensions to versioning software.
  • Pass the latest local.properties, local extensions locally to each developer.
  • Maintain a copy of the latest local.properties, local extensions in each of servers like development and SIT, UAT, etc.
  • Hybris software is wrapped around custom folders on each environment.
  • Media folder could possibly in SVN or can be passed locally like property files.

SAP Hybris

 Production environment normally is not connected to SVN. Rather we take the most stable copy from UAT and deploy it using some deployment tool like bamboo.

Want to manage product catalogs effectively, enroll in our SAP Hybris Training

Q8) What are Catalog aware item types?

Ans. While creating a data model for your project, you might come across situations, where you might want some of your item types to be part of a catalog. This means, you want them to synchronize, you want them to be associated with a catalog, content, or product. Such item types are known as catalog aware. It’s not just CMS item types or products, that need synchronization. All OOB CMS items and products are catalog aware.

  • To explicitly make an item type to be catalog aware, follow below steps:
  • Mark your item as catalog item type, using custom property catalog ItemType.
  • Choose attribute from the item, which will qualify the catalog associated using custom property catalog Version Attribute Qualifier.
  • Since each item in a catalog must be unique, we need to choose an attribute from the item which is unique. This can be done using custom property unique Key Attribute Qualifier.


java.lang.Boolean.TRUE

”catalogVersion”

”code”

 


  Once updating your item type, you should update your platform, using system update.

  And you should see something like below in HMC > System > item types > My ItemType > Extended

SAP Hybris

Now, instances of this item type will be catalog aware and would be part of synchronization.

Q9) Will it perform if we have over 1 million SKUs?

Ans. Yes, if you have used APIs, Flexi search in the right way. If you have used pagination in your Flexi search and converter caches than it will not matter how much SKUs you have.

Hybris Testing Interview Questions

Q10) Is it Scalable?

Ans.

  • Hybris is a spring JEE based platform and it is as scalable as any other java based platform.
  • Adding a new cluster node is just a matter of starting a new Hybris instance with 3 property changes.
  • Hybris will automatically add that node in the cluster. It has distributed cache per server and it's out of the box cache invalidation over UDP is very much efficient.

Q11) Is it configurable or require deployment for all sort of changes?

Ans. Mostly configuration until you have not done your own customizations. Even you can expose your custom elements to him and from there you can also change your configuration on the fly.

Q12) How easy it is to migrate from existing Magento or custom eCommerce solutions to the Hybris platform?

Ans. It will depend but highly feasible. Their data import process is very much flexible. Once data mapping is done it is easy to migrate.

Q13) How secure it is?

Ans. Spring security is an integrated OOB.

Q14) How frequent the do their releases?

Ans. They have a pre-defined roadmap. Please refer wiki.hybris.com

Q15) What is the difference between PIM and PCM?

Ans. Consider them synonyms.

Q16) How easy to learn this?

Ans. Actually, if you know spring and have concept of basic e-commerce than not much effort required to learn the Hybris platform. You need to be familiar with Impex and Flexi search syntax but plenty of examples are available to learn this.

Q17) Do they have on Demand flavor also?

Ans. Yes, recently introduced as an offering.

Q18) Can we use Hybris for product enrichment also?

Ans. Yes, their PIM module is meant for this.

Q19) How you will compare this with ATG or WCS?

Ans. Very soon Hybris will be on top of these because of its simplicity.

Q20) Can we use this as a fully-fledged content management solution?

Ans.

  • No, if your site is very much specific to content management and you want to manage a specific version of -individual content than cms is not the right solution for you.
  • Otherwise, it has all features that are required for an e-commerce application.

Q21) How flexible promotion module is?

Ans. A lot many promotions are available out of the box and you can extend their framework very easily to introduce your custom promotion.

Q22) Please talk about search capabilities?

Ans. Google commerce search overcloud. What else I need to say. If GCS doesn’t suit you then use SOLR as a free solution. It is available OOB.

Q23) What integration topologies it provides?

Ans. Whatever you want....pre-integrated ActiveMQ on tomcat is available for messaging. Restful web services frameworks are available OOB.

Q24) Does it have business processing capabilities also?

Ans. Yes, limited but you can define your workflows. Moreover, you can modify your workflow decisions on the fly through hmc.