Common part of two objects

I have two figures: a cylinder and a cube with a hole. How to check if both objects have any common part using Ruby API?

What is the figure?
Is it a group/component instance or a Ruby array of faces and edges?

What would be a common part?
Is it a set of edge/face entities that are used by both figures (so they have connected geometry) or is it disconnected entities that overlap in the same space (e.g. faces in different groups) or is it shared subvolumes (e.g. intersecting solids whose edges/faces are not necessarily intersecting).

the cylinder is a group (of faces, edges) and the cube is a group too. They are two separete groups.
in my case in the pic A do NOT have common parts. in the pic B, DO.
pic A

pic B