3 ms·
Why? Its the sort of thing that is used infrequently and you can look it up online. From what I remember the quickest way to do it would be with a lookup hash.
by collyw 7y ago
Why?
Its the sort of thing that is used infrequently and you can look it up online. From what I remember the quickest way to do it would be with a lookup hash.
- pacaro 7y agoI agree that it's a relatively low signal question, its basically a fizzbuzz for bit twiddling. That being said "Its the sort of thing that is used infrequently and you can look it up online" pretty much describes interview coding questions in general I was definitely just using it as a warm-up/screener question. At the time other popular questions were: • Implement malloc • Pack this nested data structure into contiguous memory • Implement a splay tree Those weren't warm-up questions