If you’re preparing for a Liferay Developer, UI Engineer, or Lead Portal Engineer role, understanding the architecture and tools in Liferay DXP is essential.
This article compiles 25 practical interview questions and answers to help you ace your next Liferay interview — covering everything from portlets and fragments to themes, headless APIs, and deployment.
Basic Questions
Q1. What is Liferay DXP?
Liferay Digital Experience Platform (DXP) is an enterprise portal framework that enables organizations to build personalized web experiences, intranets, and digital platforms using modular components.
Q2. What are Portlets in Liferay?
Portlets are self-contained web applications deployed on a Liferay portal page. They follow the JSR-286 and OSGi standards.
Q3. Difference between a Portlet and a Fragment?
- Portlet → Java-based backend component, packaged as an OSGi module.
- Fragment → Frontend visual block (HTML, CSS, JS) used for page composition.
Q4. What are Liferay Fragments used for?
Fragments are reusable UI sections that allow non-technical users to edit and customize layouts directly through the page builder.
Q5. How do you deploy a Liferay module?
Use Gradle:
./gradlew deploy
It copies the module to the deploy folder where Liferay auto-installs it into the OSGi runtime.
Theming and UI
Q6. How do you create a custom theme in Liferay DXP?
Use the Yeoman generator:
yo liferay-theme
Then customize your SCSS and templates, and deploy via Gradle.
Q7. What is Clay in Liferay?
Clay is Liferay’s design system providing CSS and React components that follow Lexicon design language for consistent UI styling.
Q8. How do you customize Clay variables?
Modify the _custom.scss
file inside your theme or module and override variables like $primary
or $font-family-base
.
Q9. How to add Bootstrap utilities in Liferay?
Bootstrap is built into Clay. You can directly use utility classes such as d-flex
, p-3
, and text-center
in your fragments or JSPs.
Q10. How to make fragments editable?
Add attributes like data-lfr-editable-id
and data-lfr-editable-type
in your HTML. Example:
<h2 data-lfr-editable-id="title" data-lfr-editable-type="text">Default Title</h2>
Development and Architecture
Q11. What is the role of OSGi in Liferay?
Liferay DXP 7+ uses OSGi modular architecture, where each module (portlet, service, theme) is deployed as a bundle. It improves maintainability and allows dynamic updates.
Q12. What is Service Builder?
Service Builder is a tool to generate model, persistence, and service layers automatically from a service.xml
definition.
Q13. How do you call a Liferay Headless API?
Using REST endpoints (JSON) or GraphQL. Example:
fetch('/o/headless-delivery/v1.0/sites/20121/blog-postings', {
headers: { Authorization: 'Basic ' + btoa('user:password') }
});
Q14. What’s the difference between MVC Portlet and React Portlet?
- MVC Portlet → Uses JSP, Java controllers, and taglibs.
- React Portlet → Uses Node build, React components, and Liferay npm bundler.
Q15. How do you handle configuration in portlets?
Use @ExtendedObjectClassDefinition
to define config interfaces and access values via ConfigurationProvider
.
Advanced & Enterprise-Level
Q16. How do you implement permissions in Liferay?
Via Resource Actions defined in resource-actions/default.xml
and checked in code with:
permissionChecker.hasPermission(groupId, resourceName, resourcePrimKey, actionId)
Q17. How do you integrate Liferay with SSO or LDAP?
Through Control Panel → Instance Settings → Authentication → Configure LDAP or SAML.
Q18. What are Liferay Asset Framework and Asset Publisher?
The Asset Framework allows content (blogs, documents, web content) to be managed and displayed dynamically using the Asset Publisher portlet.
Q19. How do you improve Liferay performance?
- Use caching via Ehcache or Redis.
- Minimize fragment JavaScript.
- Enable Gzip and CDN delivery.
- Use database connection pooling.
Q20. What are the steps to create a REST API in Liferay?
Create a REST Builder module → define rest-openapi.yaml
→ run Gradle → deploy. Liferay auto-generates endpoints.
Practical & UI-Focused
Q21. How do you use React or Angular with Liferay?
Build as an npm or standalone SPA and embed it in a portlet or fragment using the JS bundler.
Q22. How do you debug JS in Liferay?
Use browser dev tools and Liferay’s npm run start
mode for React portlets (with source maps).
Q23. How do you enable cross-module communication?
Use OSGi services, @Reference
, or message bus.
Q24. How do you customize login or registration screens?
Override login.jsp
through a theme or fragment — or use a Login Pre Action
hook.
Q25. How do you export/import site pages in Liferay?
Use Export/Import functionality under Site Administration → Publishing → Export/Import.
Conclusion
Whether you’re interviewing for a Liferay Frontend Developer or a DXP Solution Architect, these questions reflect real-world challenges you’ll face in modern Liferay projects.
👉 Pro tip: Pair your answers with code demos or UI examples — employers love seeing practical skills beyond theory.