EPAM Systems
10+ One Stop Solutions Interview Questions and Answers
Q1. How to create and handle complex primary key in Spring Data JPA
Complex primary keys in Spring Data JPA can be created using @EmbeddedId or @IdClass annotations
Use @EmbeddedId annotation to create a composite primary key using an embeddable class
Use @IdClass annotation to create a composite primary key using a separate class for the key fields
Implement equals() and hashCode() methods in the embeddable or separate key class for proper comparison and hashing
Q2. Given a matrix, when you encounter a 0, make all the elements in the corresponding row and column to 0.
Given a matrix, replace rows and columns with 0 when encountering a 0.
Iterate through the matrix and store the row and column indices of 0s in separate sets.
Iterate through the sets and update the corresponding rows and columns to 0.
Q3. How do you make an object immutable, followed by how will you make a collection within your immutable object immutable as well so that the state doesn’t change
To make an object immutable, use final keyword for fields and provide only getters. To make a collection immutable, use Collections.unmodifiableList() or similar methods.
Use final keyword for fields in the object to prevent them from being modified
Provide only getters for the fields to ensure they cannot be changed externally
For collections within the object, use Collections.unmodifiableList() or similar methods to create an immutable view of the collection
Q4. Working of Kafka, the flow of a message, using partitions, load balancing with Consumers.
Kafka is a distributed streaming platform that allows for the flow of messages through topics, partitions, and consumers.
Kafka is a distributed streaming platform that allows producers to publish messages to topics.
Topics are divided into partitions, which allow for parallel processing and scalability.
Producers can specify a key for a message, which determines the partition to which the message will be sent.
Consumers can subscribe to one or more partitions within a topic to r...read more
Q5. Output list of palindrome strings from a given string.
Output list of palindrome strings from a given string.
Iterate through each substring in the given string and check if it is a palindrome.
Use two pointers approach to check if a substring is a palindrome.
Store palindrome substrings in an array and return the array.
Q6. Coding task - check specific characters in a string , proposed solution with string regex match
Check specific characters in a string using regex match
Use regex pattern to match specific characters in the string
For example, to check for digits in a string: /[0-9]/
Use regex.test() method to check if the pattern exists in the string
Q7. Experience in Platform/Legacy App modernization
I have experience in modernizing legacy applications and platforms.
I have worked on migrating monolithic applications to microservices architecture.
I have experience in refactoring code to make it more modular and maintainable.
I have worked on upgrading outdated technologies to newer versions.
I have experience in containerization using Docker and Kubernetes.
I have worked on cloud migration projects, moving applications to AWS and Azure.
Q8. Use of unsubscribe in angular and practical benefit of onDestroy?
Unsubscribe in Angular is used to clean up resources and prevent memory leaks. ngOnDestroy is a lifecycle hook that is called when a component is destroyed.
Unsubscribe is used to prevent memory leaks by unsubscribing from observables when a component is destroyed.
onDestroy is a lifecycle hook in Angular that is called when a component is destroyed, allowing for cleanup tasks to be performed.
Practical benefit of using onDestroy is to release resources, such as unsubscribing fr...read more
Q9. What is hoisting,closure,event loop?
Hoisting, closure, and event loop are key concepts in JavaScript.
Hoisting is the JavaScript behavior where variable and function declarations are moved to the top of their containing scope.
Closure is the combination of a function bundled together with references to its surrounding state (lexical environment).
Event loop is a mechanism that allows JavaScript to perform non-blocking operations by offloading tasks to the browser's APIs and queuing them in a loop.
Q10. Solid design principles
Solid design principles are a set of guidelines for writing maintainable and scalable code.
Single Responsibility Principle - each class should have only one responsibility
Open/Closed Principle - classes should be open for extension but closed for modification
Liskov Substitution Principle - derived classes should be substitutable for their base classes
Interface Segregation Principle - clients should not be forced to depend on interfaces they do not use
Dependency Inversion Prin...read more
Q11. write trigger
A trigger is a database object that automatically executes in response to certain events.
Triggers can be used to enforce business rules or data integrity.
They can be defined to execute before or after a data modification operation.
Triggers can be created using SQL statements.
Examples of events that can trigger a trigger include INSERT, UPDATE, and DELETE operations.
Q12. Find duplicate element from array
Find duplicate element from array of strings
Iterate through the array and store each element in a HashSet
If an element is already in the HashSet, it is a duplicate
Q13. Delete element from linked list
To delete an element from a linked list, update the pointers of the previous node to skip the node to be deleted.
Traverse the linked list to find the node to be deleted
Update the 'next' pointer of the previous node to skip the node to be deleted
Free the memory allocated to the node to be deleted
Q14. 403 status code meaning
403 status code means forbidden access to the requested resource.
403 status code indicates that the server understood the request but refuses to authorize it.
It is commonly used when the user does not have the necessary permissions to access the resource.
Examples include trying to access a restricted page without proper credentials or attempting to perform an action that requires higher privileges.
Q15. Explain SOLID principle.
SOLID is a set of five design principles to make software designs more understandable, flexible, and maintainable.
S - Single Responsibility Principle: A class should have only one reason to change.
O - Open/Closed Principle: Software entities should be open for extension but closed for modification.
L - Liskov Substitution Principle: Objects of a superclass should be replaceable with objects of its subclasses without affecting the program's correctness.
I - Interface Segregation...read more
Q16. finally vs finalize
finally is used in exception handling to define a block of code that will always be executed, while finalize is a method in Java used for cleanup operations before an object is destroyed.
finally is used in try-catch blocks to define a block of code that will always be executed, regardless of whether an exception is thrown or not
finalize is a method in Java that is called by the garbage collector before an object is destroyed
Example: try { // code that may throw an exception }...read more
Q17. test listeners types
Test listeners types are used in software testing to monitor and respond to events during test execution.
Types of test listeners include TestNG listeners, JUnit listeners, and custom listeners
TestNG listeners include ITestListener, ISuiteListener, and IInvokedMethodListener
JUnit listeners include RunListener and TestWatcher
Custom listeners can be created to handle specific events in test execution
Interview Process at One Stop Solutions
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month