{"id":2837,"date":"2026-10-12T04:52:05","date_gmt":"2026-10-12T04:52:05","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=2837"},"modified":"2026-10-14T14:34:43","modified_gmt":"2026-10-14T14:34:43","slug":"statistics-interview-questions","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/","title":{"rendered":"Statistics Interview Questions"},"content":{"rendered":"<h1><strong><b>Most Asked Statistics Interview Questions and Answers for Data Science\u00a0<\/b><\/strong><\/h1>\n<p>Statistics is the part of a data science or data analyst interview where small wording mistakes cost the most. Interviewers listen for whether you can define a p value correctly, read a confidence interval without overclaiming, choose a sensible test and explain the result in plain words. This guide gives you 47 statistics interview questions and answers, with worked numeric examples for the ideas that come up most.<\/p>\n<p>Every answer starts with a short, direct response you can say aloud, followed by a table, a worked example or code that was run before it was added, so the printed numbers are real. Formulas are written in words, so nothing depends on an image. Where a topic overlaps with machine learning or experimentation, the answer stays brief and points to the matching interview page.<\/p>\n<p>The guide has six parts: 11 questions on descriptive statistics and sampling, 7 on probability and distributions, 13 on hypothesis testing and confidence intervals, 6 on correlation and regression, 7 on advanced and applied topics, and 3 on explaining statistics to non technical people. A test selection table near the end of the inference section helps you decide quickly which test fits a problem.<\/p>\n<h3><strong><b>Key points<\/b><\/strong><\/h3>\n<ul>\n<li>47 questions in six parts, from descriptive statistics to regression and bias.<\/li>\n<li>Worked numeric examples for the z score, Bayes theorem, binomial, Poisson, z test, t test, confidence interval and chi square.<\/li>\n<li>A formula table and a test selection table in plain text.<\/li>\n<li>Code samples were run, and the real output is shown.<\/li>\n<li>Corrects common wrong answers about the p value, the z score and the t test.<\/li>\n<\/ul>\n<h3><strong><b>In this guide<\/b><\/strong><\/h3>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 560px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">What this guide covers<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Section<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 150px;\" scope=\"col\">Questions<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Descriptive Statistics and Sampling (Freshers)<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0; white-space: nowrap;\">Q1 to Q11<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Probability and Distributions (Intermediate)<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0; white-space: nowrap;\">Q12 to Q18<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Hypothesis Testing and Confidence Intervals (Intermediate)<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0; white-space: nowrap;\">Q19 to Q31<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Correlation and Regression (Intermediate and Experienced)<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0; white-space: nowrap;\">Q32 to Q37<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Advanced and Applied Statistics (Experienced)<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0; white-space: nowrap;\">Q38 to Q44<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a;\" scope=\"row\">Explaining Statistics to Non Technical People (All Levels)<\/th>\n<td style=\"padding: 12px 16px; white-space: nowrap;\">Q45 to Q47<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h2><strong><b>Descriptive Statistics and Sampling (Freshers)<\/b><\/strong><\/h2>\n<p>Every statistics interview begins with how you describe data. These answers include short worked examples, so you can show the working and not only state the definition.<\/p>\n<h3><strong><b>Q1. What is the difference between descriptive and inferential statistics?<\/b><\/strong><\/h3>\n<p>Descriptive statistics summarise the data you have, using measures such as the mean, median, spread and charts. Inferential statistics use a sample to draw conclusions about a larger population, and report how uncertain those conclusions are, through confidence intervals and hypothesis tests. Describing 200 survey replies is descriptive. Estimating what all customers think from them is inferential.<\/p>\n<h3><strong><b>Q2. What is the difference between a population and a sample, and a parameter and a statistic?<\/b><\/strong><\/h3>\n<p>A population is every unit you want to study, and a sample is the subset you actually observe. A parameter is a fixed number that describes the population, such as the true mean. A statistic is a number calculated from a sample, such as the sample mean, which is used to estimate the parameter.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 700px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Population and sample terms<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 250px;\" scope=\"col\">Term<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Describes<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Symbol usually used<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Example<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Population mean (parameter)<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The whole population<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">mu<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Average salary of all analysts in India<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Sample mean (statistic)<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The sample<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">x bar<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Average salary of 500 surveyed analysts<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Population standard deviation<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The whole population<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">sigma<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Spread of all salaries<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a;\" scope=\"row\">Sample standard deviation<\/th>\n<td style=\"padding: 12px 16px;\">The sample<\/td>\n<td style=\"padding: 12px 16px;\">s<\/td>\n<td style=\"padding: 12px 16px;\">Spread of the 500 salaries<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q3. What are the four levels of measurement?<\/b><\/strong><\/h3>\n<p>Nominal data names categories with no order, such as city. Ordinal data has an order but unequal gaps, such as a rating of poor, fair or good. Interval data has equal gaps but no true zero, such as temperature in Celsius. Ratio data has equal gaps and a true zero, such as income or height. The level decides which statistics make sense.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 760px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Levels of measurement<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 110px;\" scope=\"col\">Level<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Order<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Equal gaps<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">True zero<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Example<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Sensible summary<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Nominal<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">No<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">No<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">No<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">City, gender<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Mode, counts<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Ordinal<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Yes<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">No<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">No<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Satisfaction rating<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Median, mode<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Interval<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Yes<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Yes<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">No<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Temperature in Celsius<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Mean, standard deviation<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Ratio<\/th>\n<td style=\"padding: 12px 16px;\">Yes<\/td>\n<td style=\"padding: 12px 16px;\">Yes<\/td>\n<td style=\"padding: 12px 16px;\">Yes<\/td>\n<td style=\"padding: 12px 16px;\">Income, weight<\/td>\n<td style=\"padding: 12px 16px;\">Mean, standard deviation, ratios<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q4. What are mean, median and mode, and when do you use each?<\/b><\/strong><\/h3>\n<p>The mean is the sum of the values divided by their count, the median is the middle value when the data is sorted, and the mode is the most frequent value. Use the mean for symmetric data, the median for skewed data or data with outliers, and the mode for categories. In right skewed data the mean is larger than the median.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom statistics import mode\r\n\r\ndata = [3, 4, 4, 5, 6, 7, 40]\r\n\r\nprint(\"mean:  \", round(np.mean(data), 2))\r\nprint(\"median:\", np.median(data))\r\nprint(\"mode:  \", mode(data))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">mean:   9.86\r\nmedian: 5.0\r\nmode:   4<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The single value of 40 pulls the mean well above the median, which is why the median is a better description of a typical value here.<\/p>\n<h3><strong><b>Q5. How do you calculate variance and standard deviation, and why does the sample version divide by n minus 1?<\/b><\/strong><\/h3>\n<p>Variance is the average squared distance from the mean, and the standard deviation is its square root, which returns the spread to the original unit. For a sample, divide by n minus 1 and not n, because a sample mean sits closer to its own data than the true mean does, so dividing by n underestimates the spread.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\n\r\ndata = np.array([4, 8, 6, 5, 3, 7])\r\n\r\nmean = data.mean()\r\nsquared = ((data - mean) ** 2)\r\n\r\nprint(\"mean:\", mean, \" sum of squared distances:\", squared.sum())\r\nprint(\"sample variance (divide by n minus 1):\", round(squared.sum() \/ (len(data) - 1), 2))\r\nprint(\"population variance (divide by n):    \", round(squared.sum() \/ len(data), 2))\r\nprint(\"sample standard deviation:\", round(data.std(ddof=1), 2))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">mean: 5.5  sum of squared distances: 17.5\r\nsample variance (divide by n minus 1): 3.5\r\npopulation variance (divide by n):     2.92\r\nsample standard deviation: 1.87<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Worked by hand: the mean is 5.5, the squared distances add up to 17.5, so the sample variance is 17.5 divided by 5, which is 3.5, and the standard deviation is about 1.87.<\/p>\n<h3><strong><b>Q6. What are quartiles and the interquartile range, and how do they find outliers?<\/b><\/strong><\/h3>\n<p>Quartiles split sorted data into four equal parts. The first quartile Q1 is the 25th percentile and the third quartile Q3 is the 75th percentile. The interquartile range is Q3 minus Q1. A common rule flags values below Q1 minus 1.5 times the range, or above Q3 plus 1.5 times the range, as outliers.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\n\r\ndata = np.array([12, 14, 15, 15, 16, 17, 18, 19, 95])\r\n\r\nq1, q3 = np.percentile(data, [25, 75])\r\niqr = q3 - q1\r\nlow, high = q1 - 1.5 * iqr, q3 + 1.5 * iqr\r\n\r\nprint(\"Q1:\", q1, \"Q3:\", q3, \"IQR:\", iqr)\r\nprint(\"fences:\", low, high)\r\nprint(\"outliers:\", data[(data &lt; low) | (data &gt; high)])<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">Q1: 15.0 Q3: 18.0 IQR: 3.0\r\nfences: 10.5 22.5\r\noutliers: [95]<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q7. What are skewness and kurtosis?<\/b><\/strong><\/h3>\n<p>Skewness measures the lack of symmetry. A right skewed distribution has a long tail on the high side and the mean is above the median, as with income. Kurtosis measures how heavy the tails are compared with a normal distribution, which means how prone the data is to extreme values. Positive excess kurtosis means heavier tails.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy import stats\r\n\r\nrng = np.random.default_rng(3)\r\nsymmetric = rng.normal(50, 10, 5000)\r\nright_skewed = rng.exponential(10, 5000)\r\n\r\nprint(\"normal data skewness:      \", round(stats.skew(symmetric), 2))\r\nprint(\"right skewed data skewness:\", round(stats.skew(right_skewed), 2))\r\nprint(\"normal data excess kurtosis:\", round(stats.kurtosis(symmetric), 2))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">normal data skewness:       -0.01\r\nright skewed data skewness: 1.94\r\nnormal data excess kurtosis: -0.07<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q8. What is the normal distribution, and what is the 68 95 99.7 rule?<\/b><\/strong><\/h3>\n<p>The normal distribution is a symmetric bell shaped distribution fully described by its mean and standard deviation. For normal data, about 68 percent of values lie within one standard deviation of the mean, about 95 percent within two and about 99.7 percent within three. The rule applies only to data that is approximately normal.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">from scipy import stats\r\n\r\nfor k in (1, 2, 3):\r\n    share = stats.norm.cdf(k) - stats.norm.cdf(-k)\r\n    print(f\"within {k} standard deviation(s): {share:.3f}\")<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">within 1 standard deviation(s): 0.683\r\nwithin 2 standard deviation(s): 0.954\r\nwithin 3 standard deviation(s): 0.997<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q9. What is a z score? Show a worked example.<\/b><\/strong><\/h3>\n<p>A z score is a value minus the mean, divided by the standard deviation. It tells you how many standard deviations a value is from the mean, so scores from different scales can be compared. It can be any positive or negative number. Values beyond about 3 in either direction are rare in normal data.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">from scipy import stats\r\n\r\nmean, sd = 70, 10\r\nscore = 85\r\n\r\nz = (score - mean) \/ sd\r\nprint(\"z score:\", z)\r\nprint(\"percentile:\", round(stats.norm.cdf(z) * 100, 1))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">z score: 1.5\r\npercentile: 93.3<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>A score of 85 on a test with mean 70 and standard deviation 10 has a z score of 1.5, which puts it at about the 93rd percentile if scores are normally distributed.<\/p>\n<h3><strong><b>Q10. What are the main sampling methods, and what is sampling bias?<\/b><\/strong><\/h3>\n<p>Simple random sampling gives every unit an equal chance. Stratified sampling splits the population into groups and samples each group, which guarantees representation. Cluster sampling picks whole groups at random, and systematic sampling takes every kth unit. Sampling bias happens when the sample systematically differs from the population, for example surveying only online users.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 640px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Sampling methods<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 160px;\" scope=\"col\">Method<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">How it works<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Best when<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Simple random<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Every unit has an equal chance<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">You have a complete list of the population<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Stratified<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Sample within each subgroup<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Subgroups differ and all must be represented<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Cluster<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Randomly pick whole groups, then survey all within them<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The population is spread out and a list is costly to build<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Systematic<\/th>\n<td style=\"padding: 12px 16px;\">Take every kth unit from a list<\/td>\n<td style=\"padding: 12px 16px;\">You need a quick sample from an ordered list<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q11. Which statistical formulas should you know for an interview?<\/b><\/strong><\/h3>\n<p>Know these in words, and be able to say what each one tells you. The mean, sample variance, standard deviation, standard error, z score, confidence interval and correlation cover most first round questions. Interviewers ask for meaning more often than for memorised symbols.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 700px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Key statistics formulas in words<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 220px;\" scope=\"col\">Measure<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Formula in words<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">What it tells you<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Mean<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Sum of values divided by the count<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">The centre of the data<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Sample variance<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Sum of squared distances from the mean, divided by n minus 1<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">How spread out the data is, in squared units<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Standard deviation<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Square root of the variance<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Spread in the original unit<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Standard error of the mean<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Standard deviation divided by the square root of n<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">How precisely the sample mean estimates the population mean<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Z score<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">(Value minus mean) divided by standard deviation<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Distance from the mean in standard deviations<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">95 percent confidence interval for a mean<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Mean plus or minus critical value times standard error<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">A plausible range for the true mean<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a;\" scope=\"row\">Pearson correlation<\/th>\n<td style=\"padding: 12px 16px;\">Covariance of x and y divided by the product of their standard deviations<\/td>\n<td style=\"padding: 12px 16px;\">Strength and direction of a linear relationship, from minus 1 to 1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h2><strong><b>Probability and Distributions (Intermediate)<\/b><\/strong><\/h2>\n<p>Probability questions test whether you can reason step by step. Write down what you know, name the rule you are using and then calculate.<\/p>\n<h3><strong><b>Q12. What is the difference between independent and mutually exclusive events?<\/b><\/strong><\/h3>\n<p>Two events are independent when one happening does not change the probability of the other, so the probability of both is the product of their probabilities. Two events are mutually exclusive when they cannot happen together. Mutually exclusive events with non zero probability are never independent, because if one happens the other is impossible.<\/p>\n<p>Example: rolling a 6 on one die and a 6 on another are independent. Rolling a 6 and rolling a 3 on the same die are mutually exclusive.<\/p>\n<h3><strong><b>Q13. What is conditional probability, and how does Bayes theorem use it?<\/b><\/strong><\/h3>\n<p>Conditional probability is the probability of an event given that another event has happened. Bayes theorem reverses it: the probability of A given B equals the probability of B given A, times the probability of A, divided by the probability of B. It updates a prior belief with new evidence.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">prevalence = 0.01        # 1 percent of people have the condition\r\nsensitivity = 0.95       # test is positive for 95 percent of people with the condition\r\nfalse_positive = 0.05    # test is positive for 5 percent of people without it\r\n\r\np_positive = prevalence * sensitivity + (1 - prevalence) * false_positive\r\np_condition_given_positive = prevalence * sensitivity \/ p_positive\r\n\r\nprint(\"probability of a positive test:\", round(p_positive, 4))\r\nprint(\"probability of the condition given a positive test:\", round(p_condition_given_positive, 3))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">probability of a positive test: 0.059\r\nprobability of the condition given a positive test: 0.161<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Even with a 95 percent sensitive test, only about 16 percent of people who test positive actually have the condition, because the condition is rare. This base rate effect is the point interviewers want you to notice.<\/p>\n<h3><strong><b>Q14. What is the binomial distribution, and what conditions does it need?<\/b><\/strong><\/h3>\n<p>The binomial distribution gives the probability of a number of successes in a fixed number of independent trials, where each trial has the same probability of success. The conditions are a fixed number of trials, two outcomes per trial, independent trials and a constant success probability. The probabilities of success and failure do not need to be equal.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">from scipy.stats import binom\r\n\r\nn, p = 10, 0.5\r\n\r\nprint(\"P(exactly 6 heads in 10 tosses):\", round(binom.pmf(6, n, p), 4))\r\nprint(\"P(at least 8 heads in 10 tosses):\", round(1 - binom.cdf(7, n, p), 4))\r\nprint(\"mean and variance:\", n * p, n * p * (1 - p))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">P(exactly 6 heads in 10 tosses): 0.2051\r\nP(at least 8 heads in 10 tosses): 0.0547\r\nmean and variance: 5.0 2.5<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>By hand, the chance of exactly 6 heads is the number of ways to choose 6 from 10, which is 210, times one half to the power 10, which gives 210 divided by 1024, about 0.205.<\/p>\n<h3><strong><b>Q15. What is the Poisson distribution, and when do you use it?<\/b><\/strong><\/h3>\n<p>The Poisson distribution gives the probability of a number of events in a fixed interval of time or space, when events happen independently at a constant average rate. Typical uses are calls per hour, defects per metre and website visits per minute. Its mean and variance are both equal to the rate.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">from scipy.stats import poisson\r\n\r\nrate = 3          # average of 3 support calls per hour\r\n\r\nprint(\"P(0 calls in an hour):\", round(poisson.pmf(0, rate), 4))\r\nprint(\"P(exactly 5 calls):   \", round(poisson.pmf(5, rate), 4))\r\nprint(\"P(more than 5 calls): \", round(1 - poisson.cdf(5, rate), 4))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">P(0 calls in an hour): 0.0498\r\nP(exactly 5 calls):    0.1008\r\nP(more than 5 calls):  0.0839<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q16. What is the difference between the law of large numbers and the central limit theorem?<\/b><\/strong><\/h3>\n<p>The law of large numbers says the sample mean gets closer to the true mean as the sample grows. The central limit theorem says the distribution of sample means becomes approximately normal as the sample grows, with a spread of the standard deviation divided by the square root of n. One is about where the mean lands, the other about how it varies.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\n\r\nrng = np.random.default_rng(11)\r\nrolls = rng.integers(1, 7, 100_000)\r\n\r\nfor n in (10, 100, 10_000, 100_000):\r\n    print(n, round(rolls[:n].mean(), 3))\r\n\r\nprint(\"true mean of a fair die:\", 3.5)<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">10 2.8\r\n100 3.65\r\n10000 3.509\r\n100000 3.504\r\ntrue mean of a fair die: 3.5<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q17. What is expected value, and how do you calculate it?<\/b><\/strong><\/h3>\n<p>Expected value is the long run average outcome of a random variable. Multiply each possible value by its probability and add the results. It guides decisions under uncertainty, for example whether a game or a promotion is worth running. The expected value does not have to be a value that can actually occur.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">outcomes = [100, 20, 0]          # prize in rupees\r\nprobabilities = [0.05, 0.20, 0.75]\r\n\r\nexpected = sum(o * p for o, p in zip(outcomes, probabilities))\r\nprint(\"expected prize:\", expected)<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">expected prize: 9.0<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q18. What are a PMF, a PDF and a CDF?<\/b><\/strong><\/h3>\n<p>A probability mass function gives the probability of each exact value of a discrete variable. A probability density function describes a continuous variable, where the area under the curve between two points is the probability, and the probability of any single exact value is zero. A cumulative distribution function gives the probability that the variable is less than or equal to a value.<\/p>\n<h2><strong><b>Hypothesis Testing and Confidence Intervals (Intermediate)<\/b><\/strong><\/h2>\n<p>This is the part of the interview that decides most statistics rounds. Be precise with the language, because small wording mistakes about p values and intervals are what interviewers listen for.<\/p>\n<h3><strong><b>Q19. What are the null and alternative hypotheses?<\/b><\/strong><\/h3>\n<p>The null hypothesis states that there is no effect or no difference, and it is the claim you test against. The alternative hypothesis states that there is an effect or a difference. The test asks whether the data is unlikely enough under the null hypothesis to reject it. Failing to reject the null does not prove it true.<\/p>\n<p>Example: to test whether a new course page raises sign ups, the null hypothesis says the sign up rate is unchanged, and the alternative says it is different.<\/p>\n<h3><strong><b>Q20. What is a p value, and what is the significance level?<\/b><\/strong><\/h3>\n<p>The p value is the probability of getting a result at least as extreme as the one observed if the null hypothesis is true. The significance level alpha is the cut off you choose in advance, commonly 0.05. If the p value is below alpha, you reject the null hypothesis. The p value is not the probability that the null hypothesis is true.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">from scipy import stats\r\n\r\n# Does a coin that landed heads 62 times in 100 tosses look fair?\r\nresult = stats.binomtest(62, n=100, p=0.5)\r\nprint(\"p value:\", round(result.pvalue, 4))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">p value: 0.021<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>A p value of about 0.02 means that if the coin were fair, a result at least this unbalanced would appear in roughly 2 percent of experiments.<\/p>\n<h3><strong><b>Q21. What is the difference between a one tailed and a two tailed test?<\/b><\/strong><\/h3>\n<p>A two tailed test checks for a difference in either direction, and a one tailed test checks one specified direction only. Use a one tailed test only when you chose the direction before seeing the data and a change the other way would not matter. For the same data, the one tailed p value is half the two tailed value.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">from scipy import stats\r\n\r\nz = 1.8\r\none_tail = 1 - stats.norm.cdf(z)\r\ntwo_tail = 2 * one_tail\r\n\r\nprint(\"one tailed p:\", round(one_tail, 4))\r\nprint(\"two tailed p:\", round(two_tail, 4))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">one tailed p: 0.0359\r\ntwo tailed p: 0.0719<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q22. What are Type I error, Type II error and power?<\/b><\/strong><\/h3>\n<p>A Type I error is rejecting a true null hypothesis, and its probability is alpha. A Type II error is failing to reject a false null hypothesis, and its probability is beta. Power is 1 minus beta, the chance of detecting a real effect. Power rises with a larger sample, a larger true effect and a higher alpha.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 640px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Type I and Type II errors<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 240px;\" scope=\"col\">Decision<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Null hypothesis is true<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Null hypothesis is false<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Reject the null hypothesis<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Type I error, probability alpha<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Correct, probability equals power<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a;\" scope=\"row\">Fail to reject the null hypothesis<\/th>\n<td style=\"padding: 12px 16px;\">Correct<\/td>\n<td style=\"padding: 12px 16px;\">Type II error, probability beta<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q23. When do you use a z test and when a t test?<\/b><\/strong><\/h3>\n<p>Use a z test when the population standard deviation is known. Use a t test when it is unknown and estimated from the sample, because the t distribution has heavier tails to allow for that extra uncertainty. The rule that t tests are for samples below 30 is only a rough guide, and with large samples the two give nearly the same answer.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy.stats import norm\r\n\r\n# A course claims an average score of 70. A sample of 50 students has a mean of 73.\r\n# Assume the population standard deviation is known to be 10.\r\nmu, sample_mean, sigma, n = 70, 73, 10, 50\r\n\r\nz = (sample_mean - mu) \/ (sigma \/ np.sqrt(n))\r\np = 2 * (1 - norm.cdf(abs(z)))\r\n\r\nprint(\"z statistic:\", round(z, 2))\r\nprint(\"two tailed p value:\", round(p, 4))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">z statistic: 2.12\r\ntwo tailed p value: 0.0339<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Worked by hand: the standard error is 10 divided by the square root of 50, which is about 1.414. The z statistic is 3 divided by 1.414, about 2.12, and the two tailed p value is about 0.034. At alpha 0.05, reject the claim of 70.<\/p>\n<h3><strong><b>Q24. What are the types of t test?<\/b><\/strong><\/h3>\n<p>A one sample t test compares a sample mean with a known value. An independent two sample t test compares the means of two separate groups. A paired t test compares two measurements on the same units, such as scores before and after training. Choose by how the data was collected, not by how it looks.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy import stats\r\n\r\nbefore = np.array([62, 70, 65, 58, 72, 68, 61, 66])\r\nafter = np.array([68, 75, 66, 63, 78, 70, 67, 71])\r\n\r\nt, p = stats.ttest_rel(after, before)\r\nprint(\"paired t statistic:\", round(t, 2))\r\nprint(\"two tailed p value:\", round(p, 4))\r\nprint(\"mean improvement:\", (after - before).mean())<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">paired t statistic: 6.6\r\ntwo tailed p value: 0.0003\r\nmean improvement: 4.5<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q25. What is a confidence interval? Show a worked example.<\/b><\/strong><\/h3>\n<p>A 95 percent confidence interval is a range built so that 95 percent of intervals made this way over repeated samples would contain the true value. For a mean, it is the sample mean plus or minus a critical value times the standard error. It does not say there is a 95 percent chance that the true value is in this one interval.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy import stats\r\n\r\nn, mean, sd = 36, 100, 12\r\nse = sd \/ np.sqrt(n)\r\nt_crit = stats.t.ppf(0.975, df=n - 1)\r\nlow, high = mean - t_crit * se, mean + t_crit * se\r\n\r\nprint(\"standard error:\", se)\r\nprint(\"critical value:\", round(t_crit, 3))\r\nprint(\"95 percent interval:\", round(low, 1), \"to\", round(high, 1))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">standard error: 2.0\r\ncritical value: 2.03\r\n95 percent interval: 95.9 to 104.1<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>A sample of 36 with mean 100 and standard deviation 12 has a standard error of 2. The 95 percent interval is about 95.9 to 104.1. A larger sample would shrink the standard error and make the interval narrower.<\/p>\n<h3><strong><b>Q26. How does a chi square test work?<\/b><\/strong><\/h3>\n<p>The chi square test of independence compares the counts you observed in a table with the counts you would expect if the two categorical variables were unrelated. A large difference gives a large statistic and a small p value. It needs counts, not percentages, and expected counts that are not too small.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy.stats import chi2_contingency\r\n\r\n#                 bought  did not buy\r\nobserved = np.array([[90, 210],     # saw the new page\r\n                     [60, 240]])    # saw the old page\r\n\r\nchi2, p, dof, expected = chi2_contingency(observed)\r\nprint(\"chi square:\", round(chi2, 2), \" degrees of freedom:\", dof)\r\nprint(\"p value:\", round(p, 4))\r\nprint(\"expected counts:\")\r\nprint(expected)<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">chi square: 7.48  degrees of freedom: 1\r\np value: 0.0063\r\nexpected counts:\r\n[[ 75. 225.]\r\n [ 75. 225.]]<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q27. What is ANOVA, and why not run many t tests instead?<\/b><\/strong><\/h3>\n<p>ANOVA tests whether the means of three or more groups are all equal, by comparing the variation between groups with the variation within groups. Running many t tests raises the overall chance of a false positive. ANOVA gives one overall test, and a post hoc test such as Tukey then shows which groups differ.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy.stats import f_oneway\r\n\r\nrng = np.random.default_rng(8)\r\na = rng.normal(70, 8, 30)\r\nb = rng.normal(72, 8, 30)\r\nc = rng.normal(78, 8, 30)\r\n\r\nf, p = f_oneway(a, b, c)\r\nprint(\"F statistic:\", round(f, 2))\r\nprint(\"p value:\", f\"{p:.1e}\")<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">F statistic: 13.62\r\np value: 7.1e-06<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q28. What are non parametric tests, and when should you use them?<\/b><\/strong><\/h3>\n<p>Non parametric tests make fewer assumptions about the shape of the data, so they suit small samples, skewed data, outliers and ordinal data. Common ones are Mann Whitney U in place of the independent t test, Wilcoxon signed rank in place of the paired t test, and Kruskal Wallis in place of ANOVA. They have less power when the standard assumptions hold.<\/p>\n<h3><strong><b>Q29. What is the problem with testing many hypotheses, and how do you correct for it?<\/b><\/strong><\/h3>\n<p>Each test carries a chance of a false positive, so running many tests makes it likely that at least one looks significant by luck. With 20 tests at alpha 0.05 that chance is about 64 percent. Control it with the Bonferroni correction, which divides alpha by the number of tests, or with false discovery rate methods such as Benjamini Hochberg.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">alpha, tests = 0.05, 20\r\n\r\nprint(\"chance of at least one false positive:\", round(1 - (1 - alpha) ** tests, 2))\r\nprint(\"Bonferroni threshold for each test:\", alpha \/ tests)<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">chance of at least one false positive: 0.64\r\nBonferroni threshold for each test: 0.0025<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q30. What is effect size, and why is a significant result not always important?<\/b><\/strong><\/h3>\n<p>Effect size measures how large a difference or relationship is, for example a difference in means divided by the standard deviation, known as Cohen d. With a very large sample even a tiny, useless difference can be statistically significant. Always report the effect size and a confidence interval next to the p value, and judge whether the size matters to the business.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy import stats\r\n\r\nrng = np.random.default_rng(2)\r\na = rng.normal(100.0, 15, 200_000)\r\nb = rng.normal(100.3, 15, 200_000)\r\n\r\nt, p = stats.ttest_ind(b, a)\r\nd = (b.mean() - a.mean()) \/ np.sqrt((a.var(ddof=1) + b.var(ddof=1)) \/ 2)\r\n\r\nprint(\"p value:\", p)\r\nprint(\"Cohen d:\", round(d, 3))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">p value: 1.464887453014415e-18\r\nCohen d: 0.028<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The p value is extremely small, yet the effect size is about 0.03, which is negligible. A statistically significant result is not automatically a meaningful one.<\/p>\n<h3><strong><b>Q31. How do you choose the right statistical test?<\/b><\/strong><\/h3>\n<p>Choose by the type of outcome, the number of groups and how the data was collected. Compare two means with a t test, three or more means with ANOVA, two categorical variables with a chi square test, and a relationship between two numbers with correlation or regression. Switch to a non parametric test when the assumptions fail.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 760px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Which statistical test to use<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 240px;\" scope=\"col\">Question<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 140px;\" scope=\"col\">Data<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Typical test<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">Non parametric option<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">One group mean against a known value<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Numeric<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">One sample t test, or z test if sigma is known<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Wilcoxon signed rank<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Two independent group means<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Numeric<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Independent two sample t test<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Mann Whitney U<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Before and after on the same units<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Numeric<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Paired t test<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Wilcoxon signed rank<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Three or more group means<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Numeric<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">One way ANOVA<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Kruskal Wallis<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Two categorical variables<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Counts<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Chi square test of independence<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Fisher exact test for small counts<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a;\" scope=\"row\">Two proportions, such as conversion rates<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Binary outcome<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Two proportion z test<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Fisher exact test<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a;\" scope=\"row\">Relationship between two numeric variables<\/th>\n<td style=\"padding: 12px 16px;\">Numeric<\/td>\n<td style=\"padding: 12px 16px;\">Pearson correlation or regression<\/td>\n<td style=\"padding: 12px 16px;\">Spearman correlation<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h2><strong><b>Correlation and Regression (Intermediate and Experienced)<\/b><\/strong><\/h2>\n<p>Regression questions test whether you can interpret a model, not only fit one. Be ready to explain what each number in the output means in plain language.<\/p>\n<h3><strong><b>Q32. What is the difference between Pearson and Spearman correlation?<\/b><\/strong><\/h3>\n<p>Pearson correlation measures the strength of a linear relationship between two numeric variables and is sensitive to outliers. Spearman correlation works on ranks, so it measures whether one variable consistently rises or falls with the other, even if the relationship is curved, and it is more robust to outliers. Both range from minus 1 to 1.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy import stats\r\n\r\nhours = np.array([1, 2, 3, 4, 5, 6, 7, 8])\r\nscore = np.array([35, 40, 48, 55, 62, 70, 72, 95])      # rises steadily, with a jump at the end\r\n\r\nprint(\"Pearson: \", round(stats.pearsonr(hours, score)[0], 3))\r\nprint(\"Spearman:\", round(stats.spearmanr(hours, score)[0], 3))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">Pearson:  0.976\r\nSpearman: 1.0<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Spearman is exactly 1 here because the scores always rise with the hours, even though the relationship is not a perfect straight line.<\/p>\n<h3><strong><b>Q33. What is the difference between covariance and correlation?<\/b><\/strong><\/h3>\n<p>Covariance shows whether two variables move in the same direction, but its size depends on the units, so it is hard to compare. Correlation is covariance divided by the product of the two standard deviations, which removes the units and fixes the range between minus 1 and 1. Use correlation to compare the strength of relationships.<\/p>\n<h3><strong><b>Q34. How do you interpret a linear regression output?<\/b><\/strong><\/h3>\n<p>The intercept is the predicted value when all features are zero. Each coefficient is the expected change in the outcome for a one unit increase in that feature, holding the others fixed. R squared is the share of variation the model explains, and the p value of a coefficient tests whether that coefficient is different from zero.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy import stats\r\n\r\nrng = np.random.default_rng(4)\r\nexperience = rng.uniform(0, 10, 60)\r\nsalary = 3 + 0.8 * experience + rng.normal(0, 1.5, 60)     # lakhs per year\r\n\r\nfit = stats.linregress(experience, salary)\r\nprint(\"slope:\", round(fit.slope, 2))\r\nprint(\"intercept:\", round(fit.intercept, 2))\r\nprint(\"R squared:\", round(fit.rvalue ** 2, 2))\r\nprint(\"p value of the slope:\", fit.pvalue)<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">slope: 0.66\r\nintercept: 3.87\r\nR squared: 0.64\r\np value of the slope: 1.9847494097134272e-14<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Read the slope as: each extra year of experience is associated with about 0.66 lakh more salary, in this made up data. The word associated matters, since regression alone does not prove cause.<\/p>\n<h3><strong><b>Q35. What is the difference between R squared and adjusted R squared?<\/b><\/strong><\/h3>\n<p>R squared is the share of the outcome variation explained by the model, and it never falls when you add a feature, even a useless one. Adjusted R squared corrects for the number of features, and it falls if a new feature adds less than chance would. Use adjusted R squared to compare models with different numbers of features.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">def adjusted_r2(r2, n, k):\r\n    return 1 - (1 - r2) * (n - 1) \/ (n - k - 1)\r\n\r\nprint(round(adjusted_r2(0.80, n=50, k=3), 4))\r\nprint(round(adjusted_r2(0.81, n=50, k=15), 4))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">0.787\r\n0.7262<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>The second model has a higher R squared but a lower adjusted R squared, because 12 extra features added too little to be worth their cost.<\/p>\n<h3><strong><b>Q36. How do you detect multicollinearity, and what does the variance inflation factor mean?<\/b><\/strong><\/h3>\n<p>Multicollinearity means features are strongly correlated with each other, which makes coefficients unstable. The variance inflation factor for a feature is 1 divided by 1 minus R squared, where R squared comes from predicting that feature from the others. Values above about 5 to 10 are a warning sign. Remove or combine features, or use Ridge regression.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\n\r\nrng = np.random.default_rng(0)\r\na = rng.normal(size=300)\r\nb = a * 0.95 + rng.normal(scale=0.3, size=300)      # strongly related to a\r\nc = rng.normal(size=300)                            # independent\r\n\r\ndef vif(target, others):\r\n    X = np.column_stack([np.ones(len(target))] + others)\r\n    beta, *_ = np.linalg.lstsq(X, target, rcond=None)\r\n    resid = target - X @ beta\r\n    r2 = 1 - resid.var() \/ target.var()\r\n    return 1 \/ (1 - r2)\r\n\r\nprint(\"VIF of a:\", round(vif(a, [b, c]), 1))\r\nprint(\"VIF of c:\", round(vif(c, [a, b]), 1))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">VIF of a: 12.2\r\nVIF of c: 1.0<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q37. What does it mean when residuals show heteroscedasticity?<\/b><\/strong><\/h3>\n<p>Heteroscedasticity means the spread of the residuals changes with the fitted value, often fanning out as values grow. The coefficients are still unbiased, but standard errors and p values become unreliable. Plot residuals against fitted values to spot it, then try transforming the outcome, using robust standard errors or fitting weighted regression.<\/p>\n<h2><strong><b>Advanced and Applied Statistics (Experienced)<\/b><\/strong><\/h2>\n<p>Experienced candidates are expected to spot where an analysis can mislead. These questions test judgement about bias, uncertainty and method choice.<\/p>\n<h3><strong><b>Q38. What is Simpson paradox?<\/b><\/strong><\/h3>\n<p>Simpson paradox is when a trend that appears in several groups reverses or disappears when the groups are combined. It happens when group sizes differ and a hidden variable affects both the group and the outcome. The fix is to analyse the data by the relevant groups and think about which view answers the question.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\"># A widely cited medical example: success counts out of patients, by stone size\r\nsmall = {\"A\": (81, 87),  \"B\": (234, 270)}\r\nlarge = {\"A\": (192, 263), \"B\": (55, 80)}\r\n\r\nfor name, data in ((\"small stones\", small), (\"large stones\", large)):\r\n    print(name, {k: round(s \/ n, 3) for k, (s, n) in data.items()})\r\n\r\noverall = {k: (small[k][0] + large[k][0]) \/ (small[k][1] + large[k][1]) for k in \"AB\"}\r\nprint(\"overall\", {k: round(v, 3) for k, v in overall.items()})<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">small stones {'A': 0.931, 'B': 0.867}\r\nlarge stones {'A': 0.73, 'B': 0.688}\r\noverall {'A': 0.78, 'B': 0.826}<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>Treatment A is better for both small and large stones, yet treatment B looks better overall, because A was given mostly to the harder, large stone cases.<\/p>\n<h3><strong><b>Q39. What is bootstrapping, and when is it useful?<\/b><\/strong><\/h3>\n<p>Bootstrapping estimates the uncertainty of a statistic by repeatedly resampling the data with replacement and recalculating the statistic each time. The spread of those results approximates its sampling distribution. It is useful when no simple formula exists, for example for a median, a ratio or a custom metric, and when the sample is small.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\n\r\nrng = np.random.default_rng(6)\r\ndata = np.array([12, 15, 14, 10, 18, 25, 13, 16, 40, 14])\r\n\r\nmedians = [np.median(rng.choice(data, size=len(data), replace=True)) for _ in range(5000)]\r\nlow, high = np.percentile(medians, [2.5, 97.5])\r\n\r\nprint(\"sample median:\", np.median(data))\r\nprint(\"95 percent bootstrap interval for the median:\", low, \"to\", high)<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">sample median: 14.5\r\n95 percent bootstrap interval for the median: 13.0 to 20.5<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q40. How do Bayesian and frequentist approaches differ?<\/b><\/strong><\/h3>\n<p>A frequentist treats parameters as fixed and probability as the long run frequency of outcomes over repeated experiments, so it reports p values and confidence intervals. A Bayesian treats parameters as uncertain, starts from a prior belief, updates it with the data and reports a posterior distribution and credible intervals. Bayesian results are easier to read as direct probabilities, but need a prior.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">from scipy.stats import beta\r\n\r\n# Prior belief about a conversion rate: Beta(1, 1), meaning no strong opinion.\r\n# Data: 60 conversions out of 500 visitors.\r\nprior_a, prior_b = 1, 1\r\nconversions, visitors = 60, 500\r\n\r\nposterior = beta(prior_a + conversions, prior_b + visitors - conversions)\r\nlow, high = posterior.interval(0.95)\r\n\r\nprint(\"posterior mean:\", round(posterior.mean(), 3))\r\nprint(\"95 percent credible interval:\", round(low, 3), \"to\", round(high, 3))<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">posterior mean: 0.122\r\n95 percent credible interval: 0.094 to 0.151<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h3><strong><b>Q41. What is maximum likelihood estimation?<\/b><\/strong><\/h3>\n<p>Maximum likelihood estimation chooses the parameter values that make the observed data most probable. You write the likelihood of the data as a function of the parameters and find the values that maximise it, usually through the log likelihood. For example, the sample mean is the maximum likelihood estimate of the mean of a normal distribution. Logistic regression is fitted this way.<\/p>\n<h3><strong><b>Q42. What are the types of missing data, and why do they matter?<\/b><\/strong><\/h3>\n<p>Data can be missing completely at random, missing at random given other observed variables, or missing not at random, where the reason depends on the missing value itself. Dropping rows is only safe in the first case. When high earners skip an income question, for example, the result is biased unless you model the missingness.<\/p>\n<h3><strong><b>Q43. What are selection bias and survivorship bias?<\/b><\/strong><\/h3>\n<p>Selection bias happens when the people or items in your data are not representative of the group you want to study, because of how they were chosen. Survivorship bias is a type of it, where you only see the cases that survived a process and miss the failures. Reviewing only successful companies to find what makes a company successful is a classic example.<\/p>\n<h3><strong><b>Q44. How do you check whether data is normally distributed?<\/b><\/strong><\/h3>\n<p>Look at a histogram and a Q Q plot, where points near a straight line suggest normality, and use a test such as Shapiro Wilk as a supporting check. With large samples these tests flag tiny departures that do not matter, so judge by the plot and by how sensitive your method is. Many methods tolerate mild non normality.<\/p>\n<div style=\"margin: 20px 0; border: 1px solid #d9e0ea; border-radius: 8px; overflow: hidden;\">\n<div style=\"background: #0f2a4a; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">python<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #f5f8fc; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">import numpy as np\r\nfrom scipy import stats\r\n\r\nrng = np.random.default_rng(9)\r\nnormal_data = rng.normal(50, 10, 200)\r\nskewed_data = rng.exponential(10, 200)\r\n\r\nprint(\"normal data Shapiro Wilk p:\", round(stats.shapiro(normal_data).pvalue, 3))\r\nprint(\"skewed data Shapiro Wilk p:\", stats.shapiro(skewed_data).pvalue)<\/pre>\n<div style=\"background: #1f2937; color: #ffffff; font-family: Arial,Helvetica,sans-serif; font-size: 14px; font-weight: bold; padding: 8px 16px;\">output<\/div>\n<pre style=\"margin: 0; padding: 16px; background: #ffffff; color: #1f2937; font-family: 'Courier New',Courier,monospace; font-size: 14px; line-height: 1.7; overflow-x: auto; white-space: pre;\">normal data Shapiro Wilk p: 0.851\r\nskewed data Shapiro Wilk p: 6.723700429845165e-14<\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>A small p value means the data departs from normality. The normal sample gives a large p value, and the skewed sample gives a very small one.<\/p>\n<h2><strong><b>Explaining Statistics to Non Technical People (All Levels)<\/b><\/strong><\/h2>\n<p>In real work you will explain results to managers and clients. Interviewers often test this with one question, to see whether you can be clear without losing accuracy.<\/p>\n<h3><strong><b>Q45. How would you explain a p value to a manager?<\/b><\/strong><\/h3>\n<p>Say that the p value tells you how surprising the result would be if nothing had really changed. A small value means the result would be very unusual by chance alone, so there is evidence of a real effect. Add that it does not tell you how big or how important the effect is.<\/p>\n<p><strong><b>What the interviewer is listening for: <\/b><\/strong><em><i>You avoid jargon, you stay accurate and you point out what the number does not tell you.<\/i><\/em><\/p>\n<h3><strong><b>Q46. How would you explain a confidence interval to a client?<\/b><\/strong><\/h3>\n<p>Say that the average from the survey is our best estimate, and the interval is a range that shows how precise it is. A narrow range means we can rely on the number more. If the range for a change includes zero, we cannot yet be sure there was any change.<\/p>\n<p><strong><b>What the interviewer is listening for: <\/b><\/strong><em><i>You describe precision in plain words and tie it to a decision.<\/i><\/em><\/p>\n<h3><strong><b>Q47. How do you explain standard deviation to someone who has never studied statistics?<\/b><\/strong><\/h3>\n<p>Describe it as the typical distance of values from the average. If two classes both average 70 marks, a small standard deviation means most students scored close to 70, and a large one means scores were widely spread. It tells you whether the average is a good summary of the group.<\/p>\n<p><strong><b>What the interviewer is listening for: <\/b><\/strong><em><i>You use a concrete example in place of the formula.<\/i><\/em><\/p>\n<h2><strong><b>Common questions about statistics interviews<\/b><\/strong><\/h2>\n<h3><strong><b>What statistics topics are asked most in data science interviews?<\/b><\/strong><\/h3>\n<p>The most common topics are descriptive statistics, probability and Bayes theorem, the normal distribution, hypothesis testing with p values, confidence intervals, regression and correlation. Experienced candidates are also asked about A B testing, bias, Simpson paradox and how to explain results. Prepare each with one worked numeric example.<\/p>\n<h3><strong><b>How much statistics do I need for a data analyst role?<\/b><\/strong><\/h3>\n<p>Analysts need solid descriptive statistics, sampling, the normal distribution, confidence intervals, basic hypothesis tests and correlation. Regression and experiment design help for senior analyst roles. The emphasis is on interpreting results correctly and explaining them clearly, more than on proofs or derivations.<\/p>\n<h3><strong><b>Do I need to memorise formulas for a statistics interview?<\/b><\/strong><\/h3>\n<p>Know the main formulas and what each one means, such as the standard error, z score and confidence interval. Interviewers care more that you can explain the idea and use it on a small example than that you recite symbols. If you forget one, say so and reason from the definition.<\/p>\n<h3><strong><b>What are the most common statistics mistakes in interviews?<\/b><\/strong><\/h3>\n<p>Common mistakes include saying the p value is the probability that the null hypothesis is true, reading a confidence interval as a probability for one fixed interval, treating correlation as causation, and saying the t test is only for samples below 30. Practise stating these four points correctly.<\/p>\n<h3><strong><b>How can I practise statistics for interviews?<\/b><\/strong><\/h3>\n<p>Work each question here by hand first, then check it with the code. Take one public dataset and run a descriptive summary, a hypothesis test and a regression on it, writing a two line plain language conclusion for each. Then explain one result aloud as if to a manager.<\/p>\n<h2><strong><b>A four week plan to prepare<\/b><\/strong><\/h2>\n<p>Use this plan if you have about a month before your interview.<\/p>\n<div style=\"border: 1px solid #d9e0ea; border-radius: 8px; overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch;\">\n<table style=\"width: 100%; min-width: 640px; border-collapse: collapse; font-family: Arial,Helvetica,sans-serif; font-size: 16px; line-height: 1.6; color: #1f2937;\">\n<caption style=\"caption-side: top; text-align: left; padding: 14px 16px; font-weight: bold; font-size: 17px; color: #0f2a4a;\">Four week study plan<\/caption>\n<thead>\n<tr>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 90px;\" scope=\"col\">Week<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38; width: 260px;\" scope=\"col\">Focus<\/th>\n<th style=\"background: #0f2a4a; color: #ffffff; text-align: left; padding: 12px 16px; border-bottom: 2px solid #0b1f38;\" scope=\"col\">What to do<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Week 1<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Descriptive statistics, sampling and the normal distribution<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Work the first section by hand, then check each answer with the code.<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Week 2<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Probability, Bayes theorem and common distributions<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Solve five new Bayes and binomial problems of your own, and explain each aloud.<\/td>\n<\/tr>\n<tr style=\"background: #ffffff;\">\n<th style=\"text-align: left; padding: 12px 16px; border-bottom: 1px solid #e5e9f0; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Week 3<\/th>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Hypothesis testing and confidence intervals<\/td>\n<td style=\"padding: 12px 16px; border-bottom: 1px solid #e5e9f0;\">Run a t test, a chi square test and ANOVA on a public dataset and write a one paragraph conclusion for each.<\/td>\n<\/tr>\n<tr style=\"background: #f5f8fc;\">\n<th style=\"text-align: left; padding: 12px 16px; color: #0f2a4a; white-space: nowrap;\" scope=\"row\">Week 4<\/th>\n<td style=\"padding: 12px 16px;\">Regression, bias and communication<\/td>\n<td style=\"padding: 12px 16px;\">Fit a regression, interpret every number, and rehearse the three plain language answers at the end.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>&nbsp;<\/p>\n<h2><strong><b>Practise with a trainer<\/b><\/strong><\/h2>\n<p>If you want to practise statistics with a trainer and apply it to real projects, you can book a free demo class for the <a href=\"https:\/\/prwatech.in\/data-science-online-course\/\">Prwatech Data Science course<\/a>. It covers statistics, Python, SQL and machine learning with hands on work.<\/p>\n<p>Contact the learning team for current batch dates and fees.<\/p>\n<blockquote><p><strong>Written by Mithun Ray, data engineering trainer at Prwatech. Reviewed by Avishekh Verma. Last updated October,2026.<\/strong><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Most Asked Statistics Interview Questions and Answers for Data Science\u00a0 Statistics is the part of a data science or data analyst interview where small wording mistakes cost the most. Interviewers listen for whether you can define a p value correctly, read a confidence interval without overclaiming, choose a sensible test and explain the result in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3281,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,1709],"tags":[63],"class_list":["post-2837","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interview-questions","category-interview-questions-interview-questions","tag-statistics-interview-questions-and-answers"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Top 47 Statistics Interview Questions and Answers | PrwaTech<\/title>\n<meta name=\"description\" content=\"Most asked Statistics interview questions with worked examples for data science and analyst roles. Covers p value, hypothesis tests, Bayes theorem and regression.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 47 Statistics Interview Questions and Answers | PrwaTech\" \/>\n<meta property=\"og:description\" content=\"Most asked Statistics interview questions with worked examples for data science and analyst roles. Covers p value, hypothesis tests, Bayes theorem and regression.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-12T04:52:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-14T14:34:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/Statistics-Interview-Questions-and-Answers.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"550\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"24 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/\",\"url\":\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/\",\"name\":\"Top 47 Statistics Interview Questions and Answers | PrwaTech\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/Statistics-Interview-Questions-and-Answers.jpg\",\"datePublished\":\"2026-10-12T04:52:05+00:00\",\"dateModified\":\"2026-10-14T14:34:43+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Most asked Statistics interview questions with worked examples for data science and analyst roles. Covers p value, hypothesis tests, Bayes theorem and regression.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/Statistics-Interview-Questions-and-Answers.jpg\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/Statistics-Interview-Questions-and-Answers.jpg\",\"width\":960,\"height\":550,\"caption\":\"Statistics Interview Questions and Answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Statistics Interview Questions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Top 47 Statistics Interview Questions and Answers | PrwaTech","description":"Most asked Statistics interview questions with worked examples for data science and analyst roles. Covers p value, hypothesis tests, Bayes theorem and regression.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/","og_locale":"en_US","og_type":"article","og_title":"Top 47 Statistics Interview Questions and Answers | PrwaTech","og_description":"Most asked Statistics interview questions with worked examples for data science and analyst roles. Covers p value, hypothesis tests, Bayes theorem and regression.","og_url":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2026-10-12T04:52:05+00:00","article_modified_time":"2026-10-14T14:34:43+00:00","og_image":[{"width":960,"height":550,"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/Statistics-Interview-Questions-and-Answers.jpg","type":"image\/jpeg"}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"24 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/","url":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/","name":"Top 47 Statistics Interview Questions and Answers | PrwaTech","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/Statistics-Interview-Questions-and-Answers.jpg","datePublished":"2026-10-12T04:52:05+00:00","dateModified":"2026-10-14T14:34:43+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Most asked Statistics interview questions with worked examples for data science and analyst roles. Covers p value, hypothesis tests, Bayes theorem and regression.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/Statistics-Interview-Questions-and-Answers.jpg","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/11\/Statistics-Interview-Questions-and-Answers.jpg","width":960,"height":550,"caption":"Statistics Interview Questions and Answers"},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/interview-questions\/statistics-interview-questions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Statistics Interview Questions"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2837","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=2837"}],"version-history":[{"count":8,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2837\/revisions"}],"predecessor-version":[{"id":11981,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/2837\/revisions\/11981"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media\/3281"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=2837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=2837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=2837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}