Among all the triangles which have a fixed side $l$ and a fixed area $S$, determine for which triangles the product of the altitudes is maximum.
1. Let's denote the fixed side of the triangle as \( l \) and the fixed area as \( S \). The altitude corresponding to the side \( l \) is given by:
   \[
   h_l = \frac{2S}{l}
   \]
   This is because the area of the triangle can be expressed as:
   \[
   S = \frac{1}{2} \times l \times h_l \implies h_l = \frac{2S}{l}
   \]

2. Let the other two sides of the triangle be \( a \) and \( b \), and let the angle opposite the side \( l \) be \( \theta \). The altitudes corresponding to the sides \( a \) and \( b \) are:
   \[
   h_a = b \sin \theta \quad \text{and} \quad h_b = a \sin \theta
   \]

3. The product of the altitudes \( h_a \) and \( h_b \) is:
   \[
   h_a \cdot h_b = (b \sin \theta) \cdot (a \sin \theta) = ab \sin^2 \theta
   \]

4. The area of the triangle can also be expressed using the sides \( a \), \( b \), and the angle \( \theta \) as:
   \[
   S = \frac{1}{2} ab \sin \theta \implies ab \sin \theta = 2S
   \]

5. Substituting \( ab \sin \theta = 2S \) into the expression for the product of the altitudes, we get:
   \[
   h_a \cdot h_b = ab \sin^2 \theta = \frac{(ab \sin \theta)^2}{ab} = \frac{(2S)^2}{ab} = \frac{4S^2}{ab}
   \]

6. To maximize the product of the altitudes, we need to maximize \( \sin \theta \). The maximum value of \( \sin \theta \) is 1, which occurs when \( \theta = 90^\circ \). Therefore, the triangle should be a right triangle with \( \theta = 90^\circ \).

Conclusion:
The product of the altitudes is maximized when the triangle is a right triangle with the fixed side \( l \) as one of the legs.

The final answer is the triangle should be a right triangle with the fixed side \( \boxed{ l } \) as one of the legs.