The measurement can be influenced by practice. The g factor—the thing IQ tests are designed to measure—appears to be immune to practice, though I am not sure how this was determined.
Similar tests, like the SAT and GRE, are designed to work even with practice. They have other problems.