Carpet beetles damage things in portions, unlike moth which leaves scattered holes in any fabric or rug. Especially in the reproduction stage, when beetle is in the stage of larva it is the most damaging. It leaves a brown, shell-like skins when they molt.
If you feel that your carpet has been infested by carpet beetles, you need to take some urgent steps to prevent damage. If cleaning is not possible due to large size of the rug or carpet, spray an insecticide to prevent reproduction. You can also put boric acid. But, before you take any step ensure that you understand the consequences. Boric acid can adversely affect people who have respiratory or other health issues. Insecticides can damage expensive rugs or leave a stain on the rug, so, it is always better to hire a professional and experienced carpet cleaning firm to get rid of these pests.