Cracking ML Interviews

Open in the interactive study hub

Contributing to CrackingMachineLearningInterview

Thank you for helping make this repository better! Contributions of all kinds are welcome: new questions, improved answers, new guides, code examples, and bug fixes.


Table of Contents

  1. Ways to Contribute
  2. Getting Started
  3. Repository Structure
  4. Content Guidelines
  5. Formatting Standards
  6. Review Process
  7. Code of Conduct

Ways to Contribute

Type Description Examples
New Q&A Add interview questions and answers Classic ML Q&A in README.md
Improve answers Expand or clarify existing answers Add code examples, fix inaccuracies
New guide Create a new topic guide New framework or algorithm coverage
Code examples Add working Python code to guides Scikit-learn, PyTorch, HuggingFace examples
Bug fixes Fix typos, broken links, incorrect info Spelling errors, outdated info
Translations Translate content to other languages Spanish, Chinese, etc.

Getting Started

1. Fork and Clone

# Fork the repo on GitHub, then:
git clone https://github.com/YOUR_USERNAME/CrackingMachineLearningInterview.git
cd CrackingMachineLearningInterview

# Add the upstream remote
git remote add upstream https://github.com/shafaypro/CrackingMachineLearningInterview.git

2. Create a Branch

# Always create a feature branch: never commit directly to main
git checkout -b add-transformer-architecture-guide
# or
git checkout -b fix-regex-typo-readme

Branch naming conventions:

3. Make Your Changes

Follow the content and formatting guidelines below. Then check that all links work:

python3 tools/check_links.py                 # whole repo, plus the index.html nav entries
python3 tools/check_links.py path/to/new.md  # just your file
python3 tools/check_style.py                 # no em or en dashes; use colons, commas, parentheses or hyphens
python3 tools/build_question_bank.py         # refresh data/questions.json for the practice drill
pip install markdown-it-py==4.0.0            # once, for the next command
python3 tools/build_site.py                  # refresh guides/*.html and sitemap.xml (the search-engine pages)

The same checks run in CI on every pull request, including --check runs that fail if data/questions.json, guides/ or sitemap.xml are out of date. Never edit guides/ by hand: it is generated from the Markdown. If you add a new guide, also add it to the track list in README.md, the track's own README.md, and the files list of the right track in index.html.

4. Commit Your Changes

git add your-changed-files.md
git commit -m "Add transformer architecture guide with attention mechanism Q&A"

Write clear commit messages:

5. Open a Pull Request

git push origin your-branch-name

Then open a Pull Request on GitHub. Use the PR template:


Repository Structure

CrackingMachineLearningInterview/
├── README.md                        ← Classic ML Q&A (169+ questions)
├── CONTRIBUTING.md                  ← This file
├── docs/
│   ├── 2026-interview-roadmap.md    ← Modern interview topics overview
│   ├── 2026-additional-questions.md ← Modern Q&A (25+ questions)
│   ├── study-pattern.md             ← Study guide with difficulty levels
│   └── resources-and-references.md ← Books and external resources
├── ai_genai/                        ← AI/GenAI/LLM topics
│   ├── intro_rag.md
│   ├── intro_vector_databases.md
│   └── ...
├── classical_ml/                    ← Classical ML algorithms
│   ├── intro_clustering.md
│   ├── intro_time_series.md
│   └── ...
├── mlops/                           ← MLOps and production ML
│   ├── intro_mlflow.md
│   ├── intro_model_serving.md
│   └── ...
├── cloud_ml/                        ← Cloud ML platforms and AWS/GCP/Azure services
│   ├── intro_cloud_ml_platforms.md
│   ├── aws_for_ml_engineers.md
│   └── ...
├── data_engineering/                ← Data engineering tools
│   ├── intro_apache_spark.md
│   └── ...
└── devops/                          ← DevOps and infrastructure
    ├── intro_docker.md
    └── ...

Where to Add New Content

Content Type Location
Classic ML interview questions README.md under relevant section
Modern AI/LLM questions docs/2026-additional-questions.md
New AI/GenAI guide ai_genai/intro_<topic>.md
New classical ML guide classical_ml/intro_<topic>.md
New MLOps guide mlops/intro_<topic>.md
New data engineering guide data_engineering/intro_<topic>.md
New DevOps guide devops/intro_<topic>.md
New cloud platform guide cloud_ml/intro_<topic>.md

Content Guidelines

What Makes a Good Interview Question/Answer?

Good questions:

Good answers:

Bad answers to avoid:

Example of a Good Q&A

#### What is the difference between precision and recall?

Precision measures what fraction of your positive predictions were correct:
Precision = TP / (TP + FP). It answers: "Of everything I labeled positive, how many were actually positive?"

Recall measures what fraction of actual positives you found:
Recall = TP / (TP + FN). It answers: "Of all actual positives, how many did I find?"

There is always a tradeoff: increasing the classification threshold raises precision but reduces recall. Business context dictates the priority:
- Fraud detection: prioritize recall (catch most fraudulent transactions, even with false alarms)
- Email spam filter: prioritize precision (don't mark legitimate emails as spam)
- Medical diagnosis (cancer): prioritize recall (better to investigate false positives than miss true positives)

The F1 score is the harmonic mean: F1 = 2 * (precision * recall) / (precision + recall), providing a single balanced metric.

Guide Structure Requirements

New topic guides must include:

  1. Title and introduction: what the technology is and why it matters
  2. Table of Contents: linked to anchors
  3. Core concepts: definitions and diagrams/tables
  4. Code examples: working Python code with comments
  5. Comparison tables: when relevant (vs alternatives)
  6. Interview Q&A section: minimum 8 questions with detailed answers
  7. Common Pitfalls section: table format with problem + fix
  8. Related Topics section: links to related guides in the repo

Formatting Standards

Markdown Conventions

# Top-level title (one per file)
## Major section
### Subsection

**Bold** for key terms and emphasis
`code` for inline code, file names, variable names
*italics* for book/paper titles

Code Blocks

Always specify the language:

# Python code with descriptive comments
from sklearn.ensemble import RandomForestClassifier

model = RandomForestClassifier(n_estimators=100)
model.fit(X_train, y_train)
# Shell commands
pip install scikit-learn
-- SQL examples
SELECT user_id, COUNT(*) as purchase_count
FROM orders
GROUP BY user_id

Tables

Use tables for comparisons and summaries:

| Method | Pros | Cons | Use When |
|--------|------|------|---------|
| L1 (Lasso) | Feature selection | Unstable with correlated features | Many irrelevant features |
| L2 (Ridge) | Stable, all features used | No feature selection | Features all potentially relevant |

Difficulty Tags

Tag Q&A with difficulty level:


Review Process

  1. Automated checks: All PRs must have valid Markdown (no broken syntax)
  2. Content review: A maintainer reviews for accuracy and completeness
  3. Formatting review: Check adherence to style guide
  4. Merge: Squash-merge to keep clean history

Timeline: We aim to review PRs within 5-7 business days. If you haven't heard back in 10 days, feel free to ping in the PR comments.

Review Checklist (for reviewers)


Code of Conduct

This project follows the Contributor Covenant Code of Conduct. By participating, you agree to uphold its standards.

Key points:


Questions?

Thank you for contributing! Every improvement helps someone prepare for their next ML interview.

View or edit this guide on GitHub