How to make a mesh surface that looks like cubes stacked in the shape of a sphere?
One possible way to do this would be to use the 'Remesh' modifier. It has an option to turn the selected object into blocks, though specifying the exact amount of blocks may be a bit difficult.

Here I have a UV Sphere with a remesh modifier set to 'Blocks'. I also added a Subsurf modifier before it so that the surface is smoother for the remesh:



You can use the 'Octree Depth' property to increase the resolution, but it will get increasingly slow when increasing this number.