Skip to content

zautke/ai-interview-codex

 
 

Repository files navigation

ML/AI Interview Preparation - Complete Guide

A comprehensive collection of machine learning and AI interview preparation materials, covering ML coding, system design, LLM/GenAI, and DSA.

Repository Overview

This repository contains battle-tested interview preparation materials for ML/AI engineering roles, including:

  • Machine Learning: Algorithms from scratch, coding problems, production ML systems
  • LLM/GenAI: Production LLMs, RAG systems, embeddings, attention mechanisms
  • System Design: Agentic AI systems, distributed ML, scalable architectures
  • DSA: Data structures and algorithms for ML engineers
  • MLOps: Production best practices, monitoring, deployment

Quick Start

For ML Coding Interviews

  1. Start with ML Coding Interview Master Guide
  2. Practice with ML Algorithms from Scratch
  3. Review Neural Network Components

For System Design Interviews

  1. Read LLM/ML System Design Master Guide
  2. Study iterative examples:
  3. Study Model Context Protocol (MCP) - Universal AI-tool integration standard
  4. Review System Design Examples

For LLM/GenAI Roles

  1. Start with fundamentals:
  2. LLM Production Complete Guide
  3. Production RAG Systems
  4. Embedding Models Guide
  5. LoRA/QLoRA Fine-tuning
  6. Model Context Protocol (MCP):

For MLOps/Production ML

  1. MLOps Production Guide
  2. Feature Engineering Guide

Complete Content Index

Machine Learning Fundamentals

ML Coding & Algorithms

Decision Trees

  • Decision Trees Complete Guide - Complete guide to decision trees:
    • Tree construction algorithms (CART, ID3, C4.5)
    • Splitting criteria (Entropy, Gini, Information Gain)
    • Pruning techniques (pre-pruning, post-pruning)
    • Regression trees and variance reduction
    • Feature importance (MDI, permutation)
    • Tree visualization methods
    • Implementation from scratch
    • 25+ interview questions with answers

Ensemble Methods

  • Bagging Ensemble Methods - Bootstrap Aggregating complete guide:
    • Bootstrap sampling, OOB error
    • Random Forest deep dive
    • Variance reduction mechanism
    • Implementation from scratch
    • 20+ interview questions with answers
  • Boosting Ensemble Methods - Boosting algorithms complete guide:
    • AdaBoost, Gradient Boosting
    • XGBoost, LightGBM, CatBoost
    • Bias reduction mechanism
    • Algorithm comparison and when to use each
    • 25+ interview questions with answers

Production ML & MLOps

  • MLOps Production Guide - End-to-end ML in production:
    • Model versioning, experiment tracking
    • CI/CD for ML, model deployment
    • Monitoring, A/B testing
    • Data pipelines, feature stores
  • Feature Engineering Guide - Feature engineering techniques:
    • Numerical, categorical, text features
    • Time series, embeddings
    • Feature selection, dimensionality reduction

Deep Learning & Neural Networks

  • Neural Network Components - Build neural networks from scratch:
    • Dense layers, activation functions
    • Backpropagation, optimizers (SGD, Adam, RMSprop)
    • Batch normalization, dropout
    • CNN components
  • Attention Mechanisms Guide - Deep dive into attention:
    • Self-attention, multi-head attention
    • Transformer architecture
    • Positional encoding
    • BERT, GPT architectures
  • Transformer Architecture Complete Guide - Transformer fundamentals:
    • Encoder-only, Decoder-only, Encoder-Decoder
    • Pretraining & Post-training (SFT, RLHF, DPO, PPO)
    • Scaling laws

LLM & Generative AI

LLM Fundamentals

  • LLM Fundamentals Part 1: Tokenization & Context - Core LLM concepts:
    • Tokenization (BPE, WordPiece, SentencePiece, Unigram)
    • Context windows and memory complexity
    • Positional encoding (Sinusoidal, RoPE, ALiBi)
    • Complete implementations with mermaid diagrams
  • LLM Fundamentals Part 2: Inference & Optimization - Advanced LLM concepts:
    • Inference strategies (greedy, beam search, sampling, temperature, top-k, top-p)
    • Evaluation metrics (perplexity, task-specific)
    • Model sizes and scaling laws (Chinchilla, Kaplan)
    • KV cache optimization (PagedAttention, quantization)
    • Speculative decoding (2-4× speedup)
    • Prompting techniques (zero-shot, few-shot, CoT, self-consistency)
  • LLM Production Complete Guide - Production LLMs:
    • Model selection, deployment strategies
    • Cost optimization, caching
    • Prompt engineering, fine-tuning
    • Evaluation metrics

