In general, students find problems that require them to trace, write, and unscramble code,
or to complete code fragments to be the most difficult.
A good way to practice for such questions is to:
- learn what the terminology is and what each term means, to be sure that you can understand each question
- learn any assumptions or pre-conditions that are required before a given algorithm is the correct choice
- develop good techniques and strategies for tracing code quickly and effectively
- practice tracing recursive vs iterative code until you have an effective technique for tracking details of either style
- write code for all of the data structure operations
- practice all algorithms until you do not need to look up the algorithm to execute each step
- think of your own similar but different problems as were done in lecture and notes and solve them
- practice the lookup and insert operations for each data structure variation until you can do them without looking them up in your notes
- make sure that you can remove from a BST and Hash Table and graph.
- form a study group with your classmates and interview each other - think of questions to ask each other to solve and vice versa
- challenge each other
- think of the problem, data structure, or algorithm that you most hope I do not ask about and learn how to solve that problem until you hope I ask that question
- repeat the previous step for all problems and topics that scare you most