Assessment 1. Mid-Quarter Diagnostic


The CS106B mid-quarter diagnostic is intended to gauge your comfort and facility with the course material so far. Since the course topics build on each other, confirming you have a solid grasp of the foundational material now ensures you are equipped to tackle the later concepts to come in the course.

We provide the diagnostic as a tool to take stock of where you're at and see how much you've learned in the first four weeks of the course, as well as what work you have left to do. After taking the diagnostic and receiving your grading feedback, you will have the opportunity to meet 1-on-1 with your section leader to review your results, celebrate your successes, identify areas for growth, and chart your path forward through the rest of the quarter. Although the primary goal of the diagnostic is to provide feedback to you, it also contributes a small but meaningful contribution to your course grade (10%), which we hope will inspire you to use this checkpoint opportunity wisely.


  • The "Diagnostic Administration Window" is the 47-hour period that starts Wednesday, July 21 12:30pm PDT (after lecture) and ends Friday, July 23 11:30am PDT (before lecture). All students must download and complete the diagnostic during the window.
  • We will target the diagnostic for a completion time of 60-90 minutes, but students will be allowed to work up to 3 hours if they so choose. This decision is to eliminate time pressure on you when completing the diagnostic.
    • Students with OAE accommodations will receive extended time to complete the diagnostic pursuant to their specific arrangements. More details will be sent out via email to the students for whom this information is relevant.
  • You may choose any 3-hour time period that is entirely contained within the Diagnostic Window during which to take the diagnostic. You do not have to communicate your planned schedule to us. Gradescope will automatically monitor the time you start and when you submit. Your submission must be received no later than 3 hours after you have downloaded the diagnostic. Late submissions will not be accepted.
  • The diagnostic will be taken through the online Gradescope website.
    • Students will be added to the 106B Gradescope Roster before the diagnostic.
    • The goal of this diagnostic is to assess your problem-solving skills in a lower-stress environment (compared to traditional timed exams). We will be providing you with a collection of .cpp files that have function prototypes so that you can write your code in an editor that assists with formatting (writing code directly in Gradescope does not provide provide any code-relevant formatting assistance). However, we do not want you to run and test your code. Regular assignments focus heavily on the testing and debugging process, and we instead want to focus on your problem-solving skills and conceptual understanding on the diagnostic. Therefore, we have designed the starter files to not be easily runnable to avoid having you get stuck on small compiler issues or typos. Please read through the "Approaching an online assessment" strategy section for more information about the digital diagnostic format.
    • Once you write your code, you will need to copy/paste it into the Gradescope answer box.
  • The Stanford Honor Code applies to the diagnostic. It is open-note, open-book, and open-internet. You must not discuss or seek help from other human beings. Read below for further details on the Honor Code.

Honor Code

We expect you to uphold your obligations to the Stanford Honor Code whe completing the work, just as with all coursework.

  • You must not give or receive unpermitted aid of any form.
  • The work you submit must be your independent, original work; not jointly developed nor derived from the work of another.
  • You are not to discuss the content with any other person (except for private, individual communication with the course staff to ask for clarification). This restriction applies while completing your own work and afterwards up until the Diagnostic Window closes for all.
  • The prohibition against sharing or discussing with others applies to the content in any form (no verbal description, problem text, solution diagrams or code, and so on) and through any communication channel (no private conversation, group chat, email, Ed post, internet question/answer forum, etc.)

Here is a non-exhaustive list of what resources are permitted and not:

  • Permitted
    • You may access the textbook and other books in printed or digital form
    • You may look at any materials on the course website (lecture slides, section problems, practice materials, etc.), read previous conversations on our Ed forum, and review your own assignment code on Paperless
    • You may use Qt Creator or Ed to run code samples (however, as discussed above, we do not recommend trying to run/execute your actual diagnostic code)
    • You may search online to find resource material related to course content
    • You may make a private post on Ed to ask a clarifying question about the diagnostic content
  • Not Permitted
    • You must not make a public post on Ed discussing any diagnostic content
    • You must not post content from the diagnostic on any online site or seek help from a forum such as Stack Overflow
    • You must not discuss the diagnostic content with any person (other than the course staff) during the entire diagnostic window
    • You must not share your solution code with other students nor ask other students to share their solution code with you

Reflection and Check-in Meeting

The final part of the mid-quarter diagnostic process is an optional reflection and check-in with your section leader. We plan to grade the diagnostic during the weekend after the window closes and will release grades shortly thereafter. After you receive your grading feedback, you will be invited to sign up for a one-on-one meeting with your section leader to reflect on your experience taking the diagnostic and your personal learning goals for the rest of the course. These check-in meetings are optional, but strongly recommended. In order to encourage your engagement in this process, we offer the following incentive:

  • If you schedule a check-in with your SL and come prepared with sincere reflection on your situation and engage in thoughtful discussion of your future plans, we will bump up your diagnostic score to earn back a third of the points you lost. If your original score was 85%, your adjusted score is upped to 90%.
  • If you choose not to take part, your diagnostic score is unchanged. CS106B does not generally apply much, if any, of a curve to scores on assessments, but if we were to feel it necessary, any curve would be computed on the raw, unadjusted scores, meaning there is no penalty if you decline to participate.