Fine-tuning & Optimization

  • LoRA/QLoRA Fine-tuning - Parameter-efficient fine-tuning:
    • LoRA, QLoRA concepts
    • Implementation examples
    • Quantization techniques
    • Memory optimization

RAG & Embeddings

  • Production RAG Systems - Building RAG systems:
    • Document chunking, indexing
    • Hybrid search, re-ranking
    • Evaluation (Ragas, TruLens)
    • Advanced RAG patterns
  • Embedding Models Guide - Embeddings in depth:
    • Model selection (OpenAI, Cohere, sentence-transformers)
    • Semantic search, clustering
    • Fine-tuning embeddings
    • Vector databases

System Design

LLM/ML System Design

  • LLM/ML System Design Master Guide - Complete framework:
    • Interview approach (45-minute structure)
    • Key patterns (RAG, agents, fine-tuning)
    • Production considerations
    • Evaluation strategies

Iterative System Design Examples

  • Agentic AI Customer Support - Build from scratch:
    • 10 iterations: bare minimum → production
    • Multi-agent orchestration (LangGraph)
    • Memory & context management
    • Scale to 100K+ queries/day
    • Cost optimization ($5K → $220/day)
  • AI Code Review System - Iterative design:
    • 10 iterations: single LLM → production
    • RAG for codebase context
    • Multi-agent specialists (security, performance, bugs)
    • Learning from developer feedback
    • Scale to 500 PRs/day
  • Agent Memory Architecture - Memory patterns:
    • 6 memory types (short-term, long-term, episodic, semantic, entity, procedural)
    • Hybrid memory architecture (4 layers)
    • Framework comparison (Anthropic, LangGraph, CrewAI, OpenAI Swarm)
    • Semantic caching (40-70% cost reduction)

Model Context Protocol (MCP)

  • MCP Interview Preparation Guide - Complete MCP interview prep:
    • MCP architecture and three core primitives
    • Client-Host-Server architecture patterns
    • Transport layers (stdio, HTTP+SSE)
    • Production deployment patterns
    • Security best practices (mTLS, authentication)
    • Industry adoption timeline
    • 10 comprehensive Q&A sections
    • 25+ mermaid diagrams
  • MCP Hands-On Implementation - Practical MCP coding:
    • Building MCP servers with custom tools
    • Implementing resource providers
    • Creating prompt templates
    • GitHub and database integration examples
    • Complete end-to-end projects
  • MCP Enterprise Banking Use Case - Real-world enterprise example:
    • Banking mainframe integration with cloud AI agents
    • Zero-trust security with data residency compliance
    • Tokenization, encryption, HSM integration
    • PCI-DSS, SOX, GDPR, GLBA compliance
    • Multi-agent orchestration for fraud detection
    • Complete ROI analysis (700% ROI)
  • MCP Production Best Practices - Production deployment guide:
    • High-availability MCP server clusters
    • Multi-region deployment architecture
    • Serverless MCP on AWS Lambda
    • Security (mTLS, secrets management)
    • Monitoring and observability
    • Circuit breakers, retries, graceful degradation
    • Cost optimization strategies
    • Complete production checklist

Traditional System Design

  • System Design Examples Enhanced - ML system designs:
    • Threat detection system
    • Semantic search
    • Network anomaly detection
    • Complete with architecture diagrams

Data Structures & Algorithms

DSA Learning Plan

Interview Preparation Resources

Related Learning Series

  • LangChain Learning Series - Comprehensive 8-module course on LangChain from fundamentals to production deployment (separate repository)

Study Plans

4-Week Complete Preparation

Week 1: ML Fundamentals

  • Days 1-3: ML algorithms from scratch
  • Days 4-5: Neural network components
  • Days 6-7: ML coding problems

