Sahami, Mehran
I joined the Computer Science Department at Stanford University as Associate Professor (Teaching), Associate Chair for Undergraduate Education, and Director of Educational Affairs. From 2001 to 2006, I also taught in the CS department at Stanford as a Lecturer. From 2002-2007, I was a Senior Research Scientist at Google, where I continue to maintain a consulting appointment in the research group. My research interests include computer science education, machine learning, and information retrieval on the Web. Please see my publications web page for more information.
Previously, I worked for several years as a Senior Engineering Manager at Epiphany. Prior to working at Epiphany, I completed my PhD in the Computer Science Department at Stanford. I was also an undergrad at Stanford and I loved it so much that I didn't want to leave.
Outside of work, I enjoy spending time with family, playing the guitar, going on outdoor excursions, and sleeping (which seems to be getting rarer and rarer these days).
Assignment | Solutions | Distributed |
---|---|---|
Assignment 1 | Solutions | Lecture 4 |
Assignment 2 | Solutions | Lecture 7 |
Assignment 3 | Solutions | Lecture 10 |
Assignment 4 | Solutions | Lecture 13 |
Assignment 5 | Solutions | Lecture 16 |
Assignment 6 | Solutions | Lecture 18 |
Assignment 7 | Solutions | Lecture 21 |
Assignment 8 | Solutions | Lecture 24 |
Assignment 9 | Solutions | Lecture 27 |
Assignment | Instructions | Starter Code | Distributed |
---|---|---|---|
1. Karel | 07-assignment-1-karel.pdf | Assignment1.zip | Lecture 2 |
2. Simple Java | 13-assignment-2-simple-java.pdf | Assignment2.zip | Lecture 6 |
3. Breakout! | 19-assignment-3-breakout.pdf | Assignment3.zip | Lecture 10 |
4. Hangman | 27-assignment-4-hangman.pdf | Assignment4.zip | Lecture 14 |
5. Yahtzee! | 35-assignment-5-yahtzee.pdf | Assignment5.zip | Lecture 18 |
6. NameSurfer | 39-assignment-6-name-surfer.pdf | Assignment6.zip | Lecture 22 |
7. FacePamphlet | 42-assignment-7-facepamphlet.pdf | Assignment7.zip | Lecture 25 |
Windows Users
|
Macintosh Users
|
Software Resources |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 50 min |
Watch Online: | Topics: Welcome to CS106A, Course Staff, Why is the class called Programming Methodology?, Are you in the right class?, Class Logistics, Assignments and Grading, Extensions, Midterm and Final, Grade Breakdown, The Honor Code, Why Karel? |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 50 min | |
Topics: Welcome to CS106A, Course Staff, Why is the class called Programming Methodology?, Are you in the right class?, Class Logistics, Assignments and Grading, Extensions, Midterm and Final, Grade Breakdown, The Honor Code, Why Karel? |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 48 min |
Watch Online: | Topics: Handout Information, Section Sign-up, Karel Commands, An Algorithm vs Program, Syntax of a Karel Program, Running a Karel Program, Creating Methods, SuperKarel, A for Loop, A While Loop, Karel Conditions, If Statement, Putting it All Together |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 48 min | |
Topics: Handout Information, Section Sign-up, Karel Commands, An Algorithm vs Program, Syntax of a Karel Program, Running a Karel Program, Creating Methods, SuperKarel, A for Loop, A While Loop, Karel Conditions, If Statement, Putting it All Together |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 51 min |
Watch Online: | Topics: Karel and Java, Common Errors, Comments, Pre-conditions and Post-conditions, Decomposition, The DoubleBeepers Example, Importance of Good Software Engineering, The Right Decomposition, The CleanUpKarel Example |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 51 min | |
Topics: Karel and Java, Common Errors, Comments, Pre-conditions and Post-conditions, Decomposition, The DoubleBeepers Example, Importance of Good Software Engineering, The Right Decomposition, The CleanUpKarel Example |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 48 min |
Watch Online: | Topics: The History of Computing, Computer Science vs Programming, What Does the Computer Understand?, The Compilation Process, Java is an Object Oriented Language, Inheritance, Instance of a Class, The acm.program Hierarchy, Your First Java Program, A ConsoleProgram Example, The Graphics Window, The Sending-Messages-to-a-GLabel Example |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 48 min | |
Topics: The History of Computing, Computer Science vs Programming, What Does the Computer Understand?, The Compilation Process, Java is an Object Oriented Language, Inheritance, Instance of a Class, The acm.program Hierarchy, Your First Java Program, A ConsoleProgram Example, The Graphics Window, The Sending-Messages-to-a-GLabel Example |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 49 min |
Watch Online: | Topics: Variables, Data Types for Variables, Syntax for Using Variables, Classes as Types, Objects as Variables, Invoking Methods on Objects, Graphics Coordinates, Operations on the GObject Class and its Subclasses, Drawing Geometrical Objects, A FunGraphics Example, Expressions and Operators |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 49 min | |
Topics: Variables, Data Types for Variables, Syntax for Using Variables, Classes as Types, Objects as Variables, Invoking Methods on Objects, Graphics Coordinates, Operations on the GObject Class and its Subclasses, Drawing Geometrical Objects, A FunGraphics Example, Expressions and Operators |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 56 min |
Watch Online: | Topics: readInt() and readDouble(), The Division Operator w.r.t ints and Doubles, Order of Precedence for Operators, Type Casting, Shorthands, Constants, The Boolean Data Type, Value Comparisons, Boolean Expressions, Short Circuit Evaluation, Statement Blocks, Scope of Variables, Cascading if, The Switch Statement, The For Loop, The While Loop |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 56 min | |
Topics: readInt() and readDouble(), The Division Operator w.r.t ints and Doubles, Order of Precedence for Operators, Type Casting, Shorthands, Constants, The Boolean Data Type, Value Comparisons, Boolean Expressions, Short Circuit Evaluation, Statement Blocks, Scope of Variables, Cascading if, The Switch Statement, The For Loop, The While Loop |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 51 min |
Watch Online: | Topics: The Loop and a Half Problem, For Versus While Loop, The CheckerBoard Program Example, Methods in Java, Examples of Methods, The FactorialExample Program, Returning Objects from Methods |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 51 min | |
Topics: The Loop and a Half Problem, For Versus While Loop, The CheckerBoard Program Example, Methods in Java, Examples of Methods, The FactorialExample Program, Returning Objects from Methods |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 49 min |
Watch Online: | Topics: Information Hiding, The Void Return Type, Parameter Passing Between Methods, Bad Times with Methods, Using Classes, Instance variables vs Local Variables, The RandomGenerator Program Example, The RollDice Program Example, The setSeed() Method |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 49 min | |
Topics: Information Hiding, The Void Return Type, Parameter Passing Between Methods, Bad Times with Methods, Using Classes, Instance variables vs Local Variables, The RandomGenerator Program Example, The RollDice Program Example, The setSeed() Method |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 52 min |
Watch Online: | Topics: Strings, Writing Your Own Class, Public and Private Visibility, Creating a New Class, The Constructor Method, Shadowing of Variables and the 'this' Keyword, Using the Created Class, Objects are Called by Reference not Called by Value, Class Variables, The JavaDoc, The Student Program Example |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 52 min | |
Topics: Strings, Writing Your Own Class, Public and Private Visibility, Creating a New Class, The Constructor Method, Shadowing of Variables and the 'this' Keyword, Using the Created Class, Objects are Called by Reference not Called by Value, Class Variables, The JavaDoc, The Student Program Example |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 47 min |
Watch Online: | Topics: Importance of Private Variables, Extending the Student Class, Overriding Methods, The acm.graphics Package, GCanvas, Methods Common to All GObjects, Interfaces and Methods Defined by Them, The BouncingBall Program Example, The Geometry of the GLabel Class, The GArc Class |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 47 min | |
Topics: Importance of Private Variables, Extending the Student Class, Overriding Methods, The acm.graphics Package, GCanvas, Methods Common to All GObjects, Interfaces and Methods Defined by Them, The BouncingBall Program Example, The Geometry of the GLabel Class, The GArc Class |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 50 min |
Watch Online: | Topics: The GImage Class, The GPolygon Class, The GCompound Class, Event Driven Programs, The ClickForFace Program Example, Responding to Mouse Events, Responding to Keyboard Events, The UFO program Example |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 50 min | |
Topics: The GImage Class, The GPolygon Class, The GCompound Class, Event Driven Programs, The ClickForFace Program Example, Responding to Mouse Events, Responding to Keyboard Events, The UFO program Example |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 49 min |
Watch Online: | Topics: Enumeration, Characters, The ASCII Subset of Unicode, Reading Characters, Math on Characters, char as a Primitive Type; the Character Class, Strings and Their Manipulations |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 49 min | |
Topics: Enumeration, Characters, The ASCII Subset of Unicode, Reading Characters, Math on Characters, char as a Primitive Type; the Character Class, Strings and Their Manipulations |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 46 min |
Watch Online: | Topics: Memory, Different Sections of Memory for Different Types of Variables, Memory Allocation Mechanics, The Pointer Viewpoint, The Binky Pointer Fun Video |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 46 min | |
Topics: Memory, Different Sections of Memory for Different Types of Variables, Memory Allocation Mechanics, The Pointer Viewpoint, The Binky Pointer Fun Video |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 48 min |
Watch Online: | Topics: Pointer Recap, Why are Objects 'Call by Reference' Instead of 'Call of Value'?, Wrapper Classes for Primitive Types, Files, Code for Opening, Reading and Closing Files, Exceptions, Code for Writing Files |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 48 min | |
Topics: Pointer Recap, Why are Objects 'Call by Reference' Instead of 'Call of Value'?, Wrapper Classes for Primitive Types, Files, Code for Opening, Reading and Closing Files, Exceptions, Code for Writing Files |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 50 min |
Watch Online: | Topics: Array, Creating a New Array, The ++ Operator, Actual Size / Effective Size of the Array, An Array as a Parameter, Initialize an Array During Creation, An ArrayList |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 50 min | |
Topics: Array, Creating a New Array, The ++ Operator, Actual Size / Effective Size of the Array, An Array as a Parameter, Initialize an Array During Creation, An ArrayList |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 50 min |
Watch Online: | Topics: Multi-dimensional Arrays, An ArrayList, The Template Class, Methods in the ArrayList Class, An Example Program Using ArrayList, ArrayLists Hold Objects, An Example Program with an ArrayList of Glabels, The GrayImage Example Program |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 50 min | |
Topics: Multi-dimensional Arrays, An ArrayList, The Template Class, Methods in the ArrayList Class, An Example Program Using ArrayList, ArrayLists Hold Objects, An Example Program with an ArrayList of Glabels, The GrayImage Example Program |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 47 min |
Watch Online: | Topics: A Wrap Up of Multi-dimensional Arrays, The ArrayList Way, Pros and Cons : ArrayList vs. Array, Debugging, Approaches to Debugging, The Debugger in Eclipse |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 47 min | |
Topics: A Wrap Up of Multi-dimensional Arrays, The ArrayList Way, Pros and Cons : ArrayList vs. Array, Debugging, Approaches to Debugging, The Debugger in Eclipse |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 50 min |
Watch Online: | Topics: An Interface, How are Interfaces Implemented, A Map, The HashMap Class, Methods of the HashMap, The Collection Hierarchy, The Map Hierarchy, An Iterator, A HashMap Example |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 50 min | |
Topics: An Interface, How are Interfaces Implemented, A Map, The HashMap Class, Methods of the HashMap, The Collection Hierarchy, The Map Hierarchy, An Iterator, A HashMap Example |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 45 min |
Watch Online: | Topics: GUI, Interactors in the Context of a Java Program, The Swing Interactor Hierarchy, Window Regions, Creating Interactors, Example Programs, Exploring More Interactors, The InteractiveDrawFace Program Example |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 45 min | |
Topics: GUI, Interactors in the Context of a Java Program, The Swing Interactor Hierarchy, Window Regions, Creating Interactors, Example Programs, Exploring More Interactors, The InteractiveDrawFace Program Example |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 48 min |
Watch Online: | Topics: Review of Interactors and Listeners, Example Programs, The Use of the Two Ways Shown in the Examples - Using getSouce and getActionCommand, TextField Example, Layouts, The Temperature Conversion Example, The TextAndGraphics Example |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 48 min | |
Topics: Review of Interactors and Listeners, Example Programs, The Use of the Two Ways Shown in the Examples - Using getSouce and getActionCommand, TextField Example, Layouts, The Temperature Conversion Example, The TextAndGraphics Example |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 46 min |
Watch Online: | Topics: Overview of NameSurfer - The Next Assignment, Components and Containers, Listeners for Components, Create a Program Which Extends Program, The ComponentListener Interface, The MusicShop Example Program, The MusicShopDisplay Example Program |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 46 min | |
Topics: Overview of NameSurfer - The Next Assignment, Components and Containers, Listeners for Components, Create a Program Which Extends Program, The ComponentListener Interface, The MusicShop Example Program, The MusicShopDisplay Example Program |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 51 min |
Watch Online: | Topics: Introduction to Lecture's material - Searching, Sorting and Algorithmic Efficiency, Searching, Linear Search, Efficiency of Linear Search, Binary Search, Efficiency of Binary Search, Comparing Search Efficiencies, Sorting, The Selection Sort Algorithm, Efficiency of Selection Sort, The Radix Sort Algorithm |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 51 min | |
Topics: Introduction to Lecture's material - Searching, Sorting and Algorithmic Efficiency, Searching, Linear Search, Efficiency of Linear Search, Binary Search, Efficiency of Binary Search, Comparing Search Efficiencies, Sorting, The Selection Sort Algorithm, Efficiency of Selection Sort, The Radix Sort Algorithm |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 47 min |
Watch Online: | Topics: Principles of Good Software Engineering for Managing Large Amounts of Data, Principles of Design, The Collection Hierarchy, Useful Methods of Collection, The FlyTunes Example Program - An Online Music Store, Defining the Song Class, Defining the Album Class, Seeing the Program Run, Considering the Data Structures Needed, Reusing Data - Shallow Copy vs. Deep Copy, The FlyTunesStore Program Code |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 47 min | |
Topics: Principles of Good Software Engineering for Managing Large Amounts of Data, Principles of Design, The Collection Hierarchy, Useful Methods of Collection, The FlyTunes Example Program - An Online Music Store, Defining the Song Class, Defining the Album Class, Seeing the Program Run, Considering the Data Structures Needed, Reusing Data - Shallow Copy vs. Deep Copy, The FlyTunesStore Program Code |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 47 min |
Watch Online: | Topics: Defining a Social Network for Our Purposes, See What the Program Needs to Do, The Six Degrees of Separation Phenomenon, Concurrency, A Thread, The Runnable Interface, Creating a Thread, Example Program, Having Shared Data Between Your Threads |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 47 min | |
Topics: Defining a Social Network for Our Purposes, See What the Program Needs to Do, The Six Degrees of Separation Phenomenon, Concurrency, A Thread, The Runnable Interface, Creating a Thread, Example Program, Having Shared Data Between Your Threads |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 42 min |
Watch Online: | Topics: Introduction to the Standard Java Libraries, A JAR File, Creating a JAR File, Creating an Applet, Standard Java Programs Without Using the ACM Libraries, Other Resources - Learning More Java |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 42 min | |
Topics: Introduction to the Standard Java Libraries, A JAR File, Creating a JAR File, Creating an Applet, Standard Java Programs Without Using the ACM Libraries, Other Resources - Learning More Java |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 42 min |
Watch Online: | Topics: Life After CS106A, The CS Major, Other Possible Majors |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 42 min | |
Topics: Life After CS106A, The CS Major, Other Possible Majors |
Watch Online: | Watch Now |
Download:
Right Click, and Save As
| Download |
Duration: | 42 min |
Watch Online: | Topics: The Graphics Contest Winners, Review for the Final, Example Question 1, Example Question 2, A Wrap-up |
Watch Online: |
Download:
Right Click, and Save As
|
Duration: | |
Watch Now | Download | 42 min | |
Topics: The Graphics Contest Winners, Review for the Final, Example Question 1, Example Question 2, A Wrap-up |