Data Structure with O(1) Set All Operation
Implement a data structure that supports the following operations, all in O(1) time complexity: - get(key): Returns the value associated with the given key. - set(key, value): Sets the value for the given key. - setAll(value): Sets all existing elements in the data structure to the specified value. Explain your approach and how you achieve constant time complexity for the setAll() operation.
Asked at:
Microsoft
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Mid March, 2026
Microsoft
Principal
Hello Interview Premium
Your account is free and you can post anonymously if you choose.