WD interview question

Write a function that accepts a base 10 digit and reverses the base 2 bits equivalent. Ex: input 8 (base10) = 1000(base 2), Output would be 0001 (base 2) = 1 (Base10).