Step 1: Define key properties of molding sand.
Molding sand needs specific properties to produce good castings. Let's define the options:
Permeability: This is the property of molding sand to allow gases to escape from the mold cavity during pouring and solidification. It is important to prevent gas defects.
Cohesiveness (or Green Strength): This is the ability of sand grains to stick together, giving the mold sufficient strength to retain its shape after the pattern is removed and during handling, pouring, and solidification. It is due to the bonding action of clay and moisture in the sand.
Adhesiveness: This is the property of molding sand to stick to the surfaces of the molding flask or the pattern. It allows the sand to hold together within the flask and provides a smooth mold surface upon pattern removal.
Collapsibility: This is the property of molding sand to break down or collapse after the molten metal has solidified. This allows the casting to shrink freely without developing hot tears and facilitates easy removal of the casting from the mold during shakeout.
Step 2: Identify the property matching the description.
The question asks for "The property of sand by virtue of which sand grains stick together".
Based on the definitions, cohesiveness (also known as green strength) is the property that describes the ability of sand grains to stick together, allowing the mold to hold its shape.
The final answer is \( \boxed{\text{2}} \).