Microsoft interview question

2 Medium DSA problems on Codility OOP - Design an IP address allocator