Problem content and practice materials

  • Coverage. The diagnostic content covers up to and including the lecture on July 19. However, content on recursive backtracking from lecture on Friday, July 16 and Monday, July 19 will only be eligible to be covered in an optional extra credit problem. All material from Sections 1 to 3 and Assignments 1 to 3 is fair game.
  • Format. Most questions will ask you to write a function or short passage of code that accomplishes a particular task. Other questions may ask you to read a provided passage of code and analyze or reason about its behavior. There may also be short answer questions to answer in prose. The practice problems (below) contain example problems of various formats.
  • Practice problems. This set of practice problems was gathered from previous quarters as a model for the scope and content of problems that might appear on the diagnostic. We have provided two examples to look at and to study from.
  • Further practice.
    • Revisit our section materials. We pack the section handouts with way more problems that fit in a 50-minute section, so there is lots of good stuff for further practice. Section problems are similar size and scope to those on the diagnostic (in fact, many section problems originally appeared as exam problems in previous quarters).
    • The exercises in the textbook are another great source of practice problems.


Assessments in a programming course can seem intimidating. How can you be sure the skills you are building on assignments will translate well to this new setting? We offer some sage advice based on our past experience.

Approaching an online assessment

The purpose of the diagnostic is to assess your ability to think logically and use appropriate problem-solving techniques. Regular assignments test your testing and debugging thoroughness, but on this assessment, we do not want you to worry about small syntax errors, typos, or compiler issues. In addition, unlike a compiler, our grading process can look beyond nit-picky details and evaluate the correctness of your problem-solving approach. For this reason, we strongly recommend not compiling or testing your code to avoid these issues becoming a distraction.

Although you'll be able to set up a Qt project to compile and run your code, we generally do not suggest it, and the files we give you will not be easily runnable (and in some cases, they'll be impossible to test and run). It is easy to lose time fussing with the details of syntax or to fall into a rathole trying to fix an edge case that was minor in the bigger picture, losing time to work on other problems. If you have leftover time at the end to double-check your work, you can consider using the compiler then, but we want to emphasize that running and testing your code is not necessary to be successful on the diagnostic.

Before the diagnostic

"Open resources" doesn't mean "Don't prep." The diagnostic is open-resource, and you can refer to lecture slides, the textbook, section problems, your assignment code, and so on. We don’t expect you to memorize minute details, and grading will not focus on them. However, this doesn’t mean you shouldn’t prepare. There won't be time during the diagnostic to learn material that you haven't already. To do well, you must be experienced at working through problems without needing to repeatedly refer to your resources.

Practice in simulated conditions. A good way to study for the programming problems is to take a problem (from lecture, section, textbook) and write out your solution under test-like conditions. This is much more valuable than a passive review of the problem and its solution, when it becomes too easy to conclude “ah yes, I would have done that,” only to find yourself adrift during the real diagnostic when there is no provided solution to guide you!

Get your questions answered. If there is a concept you’re a bit fuzzy on or you’d like to check your answer to a chapter exercise, or you wonder why a solution is written a particular way, get those questions answered before the diagnostic. Swing by the LaIR, come to office hours, or post on Ed, and we’re happy to help.

During the diagnostic

Scan all the problems first. Quickly peruse all questions before starting on any one. This allows you to “multitask”—as you are writing the more mundane parts of one answer, your mind can be brainstorming strategies or ideas for another problem in the background. You can also sketch out how to allocate your time between questions in the first pass.

Spend your time wisely. There are only a handful of questions, and each is worth a significant amount. Don’t get stuck on any particular problem. There is much opportunity for partial credit, so it’s better to make good efforts on all problems than to perfect one answer while leaving others untouched.

Style and decomposition are secondary to correctness. Unlike the assignments where we hold you to high standards in all areas, for a diagnostic, the correctness of the answers dominates the grading. Decomposition and style are thus somewhat de-emphasized. However, good design may make it easier for you to get the functionality correct and may require less code, which takes less time and provides fewer opportunities for error. Comments are never required unless specifically indicated by a problem. When a solution is incorrect, commenting may help us determine what you were trying to do when we attempt to give partial credit.

Pay attention to specific instructions. A problem statement may include detailed constraints and hints. These constraints are not intended to make things difficult; typically, we are trying to guide you in the direction of a more straightforward solution. If you disregard these instructions, you are likely to lose points, either for not meeting the problem specification and/or for errors introduced when attempting a convoluted alternative.

Syntax is not that important if it is clear what you mean. We won’t trouble you about most small syntax errors (forgetting semicolons or spaces, for example) as long as your intentions are clear. Having said that, beware that if your syntax errors cause ambiguity, we might not get the correct meaning. For example, if we see a for loop followed by two lines with no curly braces, where both lines are vaguely indented or a third line has been added in after the fact, we may be confused about what code is really inside your for loop.

Save a little time for checking your work. Before submitting your diagnostic, reserve a few minutes to go back over your work. Check for matching parameter names passed into functions, etc. We try not to deduct points for minor things if it is obvious what you meant, but sometimes it is difficult to decipher your true intention. You might save yourself a few lost points by tidying up the details at the end.

Miscellaneous Resources

Final Thoughts

Always remember why you are here! Your efforts to build practice skills and real understanding will take you a lot further than a pristine transcript. If you work hard toward mastery and feel good about your understanding of computer science that is an achievement to be proud of—regardless of how many points you get relative to the other students in the course.