In class 3 and class 5 cavity  preparation  retention grooves are given:
In class III class IV preparations the external walls diverge outwards to provide string enamel margins and therefore Retention Coves (on 3-point angles) or Retention grooves (on axio gingival line angle) are prepared in the dentinal walls to provide the retention form.
Over dentinal wall.
Over facial and lingual walls.
Over axial wall
All of the above