Midshipman
A midshipman is a junior officer in training in the Royal Navy. Historically, midshipmen were young men serving aboard ships to gain practical experience in seamanship, navigation, and leadership as preparation for commissioned rank.
The role combined elements of apprenticeship and formal instruction. Midshipmen lived and worked among the crew but were expected to learn the duties of an officer, often under demanding conditions at sea.
Source:
Oxford Companion to Ships and the Sea
Royal Navy Careers – Midshipman