Week 2: LLM/GenAI

  • Days 1-2: LLM fundamentals (tokenization, context, inference)
  • Days 3-4: LLM production guide
  • Days 5: RAG systems
  • Days 6: Embeddings & attention
  • Day 7: Fine-tuning (LoRA/QLoRA)

Week 3: System Design

  • Days 1-2: System design framework
  • Days 3-4: Agentic AI examples (iterative)
  • Days 5-6: Traditional system design
  • Day 7: Practice mock interviews

Week 4: DSA + Review

  • Days 1-6: DSA crash course (one topic per day)
  • Day 7: Full mock interview

2-Week Crash Course

Week 1: ML + LLM

  • Days 1-2: ML coding essentials
  • Days 3: LLM fundamentals (tokenization, context, inference)
  • Days 4-5: LLM production basics
  • Day 6: RAG systems
  • Day 7: System design framework

Week 2: System Design + DSA

  • Days 1-3: System design examples
  • Days 4-6: DSA essentials
  • Day 7: Mock interviews

Key Features

Iterative System Design Approach

Unlike traditional system design resources, this repo uses an iterative interview approach:

  • Start with bare minimum (10 lines of code)
  • Add complexity step-by-step (10 iterations)
  • Discuss tradeoffs at each step
  • Show production evolution (cost, scale, monitoring)

Example: Agentic AI system goes from:

  • Iteration 1: Single LLM ($5/query)
  • → Iteration 7: Model routing + caching ($0.0022/query)
  • 2,272x cost reduction with detailed reasoning at each step!

Code + Theory

  • Not just theory - working code for everything
  • Jupyter notebooks with runnable examples
  • Production-ready patterns and architectures
  • Real-world tradeoffs and cost calculations

2025 Interview Standards

  • Based on latest industry practices (2025)
  • MLCommons ARES evaluation standards
  • Anthropic, LangGraph, CrewAI best practices
  • Production metrics (cost, latency, accuracy)

What Makes This Unique

  1. Iterative System Design: See exactly how to build systems step-by-step in interviews
  2. Production Focus: Real costs, metrics, tradeoffs (not just toy examples)
  3. Complete Code: Every algorithm, system, and pattern has working code
  4. Modern Tech Stack: LangGraph, RAG, LoRA/QLoRA, agentic AI (2025 standards)
  5. Interview-Optimized: 45-minute format, STAR stories, questions to ask

Target Audience

This repo is perfect for:

  • ML Engineers preparing for senior roles
  • Software Engineers transitioning to ML/AI
  • Data Scientists moving to ML engineering
  • AI Researchers preparing for industry interviews
  • Engineering Managers in ML/AI domains

How to Use This Repository

For Beginners

  1. Start with Master Study Schedule
  2. Follow the 4-week complete preparation plan
  3. Work through notebooks in order
  4. Practice with coding problems

For Experienced Engineers

  1. Skim Interview Prep Complete Index
  2. Focus on weak areas (ML coding, system design, or LLM)
  3. Study iterative system design examples
  4. Practice with full mock interviews

For Specific Roles

  • LLM Engineer: Focus on LLM production guide, RAG systems, fine-tuning
  • ML Engineer: Focus on ML algorithms, production ML, MLOps
  • ML Architect: Focus on system design, iterative examples
  • Research Engineer: Focus on attention mechanisms, algorithms from scratch

Contributing

This is a personal interview preparation repository made public to help others. Contributions are welcome!

Ways to contribute:

  • Fix errors or improve explanations
  • Add new examples or problems
  • Share interview experiences
  • Suggest additional topics

License

This repository is provided for educational purposes. Feel free to use, modify, and share with attribution.

Acknowledgments

This repository was created through iterative learning and preparation for ML/AI engineering roles. Special thanks to the ML/AI community for open-source resources and shared knowledge.

Questions?

If you find this helpful or have suggestions, feel free to open an issue or start a discussion!


Star this repo if you find it helpful!

Good luck with your interviews!

About

Comprehensive ML/AI interview codex with iterative system design, production-ready code, and 2026 standards. Includes LLM/GenAI, RAG systems, agentic AI, and algorithms from scratch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 59.8%
  • Jupyter Notebook 38.5%
  • Other 1.7%