データアナリスト面接対策2026年版:SQL・Python・分析スキル完全ガイド
2026年のデータアナリスト面接で頻出するSQL、Python、統計分析の質問と模範解答を徹底解説。実践的なコード例と解答のポイントで内定獲得を目指す。

データアナリスト職への需要は2026年も引き続き高く、企業はデータドリブンな意思決定を支えるプロフェッショナルを積極的に採用しています。面接では技術力だけでなく、ビジネス課題を解決する分析思考も重視されます。本記事では、データアナリスト面接で頻出する質問と実践的な解答例を紹介します。
2026年のデータアナリスト面接では、SQLの高度なクエリ作成能力、Pythonによるデータ処理、そして統計的思考力の3つが重点的に評価されます。実務に即したケーススタディ形式の質問も増加傾向にあります。
SQLの頻出面接質問
SQLはデータアナリストの基本スキルとして、ほぼすべての面接で問われます。単純なSELECT文だけでなく、複雑なJOINやウィンドウ関数の理解が求められます。
ウィンドウ関数を使った売上分析
面接官は、ウィンドウ関数を使って時系列データを分析できるかを確認することが多いです。以下は月次売上の前月比成長率を計算するクエリ例です。
SELECT
month,
revenue,
LAG(revenue) OVER (ORDER BY month) AS prev_month_revenue,
ROUND(
(revenue - LAG(revenue) OVER (ORDER BY month)) * 100.0 /
NULLIF(LAG(revenue) OVER (ORDER BY month), 0), 2
) AS growth_rate_pct
FROM monthly_sales
ORDER BY month;このクエリでは、LAG関数を使用して前月の売上を取得し、成長率を計算しています。NULLIF関数でゼロ除算を防いでいる点も重要なポイントです。
顧客セグメンテーション分析
RFM分析(Recency、Frequency、Monetary)は、顧客をセグメント化する代表的な手法です。面接ではこの概念とSQL実装の両方を問われることがあります。
WITH customer_metrics AS (
SELECT
customer_id,
DATEDIFF(CURRENT_DATE, MAX(order_date)) AS recency,
COUNT(DISTINCT order_id) AS frequency,
SUM(amount) AS monetary
FROM orders
WHERE order_date >= DATE_SUB(CURRENT_DATE, INTERVAL 1 YEAR)
GROUP BY customer_id
),
rfm_scores AS (
SELECT
customer_id,
NTILE(5) OVER (ORDER BY recency DESC) AS r_score,
NTILE(5) OVER (ORDER BY frequency) AS f_score,
NTILE(5) OVER (ORDER BY monetary) AS m_score
FROM customer_metrics
)
SELECT
customer_id,
r_score,
f_score,
m_score,
CONCAT(r_score, f_score, m_score) AS rfm_segment
FROM rfm_scores
ORDER BY monetary DESC;NTILE関数を使って各指標を5分位に分割し、顧客セグメントを作成しています。この分析手法は、マーケティング施策のターゲティングに直接活用できます。
Pythonデータ分析の面接質問
Pythonはデータアナリストにとって不可欠なツールです。pandas、NumPy、そしてデータ可視化ライブラリの実践的な使用方法が問われます。
欠損値の処理と特徴量エンジニアリング
実務では不完全なデータを扱うことが日常的です。面接では欠損値の適切な処理方法について質問されることが多いです。
import pandas as pd
import numpy as np
from sklearn.impute import SimpleImputer
def handle_missing_data(df: pd.DataFrame) -> pd.DataFrame:
"""Handle missing values with appropriate strategies."""
df_clean = df.copy()
# Numeric columns: fill with median
numeric_cols = df_clean.select_dtypes(include=[np.number]).columns
for col in numeric_cols:
median_val = df_clean[col].median()
df_clean[col] = df_clean[col].fillna(median_val)
# Categorical columns: fill with mode
categorical_cols = df_clean.select_dtypes(include=['object']).columns
for col in categorical_cols:
mode_val = df_clean[col].mode()[0]
df_clean[col] = df_clean[col].fillna(mode_val)
return df_clean
# Feature engineering example
def create_date_features(df: pd.DataFrame, date_col: str) -> pd.DataFrame:
"""Extract useful features from datetime column."""
df[date_col] = pd.to_datetime(df[date_col])
df['year'] = df[date_col].dt.year
df['month'] = df[date_col].dt.month
df['day_of_week'] = df[date_col].dt.dayofweek
df['is_weekend'] = df['day_of_week'].isin([5, 6]).astype(int)
df['quarter'] = df[date_col].dt.quarter
return df数値カラムには中央値、カテゴリカラムには最頻値を使用する戦略を説明できることが重要です。また、日付から有用な特徴量を抽出する技術も評価されます。
コホート分析の実装
ユーザー行動分析において、コホート分析は顧客維持率を理解するための重要な手法です。
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
def cohort_analysis(df: pd.DataFrame) -> pd.DataFrame:
"""Perform cohort analysis for customer retention."""
# Get the first purchase month for each customer
df['order_month'] = pd.to_datetime(df['order_date']).dt.to_period('M')
cohort = df.groupby('customer_id')['order_month'].min().reset_index()
cohort.columns = ['customer_id', 'cohort_month']
df = df.merge(cohort, on='customer_id')
# Calculate cohort index (months since first purchase)
df['cohort_index'] = (
df['order_month'].astype(int) - df['cohort_month'].astype(int)
)
# Create cohort table
cohort_data = df.groupby(['cohort_month', 'cohort_index']).agg(
n_customers=('customer_id', 'nunique')
).reset_index()
cohort_pivot = cohort_data.pivot(
index='cohort_month',
columns='cohort_index',
values='n_customers'
)
# Calculate retention rates
cohort_size = cohort_pivot.iloc[:, 0]
retention = cohort_pivot.divide(cohort_size, axis=0) * 100
return retention
def plot_cohort_heatmap(retention: pd.DataFrame) -> None:
"""Visualize cohort retention as heatmap."""
plt.figure(figsize=(12, 8))
sns.heatmap(
retention,
annot=True,
fmt='.1f',
cmap='YlGnBu',
cbar_kws={'label': 'Retention Rate (%)'}
)
plt.title('Customer Retention by Cohort')
plt.xlabel('Months Since First Purchase')
plt.ylabel('Cohort Month')
plt.tight_layout()
plt.show()このコードでは、顧客の初回購入月をコホートとして定義し、月ごとの維持率を計算しています。ヒートマップによる可視化は、経営陣への報告でも効果的です。
統計と分析的思考の質問
データアナリストには、統計的手法を適切に選択し、ビジネス課題に適用する能力が求められます。
A/Bテストの設計と分析
A/Bテストは、データドリブンな意思決定の基盤となる手法です。面接では、テストの設計から結果の解釈まで一連のプロセスを説明できることが期待されます。
import scipy.stats as stats
import numpy as np
def calculate_sample_size(
baseline_rate: float,
mde: float,
alpha: float = 0.05,
power: float = 0.8
) -> int:
"""Calculate required sample size for A/B test."""
effect_size = mde / np.sqrt(baseline_rate * (1 - baseline_rate))
z_alpha = stats.norm.ppf(1 - alpha / 2)
z_beta = stats.norm.ppf(power)
n = 2 * ((z_alpha + z_beta) / effect_size) ** 2
return int(np.ceil(n))
def analyze_ab_test(
control_conversions: int,
control_visitors: int,
treatment_conversions: int,
treatment_visitors: int
) -> dict:
"""Analyze A/B test results with statistical significance."""
control_rate = control_conversions / control_visitors
treatment_rate = treatment_conversions / treatment_visitors
# Pooled proportion
pooled = (control_conversions + treatment_conversions) / \
(control_visitors + treatment_visitors)
# Standard error
se = np.sqrt(pooled * (1 - pooled) *
(1/control_visitors + 1/treatment_visitors))
# Z-score and p-value
z_score = (treatment_rate - control_rate) / se
p_value = 2 * (1 - stats.norm.cdf(abs(z_score)))
# Confidence interval
ci_95 = 1.96 * se
lift = (treatment_rate - control_rate) / control_rate * 100
return {
'control_rate': round(control_rate, 4),
'treatment_rate': round(treatment_rate, 4),
'lift_pct': round(lift, 2),
'p_value': round(p_value, 4),
'is_significant': p_value < 0.05,
'confidence_interval': (round(-ci_95, 4), round(ci_95, 4))
}サンプルサイズの計算方法、検出力(power)の概念、そしてp値の解釈について明確に説明できることが重要です。
相関分析と因果関係
「相関は因果を意味しない」という原則は、データアナリストが常に意識すべき点です。
import pandas as pd
import numpy as np
from scipy import stats
def correlation_analysis(df: pd.DataFrame, target_col: str) -> pd.DataFrame:
"""Analyze correlations between features and target."""
numeric_df = df.select_dtypes(include=[np.number])
correlations = []
for col in numeric_df.columns:
if col != target_col:
corr, p_value = stats.pearsonr(
numeric_df[col].dropna(),
numeric_df[target_col].dropna()
)
correlations.append({
'feature': col,
'correlation': round(corr, 4),
'p_value': round(p_value, 4),
'abs_correlation': abs(corr)
})
result = pd.DataFrame(correlations)
result = result.sort_values('abs_correlation', ascending=False)
return result
def check_multicollinearity(df: pd.DataFrame) -> pd.DataFrame:
"""Check for multicollinearity using VIF."""
from statsmodels.stats.outliers_influence import variance_inflation_factor
numeric_df = df.select_dtypes(include=[np.number]).dropna()
vif_data = pd.DataFrame()
vif_data['feature'] = numeric_df.columns
vif_data['VIF'] = [
variance_inflation_factor(numeric_df.values, i)
for i in range(numeric_df.shape[1])
]
return vif_data.sort_values('VIF', ascending=False)面接では、相関が高い変数間の関係を解釈する際の注意点や、多重共線性の問題について質問されることがあります。
ビジネスケースの分析質問
技術スキルに加えて、ビジネス課題を分析的に解決する能力も重視されます。
解約予測モデルの設計
顧客解約(チャーン)の予測は、多くの企業で重要な分析課題です。面接では、モデル設計のアプローチを説明することが求められます。
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import classification_report, roc_auc_score
def build_churn_model(df: pd.DataFrame) -> dict:
"""Build and evaluate a churn prediction model."""
# Feature selection
features = [
'tenure_months',
'monthly_charges',
'total_charges',
'num_support_tickets',
'days_since_last_login',
'contract_type_encoded',
'payment_method_encoded'
]
X = df[features]
y = df['churned']
# Split data
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42, stratify=y
)
# Scale features
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
# Train model
model = RandomForestClassifier(
n_estimators=100,
max_depth=10,
class_weight='balanced',
random_state=42
)
model.fit(X_train_scaled, y_train)
# Evaluate
y_pred = model.predict(X_test_scaled)
y_prob = model.predict_proba(X_test_scaled)[:, 1]
# Feature importance
importance = pd.DataFrame({
'feature': features,
'importance': model.feature_importances_
}).sort_values('importance', ascending=False)
return {
'auc_score': roc_auc_score(y_test, y_prob),
'classification_report': classification_report(y_test, y_pred),
'feature_importance': importance
}モデルの精度だけでなく、ビジネスへの影響(解約を防ぐことで節約できるコストなど)を定量化できることも評価されます。
Data Analyticsの面接対策はできていますか?
インタラクティブなシミュレーター、flashcards、技術テストで練習しましょう。
面接成功のための準備ポイント
データアナリスト面接で成功するためには、技術スキルとビジネス理解の両方が必要です。以下のポイントを意識して準備することをお勧めします。
まず、SQLとPythonの基礎を確実に固めることが重要です。ウィンドウ関数、CTEの使い方、pandasの効率的な操作方法は必須スキルです。
次に、統計的思考を身につけることです。A/Bテストの設計、仮説検定の選択、結果の解釈を論理的に説明できるようになることが求められます。
最後に、ポートフォリオを準備することです。実際のデータセットを使った分析プロジェクトをGitHubで公開し、分析プロセスと発見事項を明確に文書化しておくと、面接官に実力を示すことができます。
データアナリストの役割は、データから洞察を引き出し、ビジネス意思決定を支援することです。技術的な正確さとビジネスへの理解を両立させることで、面接で高い評価を得ることができます。
Data Analytics のバグを見つけられますか
実際のコード、隠れたバグ、1日1回。アカウントなしで試せます。

執筆
Anthony Fillion-MailletSharpSkill 創業者
10 年以上フルスタック開発に携わっています。SharpSkill を運営し、ここで公開される内容に責任を負っています。
2026年9月8日 更新
タグ
共有
関連記事

2026年イタリアのデータアナリスト面接質問: SQL、Python、分析スキル完全ガイド
イタリアで2026年にデータアナリストとして採用されるための面接対策ガイド。SQL、Python、pandas、ビジネス分析に関する頻出質問と模範解答を詳しく解説します。

2026年版 データアナリティクス面接質問トップ25
2026年のデータアナリティクス面接対策ガイド。SQL、Python、Power BI、統計、行動面接の頻出質問25問をコード例付きで徹底解説します。

Pandas 3.0(2026年版):新API、破壊的変更、面接対策の完全ガイド
Pandas 3.0のCopy-on-Write、PyArrow文字列バックエンド、pd.col()式ビルダーなどの新機能を徹底解説。データ分析エンジニアの面接で問われるポイントも網羅。