How are public workers hired in your country?

In Spain, public sector jobs are assigned via competitive exams requiring candidates to memorize around 1,000 pages of material. Successful candidates gain virtually permanent employment, regardless of performance, they are not allowed to get fired.

Does your country’s civil service operate under a similar hiring system?