Hello future Developers in Residence! Odds are that you have a semi-regularly scheduled session with your class. If you need activity ideas, here you go! These activities help break up the day, wake students up, and get their brains working again. I found that students love whiteboarding exercises, aren't all that jazzed about vocabulary drills (but do find them to be useful), and like show-and-tell-type activities a lot.
When you're first introducing this sort of exercise, it's a great time to talk about whiteboarding best practices, the differences between coding on a computer vs coding on paper/whiteboard, how to effectively communicate when you're talking out loud while coding, etc.
- Collatz Conjecture: Start with a number n > 1. Find the number of steps it takes to reach n = 1 using the following process:
if n is even, divide it by 2
if n is odd, multiply it by 3 and add 1
- Calculator: Implement multiplication (*), division (/), and subtraction (-) using only the addition (+) operator.
- Sum Pairs: Write a program to find all pairs of integers in an array that sum up to a specified value. Can you implement it in constant (O(n)) time? Example:
sum_pairs([109, 3, 22, 6, 56, 7, 4], 10)
=> [[3, 7], [6, 4]]
- Numbers to Words: Given an integer between 0 and 999,999, print an English phrase that describes the integer (e.g., "One Thousand, Two Hundred and Thirty Four").
- Etc! Use your imagination. Classic problems like Fibonacci are good, but so are fun CodeWars-type exercises.
If it's not a full whiteboarding practice but you're giving them whiteboarding-type questions to wake them up after lunch, it's useful to start them out by making them whiteboard for the first part of the session (10-15 minutes) before letting them get on their computers. This makes them really think about inputs and outputs and explore the problem in ways that they might not if they started coding right away.
For both JavaScript and Ruby. You'll get a lot of milage out of this one!
Each session should be focused on methods for a certain data type (strings, arrays, hashes, enumerables...). Give each student a notecard with a method name on it. They will have 5 minutes to research the method and come up with a quick way to demonstrate it. After the 5 minutes is up, have each student come to the front to tell the other students what the method is, what it's used for, and give a quick demo of it in Node or IRB.
This activity can take a while! For larger classes, consider splitting students into teams of 2 to speed things up. For speed and ease of use, set up a few variables of the correct data type in advance so that students can just apply their method to the variable.
Pass out different questions to each student. Give them a minute or so to answer, then they will rotate the questions. Have them write either on their table or on a piece of paper. The goal is to have every student answer each question - once that's done, read each question aloud and have students volunteer their answers. This could also be done in groups of 2 students if the class is large.
This was only semi-successful as a group exercise, but I think that having a session on what makes a question good vs what makes a question bad AND what makes an answer good vs what makes an answer bad would be really useful. Perhaps you could find a really good question and a really good answer and a bad question and a bad answer to give examples of all of these. Talk about contributing meaningfully to the development community.
I never did this, but it sounds like a good idea. Give each pod/table a quiz of 4-5 questions, then give them 5-10 minutes to discuss the answers. At the end of the given time, walk around the tables. You should be able to ask any member of the group any of the questions from the quiz and get the right answer. If the group member doesn't know the answer, tell the table to talk it over more and move on to the next table. When you come back to the first table, the group member should be able to give you the correct answer.
- pwd
- cd
- ls
- rm
- cp
- mv
- head
- tail
- grep
- -B
- -C
- -A
- cat
- | (pipestem character)
- less
- GUI
- mkdir
- rmdir
- touch
- path
- directory
- man
- ||
- &&
- git
- GitHub
- git clone
- git push
- git pull
- git add
- git commit
- ==
- ===
- truthy
- falsy
- CDN
- Bootstrap
- <a> tag
- <img>
- <script>
- <link>
- <div>
- <p>
- <body>
- <head>
- ID
- class
- border (CSS)
- margin (CSS)
- padding (CSS)
- responsive design
- grid system
- jQuery
- scope
- array
- .slice
- .splice
- .concat
- .sort
- .split
- typeof
- array index
- string
- boolean
- null
- undefined
- object literal
- function
- relative path
- absolute path
- children
- parent
- DOM
- CSS specificity
- getter
- setter
- .text (jQuery)
- documentation
- parameter
- argument
- camelCase
- .length
- .unshift
- .push
- .pop
- .shift
- .indexOf
- .forEach
- .toUpperCase
- Express
- Node.js
- npm
- GET
- POST
- PUT
- DELETE
- localhost
- package.json
- CRUD
- HTTP
- node_modules
- nodemon
- separation of concerns
- HTTP status codes
- .gitignore
- OOP
- <input>
- .preventDefault()
- query parameters
- URL parameters
- API
- middleware
- AJAX
- RESTful routes
- JSON
- callback
- server
- client
- .erb
- primary key
- foreign key
- inheritance
- SQL
- gem
- migration
- routes.rb
- rake db:create
- rake db:migrate
- rake db:rollback
- seeds.rb
- schema.rb
- PostgreSQL
- column (in a database context)
- row (in a database context)
- table (in a database context)
- attr_reader
- attr_writer
- attr_accessor
- initialize
- 1:1
- 1:N
- N:N
- instance variable
- class variable
- instance method
- OOP
- model
- controller
- class
- object
- TDD
- separation of concerns