3. 3
Issues of
Single Pattern
For what there’re so many
ways to implement?
• Normal Singleton
• Thread-safe Singleton (Synchroized)
• Thread-safe Singleton (Double Click Lock)
• Private inner static Singleton
• Initialized First Singleton
• Enum Singleton
12. Design data structures and algorithms for in-memory file system
12
• Composite Pattern
• Folder
• Files
• Name
• Created Date
• Create
• Write
• Modify
• Delete
15. § Three type of Cars( ! , " , #)
§ Spaces
Bus needs 3 spaces
Car needs 1 space
Auto-bike needs 1 space
Design a parking lot
Using object-oriented principles
15