Blog Archives

01: Q13 “12 Rules” for REST API design & development

These are more like rules to develop RESTFul web services as opposed to being the best practices. REST is an architectural style without any contracts or specifications. So, it is imperative to apply the following rules for better REST API design. #1. Write stateless RESTFul services This means each request…



02: Microservices Architecture design patterns & considerations interview Q&As – Part 1

This extends 10+ Key Microservices Interview Questions Answered. The architects & developers need to know these microservices design patterns & these are best practices to build robust systems. Q1. Why do we need design patterns for Microservices? A1. The goal of microservices is to increase the velocity of application releases,…



02: Scenarios based Java OO concepts & GoF design patterns – naive Template Method pattern

Scenarios based Java OO concepts & GoF design patterns


03: Microservices Architecture design patterns & considerations interview Q&As – Part 2

This extends 02: Microservices Architecture design patterns & considerations interview Q&As – Part 1. 3. Decomposition Design Patterns When decomposing the Microservices, we should avoid having tight coupling between the services. This can be achieved by duplicating the data in the required/dependent services. If you are not duplicating the data…



03: Scenarios based Java OO concepts & GoF design patterns – Strategy Pattern

The following post improves on the design flaws listed in the previous post entitled 02: Scenarios based Java OO design & GoF design patterns – naive Template Method pattern. Scenario: A company named XYZ Retail is in the business of selling Books, CDs and Cosmetics. Books are sales tax exempt…



04: Microservices Architecture design patterns & considerations interview Q&As – Part 3

This extends 03: Microservices Architecture design patterns & considerations interview Q&As – Part 2. 4. Cross-cutting concern patterns Microservices require various cross-cutting concerns such as metrics, reporting exceptions to an exception tracker, logging, distributed tracing, health checks, externalized configuration, and security. Additionally, a service may need to handle service discovery…



05: Microservices Architecture design patterns & considerations interview Q&As – Part 4

This extends 04: Microservices Architecture design patterns & considerations interview Q&As – Part 3. 4. Observability patterns Microservices require various cross-cutting concerns such as metrics, reporting exceptions to an exception tracker, logging, distributed tracing, health checks, externalised configuration, and security. Additionally, a service may need to handle service discovery and…



06: Web design patterns MVC2, MVP, MVVM & MVW

Q1. What’s wrong with Servlets? What is a JSP? What is it used for? What do you know about model 0 (aka MVC0), model 1 (aka MVC1) and model 2 (aka MVC2) patterns? In “model 2” architecture, if you set a request attribute in your JSP, would you be able…

Tags:

06: Microservices Architecture design patterns & considerations interview Q&As – Part 5

This extends 05: Microservices Architecture design patterns & considerations interview Q&As – Part 4. 5. Deployment patterns Microservices enable your development team to roll out software solutions more quickly and better react to customer needs. Microservices deployment patterns or considerations enable easy deployments and allow you to modify microservices. Problem…



12 Java design patterns interview Q&As

Q1. Why use design patterns? A1. 1) Capture design experience from the past: E.g. Facade and value object patterns evolved from performance problems experienced due to multiple remote calls. 2) Promote reuse without having to reinvent the wheel: E.g. The flyweight pattern improves application performance through object reuse, which minimizes…



14: Singleton design pattern in Java & 5 key follow up Interview Q&As

When you are asked in job interviews to explain a design pattern that you had used, many pick “singleton” as it is easy to explain. But, “singleton” design pattern does have lots of nuances that can lead to further drill down questions mentioned in this post. This post also explains…



4 JEE Design Patterns Interview Q&As

Unlike J2EE, Java EE 6 consists of annotated classes without any dependencies on the platform. This approach eliminates the need to separate business logic from the infrastructure and makes the majority of J2EE patterns and best practices superfluous. The following J2EE design patterns can be obsolete: — Service Locator (Use…



Builder pattern and immutability in Java

Next time you are asked to explain a design pattern in an interview, you could pick this as opposed to the very common factory and singleton design patterns. Q1. How will you go about using a builder design pattern instead of constructors to create thread-safe immutable objects? A1. Immutable objects…



Design pattern intents interview Q&A

Q1. Why do Proxy, Decorator, Adapter, Bridge, and Facade design patterns look very similar? A1. Some design patterns do have subtle differences, and it is important to understand the intent of a pattern. Decorator and chain of responsibility may look similar but the intent is different. Decorator has a subtle…



EIP

Q1. What is EIP, and why do you need it? A1. EIP stands for “Enterprise Integration Patterns”. EIP was created by Gregor Hohpe and published via the cook book entitled “Enterprise Integration Patterns”. Today’s business applications rarely live in isolation. Architecting integration solutions is a complex task. There are many…



Flyweight design pattern to improve memory usage & performance

Flyweight pattern is about sharing a collection of objects. The flyweight design pattern is a structural pattern used to improve memory usage and performance (i.e. due to shorter and less frequent garbage collections) by creating fewer objects. Instead of creating a large number of objects, we reuse the objects that…



Java ExecutorService with strategy design pattern to execute concurrently & sequentially

Java executor framework for running multi-threaded applications concurrently, sequentially, and with a strategy design pattern to switch between sequential and concurrent execution. 1. Running concurrently



Proxy design pattern in Java with service retry example

Design pattern: If you are asked to describe or talk about a design pattern, you could mention this dynamic proxy class as a proxy design pattern. Many pick either singleton or factory design pattern. It would be nicer to pick something other than these two common patterns. Some interviewers specifically…



Why do Proxy, Decorator, Adapter, Bridge, and Facade design patterns look similar? What are the differences?

There are often patterns that look very similar, but differ in their intent. Most patterns use polymorphism with interface inheritance. Strategy and state design patterns are very similar as well. Proxy, Decorator, Adapter, and Bridge are all variations on “wrapping” a class. Facade design pattern is a container for the…



Why does good API design matter?

Q1. Why is a good API design important? A1. The Application Programming Interfaces (i.e. APIs) are fine grained services/libraries used by other applications, systems and libraries. A good API design improves flexibility, stability, and extendability of your application. Now a days, applications are built as reusable components or services. A…

Tags:

300+ Java & Big Data FAQs - Quick Prep

Java & Big Data Tutorials

Top