Repository navigation
interview platform
equals - hash code dependany injection - type gc - generations
well tested class
-
Single Responsibility Principle (SRP) A class should do one thing. If your class handles user data, validates it, and writes it to a file, it's very difficult to test. Break it down into smaller, focused classes
-
Dependency Injection Don't hardcode external services or complex objects (e.g., databases, network requests) inside your class. Pass them via the constructor. This allows you to easily substitute them with "mocks" or "stubs" during testing.
-
Rely on Interfaces Instead of depending on concrete implementations, depend on interfaces or abstract classes.
-
Separate State and Behavior Design your class so that its methods act primarily on the inputs they receive, rather than relying heavily on global or internal state. Pure functions (methods that always return the same output for the same input) are trivial to test.
-
Expose the Right Interface, Hide Implementation Keep data private or protected and expose only the necessary public methods.
calculation
- cost
- velocity
My footer
My side bar