This question is normally asked to experienced developer to see how much coding they have done and whether they remember best practices while coding or not. They key here is modularity because your code should be easy for other modules and app to be reused.
For example, when designing a class that is responsible for sending HTTP requests to external clients, there are a number of design considerations that should be taken into account for example:
Separation of Concerns
The class should be designed to focus on sending HTTP requests and handling the response, while delegating other concerns (such as data validation and processing) to other classes or components.
Encapsulation
The class should encapsulate the HTTP request and response logic to promote modularity and maintainability. This will allow other parts of the application to use the class without having to worry about the implementation details.
Configuration
The class should be designed to allow for flexible configuration of parameters such as timeouts, retries, and connection settings. This will allow other applications to easily customize the behavior of the class to suit their needs.
Error Handling
The class should be designed to handle errors and exceptions gracefully, and provide clear and informative error messages to users. This will help to ensure that other applications can easily diagnose and fix any issues that arise.
Performance
The class should be designed to be efficient and performant, minimizing latency and resource usage as much as possible. This will help to ensure that other applications can make use of the class without encountering performance issues.
Security
The class should be designed to ensure the security of any sensitive information that is transmitted through HTTP requests. This may involve using encryption and authentication mechanisms, as well as complying with any relevant security standards or regulations.
Testing
The class should be designed to be easily testable, with appropriate unit and integration tests to ensure that it functions correctly and meets the requirements of other applications that use it.