What is the most efficient way to find the shared space occupied by two overlapping cube objects?

I'm not necessarily looking for source code, just the general idea on how it should be solved.

To simplify, the algorithm doesn't have to take into account rotated cubes.