Amdocs
Cut and Style Salon Interview Questions and Answers
Q1. What would you use to store password? String or CharArray?
CharArray should be used to store passwords for security reasons.
CharArray is more secure as it can be cleared from memory after use, unlike String which is immutable
String objects are stored in the String pool and can be accessed by other parts of the program
CharArray allows for more control over the password data and reduces the risk of exposure
Q2. How do you convert Monolith to Microservices?
Convert Monolith to Microservices involves breaking down a large application into smaller, independent services.
Identify bounded contexts within the monolith
Decompose the monolith into separate services based on identified bounded contexts
Implement communication between services using APIs or messaging queues
Use containerization technologies like Docker for deployment
Implement service discovery and load balancing for efficient communication between services
Q3. What is an API Gateway in Microservices?
API Gateway in Microservices acts as a single entry point for all client requests to access multiple microservices.
API Gateway handles authentication, authorization, load balancing, caching, and routing of requests to appropriate microservices.
It helps in decoupling client applications from individual microservices, providing a more centralized and manageable architecture.
Examples of API Gateways include Netflix Zuul, Amazon API Gateway, and Kong.
Q4. Implementation of database connection pool in java
Database connection pool in Java helps manage multiple database connections efficiently.
Use a connection pool library like HikariCP or Apache DBCP.
Set up the pool with a maximum number of connections, timeout settings, etc.
Acquire and release connections from the pool as needed in your Java code.
Q5. What is a Spring Actuator?
Spring Actuator is a feature in Spring Boot that allows monitoring and managing the application.
Spring Actuator provides endpoints to monitor application health, metrics, info, etc.
It helps in understanding the internal state of the application and its performance.
Actuator endpoints can be accessed over HTTP, providing useful information for monitoring tools.
Example: /actuator/health, /actuator/metrics, /actuator/info
Q6. Difference between prototype and singleton scope
Prototype scope creates a new instance for each injection, while singleton scope creates a single instance for all injections.
Prototype scope creates a new instance every time it is injected, while singleton scope creates a single instance for all injections.
Prototype scope is useful when you want a new instance each time, like for stateful objects. Singleton scope is useful for sharing a single instance, like for stateless services.
Example: In a web application, a prototype-...read more
Q7. Implement singly linked list in java
Singly linked list implementation in Java
Create a Node class with data and next pointer
Implement methods for adding, removing, and traversing nodes
Update pointers accordingly when adding or removing nodes
Q8. Stacks using queue
Implementing a stack using two queues
Use two queues to simulate a stack
Push operation: Enqueue the element to queue 1
Pop operation: Dequeue all elements from queue 1 to queue 2, dequeue the last element from queue 1, then swap the queues
Top operation: Return the front element of queue 1
Example: Push 1, 2, 3 - Queue 1: [1, 2, 3], Queue 2: []
Example: Pop - Queue 1: [1, 2], Queue 2: [3]
Interview Process at Cut and Style Salon
Top Senior Software Engineer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month