#Design LRU Cache or Application Cache Problem Statement Application Cache An Application stores several entities, such as users, roles and organizations, in a database. During testing, it is found that the performance of the application is not good. On analysis, it is found that repeated DB access is causing a performance bottleneck. The solution is to come up with an in memory cache that caches recently used (evict LRU) entities. You are required to implement a cache based on this requirement. This cache framework should be generic enough to operate over all types of entities. You also need to implement a class, UserManager that uses the cache to improve performance. UserManager needs to have createUser, modifyUser, deleteUser and searchUser functionality. Guidelines:
- Implement all operations of cache such as put, modify, get and flush.
- Minimize the time complexities (execution time) for each supported cache operation.
- The API for Cache should be well designed.
- Use Design Patterns as appropriate
- You can assume a DBStore interface/mock for fetching any data from DB
General Guidelines:
- Code should be answered using Java only, preferably Java 5.0 or above.
- Program should not be dependent on third party libraries.
- Readability, Extensibility and Testability are the major perspectives code should be presented.
- Evaluator should be able to understand and test the code without coder’s intervention.
- Assumptions, if any, should be practical and near to real world scenarios
How to import this Project :
Method I:
- Download Zip from https://github.com/tusharseth1990/ApplicationCacheProject and extract the same into one folder
- In eclipse >> File >> Open Project from File System
- click Directory to select Import Source Path and select the folder ApplicationCache
- Next Finish
Method II:
- Go to Eclipse
- File >> Import >> Git >> Projects from Git(with smart Import)
- click Next >> Clone URL >> Add this URL in URI i.e. https://github.com/tusharseth1990/ApplicationCacheProject.git
- Click Next >> Select main (select All) >> Click Next
- Select & Browse from Directory till ApplicationCache & select save
- Click Finish