This. I've been writing code for 20+ years, in several languages. Could I write the b-tree piece they asked for after 20+ hours of likely no sleep, from the top of my head? Probably not.
If I had to solve the b-tree problem as part of something I work on, I'd not even think to roll my own, I'd look at existing implementations and most likely find a library, where someone much closer to the problem as already solved it properly.
Also, this exercise assumes they have someone on hand that would be able to evaluate the solution without bias.