Tavant Technologies
10+ Sagacious IP Interview Questions and Answers
Q1. Can you tell me what are the design patterns you worked?
I have worked with various design patterns including MVC, Singleton, Factory, and Observer.
MVC pattern for separating concerns in web applications
Singleton pattern for ensuring only one instance of a class is created
Factory pattern for creating objects without exposing the instantiation logic
Observer pattern for implementing event-driven architectures
Q2. Why string is immutable , is it possible to write our own immutable class?
String is immutable to ensure thread safety and security. Yes, we can write our own immutable class.
String is immutable to prevent accidental modification of data.
Immutable classes ensure thread safety and security.
We can write our own immutable class by making all fields final and not providing any setters.
Examples of immutable classes are String, Integer, and LocalDate.
Q3. Do you know difference between functional programming and object oriented programming?
Functional programming focuses on functions while object oriented programming focuses on objects and their interactions.
Functional programming emphasizes immutability and avoids side effects.
Object oriented programming uses classes and objects to encapsulate data and behavior.
Functional programming languages include Haskell and Lisp while object oriented programming languages include Java and C++.
Functional programming is often used for mathematical computations while object ...read more
Q4. What is the real time scenario , where you are using the circuit breaker ?
Circuit breaker is used to prevent cascading failures in distributed systems.
Circuit breaker is used to handle faults in microservices architecture.
It is used to prevent overloading of a service by temporarily stopping requests to it.
It helps in improving the resilience of the system by handling failures gracefully.
Example: If a service is down, circuit breaker will stop sending requests to it and will try again after a specified time interval.
It is also used for monitoring t...read more
Q5. How you previously handling microservices deployment?
I have experience using containerization tools like Docker and Kubernetes for microservices deployment.
I have used Docker to create container images for each microservice.
I have used Kubernetes to manage the deployment, scaling, and load balancing of the microservices.
I have also used Helm charts to package and deploy the microservices as a group.
I have implemented CI/CD pipelines using tools like Jenkins or GitLab to automate the deployment process.
I have monitored the micro...read more
Q6. How you implementing and validating the JWT token ?
JWT tokens are implemented and validated using a combination of server-side and client-side code.
The server generates a JWT token and sends it to the client upon successful authentication.
The client stores the token in local storage or a cookie.
For each subsequent request, the client sends the token in the Authorization header.
The server verifies the token's signature and expiration time before processing the request.
If the token is invalid or expired, the server returns a 40...read more
Q7. Which one is best constructor injection or Setter injection?
Constructor injection is preferred over Setter injection.
Constructor injection ensures that all required dependencies are provided at the time of object creation.
Setter injection allows for optional dependencies and can be used for dynamic changes.
Constructor injection is more secure as the object is fully initialized before use.
Setter injection can lead to inconsistent object states if not used carefully.
Constructor injection is easier to test and maintain.
Setter injection c...read more
Q8. Have you configured saga design pattern in your project?
Yes, I have configured saga design pattern in my project.
I have used saga design pattern to manage complex workflows and transactions.
I have implemented sagas using libraries like Redux-Saga and NServiceBus.
I have used sagas to handle scenarios like order processing, payment processing, and inventory management.
I have also used sagas to handle compensating transactions in case of failures.
Q9. Write own singleton class and secure it in multi threading environment?
A singleton class is a class that can only be instantiated once. It is important to secure it in a multi-threading environment.
Create a private constructor to prevent external instantiation
Create a private static instance of the class
Create a public static method to return the instance
Use synchronized keyword to ensure thread safety
Consider using double-checked locking to improve performance
Q10. Write code to find repeated characters in string with count using java 8?
Code to find repeated characters in string with count using Java 8
Convert string to char array
Use streams to group by character and count
Filter out characters with count less than 2
Print the repeated characters with their count
Q11. Do you know about orchestration and choreography design patterns?
Orchestration and choreography are design patterns used in distributed systems.
Orchestration involves a central controller that coordinates the interactions between services.
Choreography involves services communicating with each other directly without a central controller.
Orchestration is more suitable for complex workflows while choreography is more flexible.
Examples of orchestration tools include Kubernetes and Apache Airflow.
Examples of choreography tools include Apache Ka...read more
Q12. Get third highest salary in given employee list use java 8?
Get third highest salary in given employee list using Java 8
Sort the employee list in descending order of salary using Comparator
Use distinct() to remove duplicates
Skip the first two highest salaries using skip()
Use findFirst() to get the third highest salary
Q13. Difference between @Configuration and @Component annotations?
Difference between @Configuration and @Component annotations
The @Configuration annotation is used to define a configuration class that provides bean definitions
The @Component annotation is used to mark a class as a Spring component
Configuration classes can be imported into other configuration classes using @Import annotation
Components can be scanned and automatically registered as beans using @ComponentScan annotation
Q14. Have you involved in CI/CD process ?
Yes, I have extensive experience in implementing CI/CD pipelines.
I have worked with tools like Jenkins, GitLab CI/CD, and Travis CI.
I have automated build, test, and deployment processes for multiple projects.
I have integrated code quality checks and security scans into the pipeline.
I have also implemented blue-green and canary deployment strategies.
Overall, I understand the importance of continuous integration and delivery in modern software development.
Q15. Why we need Autowire in Spring ?
Autowire simplifies dependency injection in Spring by automatically wiring beans together.
Autowire eliminates the need for manual bean wiring in XML configuration files.
It reduces the amount of boilerplate code needed to configure dependencies.
Autowire can be used with different types of injection, such as constructor, setter, and field injection.
Example: @Autowired private MyService myService; will automatically inject the MyService bean into the field.
Example: @Autowired pu...read more
Q16. How you securing your microservices?
We secure our microservices using a combination of authentication, authorization, encryption, and monitoring.
We use OAuth2 for authentication and authorization.
We encrypt sensitive data using AES-256 encryption.
We use SSL/TLS for secure communication between microservices.
We implement rate limiting to prevent DDoS attacks.
We monitor our microservices using tools like Prometheus and Grafana.
We perform regular security audits and penetration testing.
Q17. Explain about design patterns you used ?
I have used various design patterns such as Singleton, Factory, Observer, and Decorator.
Singleton pattern was used to ensure only one instance of a class is created.
Factory pattern was used to create objects without exposing the instantiation logic to the client.
Observer pattern was used to notify the dependent objects when there is a change in the state of an object.
Decorator pattern was used to add new functionality to an existing object without altering its structure.
Q18. How to prevent sql injection?
Prevent SQL injection by using parameterized queries and input validation.
Use parameterized queries instead of concatenating user input with SQL statements
Sanitize and validate user input before using it in a query
Limit database privileges for the user account used by the application
Use prepared statements and stored procedures
Avoid displaying database error messages to users
Interview Process at Sagacious IP
Top Technical Lead Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month