The United Nations has provided assistance to countries in taking census or sample surveys, for example, in Timor-Leste, a small south east Asian nation.
As a result, most countries in the world produce some form of demographic data. Developed countries tend to have more reliable data. This does not mean that a census in developed countries is always 100 per cent reliable. In the UK for example, many homeless people will be unaccounted for.
There are many reasons why census taking is difficult:
Census taking is expensive.
Nomadic people pose a problem as they move from place to place. They may be counted twice or missed out altogether. This is a particular problem in African countries.
Illegal immigrants in places such as the USA may not want to be counted.
Under-registration is common. In China for instance, many baby girls are unregistered because of the one-child policy.
Low levels of literacy in developing countries mean that many people struggle with the forms.
There may be more than one language spoken in a country, such as in India. This means forms may need to be printed in more than one language and this increases costs.
Migration is also a problem in many developing countries. In places like Brazil, many people move from rural areas to urban areas to live in favelas (shanty towns) and won't be counted.
Poor communication links and infrastructure make census taking difficult and expensive. In developing countries many people live in scattered areas and are difficult to access.
Large countries such as Sudan, or mountainous countries like Afghanistan, have difficulties with collecting census data due to accessibility. Both have also suffered war, which again makes census taking difficult.