How do you spot errors in data? I was in an interview recently for a job where I'd been given a task relating to some employee data that had obvious errors in it. I've worked with data in jobs for years where I could just look at the (small sets of) data and use my domain knowledge and know if it's messed up - I didn't need any theory behind me.
It's such an obvious question but it totally threw me. I listed a few things I would try, like to view by employee ID and eyeball it, but it was still a method that would apply only to small sets of data. Obviously, you're not going to eyeball 7 million records.
Is there a certain data science term for error-spotting so I can research it? Alternately, what might you say?
Edit: Just realised I hadn't stated the actual question I was asked, and it was "Having established that there are errors in the data, how do you go about finding out what they are?"
 A: 'Interview' questions are often vague, as is this one. They may be asked just to discover how you would think about approaching a problem. Sometimes there would be no way to give an exact 'solution'. At least, you can try to make it clear you have understood the question.
Suppose the records are input by hand by many people over time. Errors can arise by making typographical errors---especially if the person doing the data entry is having a bad day. They can arise if an employee filling out a paper or online form, misunderstands instructions and puts information into the wrong field. What are automated ways to scan for errors?
You can scan each type of item looking for obvious anomalies.

*

*In numerical data
boxplots may help, but you can also look for entries outside what you view as a
reasonable span of values (impossible negative or 0 values, age over 100, etc.)


*In categorical data you can look at a tally. If typical values are integers 1 through 5, then look for any other responses.


*If there are obvious correlations between two variables, make a scatterplot and look for points beyond the edges of the
data cloud that might not be outliers on a univariate plot. (Or try regressing one variable on several others and look at huge outliers among residuals.)


*What is an unreasonable answer may vary over time. Look at successive differences for outliers. Plot data against time looking for abrupt changes in trend or brief departures from trend.
Plots of crude examples: numeric variables, $n = 10,000.$

Categorical example.
x = sample(1:5, 10^4, rep=T)
x[500] = 0; x[600] = 8; x[1000] = 123
table(x)
x
   0    1    2    3    4    5    8  123 
   1 1986 1979 2037 1986 2009    1    1 

Note:
# R code for panel of plots 
x1 = rnorm(10^4, 100, 10)
x2 = 3*(x1 - 10)^2
x1[201:220] = rexp(20, 1/100)+100
x1[5001:5010] = 1010:1001
par(mfrow=c(2,2))
 boxplot(x1, main="Boxplot")
 plot(x1, type="l", main="Sequence")
 plot(diff(x1),type="l", main="Differences")
 plot(x1, x2, pch=20, main="Association")
par(mfrow=c(1,1))

A: The existing answer is a good one for outlier detection, but I would like to reference Abedjan et al which demonstrates several kinds of error detection and evaluates some methods for excuting them. Namely,

*

*Rule based detection such as the values being outside an acceptable range

*Pattern enforcement and transformation (syntactics and semantics)

*Quantitative error detection (outliers, see the answer by BruceET)

*Record Linkage and de-duplication

