obligatorisch
mandatory
Required by a rule, law, or regulation; compulsory.
Die Teilnahme am Sicherheitstraining ist für alle neuen Mitarbeiter obligatorisch.
Participation in the safety training is mandatory for all new employees.

mandatory
Loading your saved state.
mandatory
Required by a rule, law, or regulation; compulsory.
Die Teilnahme am Sicherheitstraining ist für alle neuen Mitarbeiter obligatorisch.
Participation in the safety training is mandatory for all new employees.

'Obligatorisch' (mandatory) is a formal, official word. You mainly find it in regulations, contracts, study regulations, or official notices.
In vielen Ländern ist eine Krankenversicherung obligatorisch.
In many countries, health insurance is mandatory.
The adjective is very often used with the verb 'sein' (to be) predicatively. To express for whom something is mandatory, the preposition 'für' (for) with the accusative is used.
Das Tragen eines Helms ist für alle Radfahrer auf dem Werksgelände obligatorisch.
Wearing a helmet is mandatory for all cyclists on the company premises.
Common nouns used with 'obligatorisch' (mandatory) are 'Teilnahme' (participation), 'Kurs' (course), 'Fach' (subject, in school/university), or 'Prüfung' (exam).
Der Erste-Hilfe-Kurs ist ein obligatorischer Teil der Führerscheinausbildung.
The first-aid course is a mandatory part of driving-license training.
necessary
'notwendig' and 'obligatorisch' both say that you cannot simply leave something out. The difference is the reason. 'notwendig' means: something is really needed for a goal or situation. 'obligatorisch' means: a rule, regulation, or law requires it. Learners may confuse the words because both sound like 'you have to'. So ask yourself: Do you have to do it because of the situation itself? Then use 'notwendig'. Do you have to do it because of a rule? Then use 'obligatorisch'.

Bei der Prüfung ist ein Ausweis obligatorisch.
An ID is mandatory for the exam.
Beim Training ist gutes Aufwärmen notwendig, damit sich niemand verletzt.
In training, warming up properly is necessary so that no one gets injured.