How to write code under pressure? College Online Exams

First year college CS student here, just wrote my second set of midterms and realize I have a problem… - I am way too slow to do well in these exams.

The exam format is generally something like:

  • 25-30 multiple choice questions - mostly debugging and booby trapped syntax stuff
  • 1 or 2 problems to solve - needing to write a working program. (20 - 30 minutes per problem)
  • everything is remote learn from home

I really enjoy the assignments and labs where I don’t have the time crunch. I take my time, make a coffee, map out different ideas, test them, and then write the code.

However on my exams I obviously dont have enough time to do this - I have to just start writing code, I have never been able to finish a problem in the time we have.

I feel like this has to be a skill that can be learned… and I would imagine interview questions would be a similar situation to what I’m struggling with now.

The obvious thing that comes up is to just drill problems like crazy before the exams… Is there anything else, like a different way of approaching this that I am missing?

Any advice appreciated!

Try timed leetcode/codewars problems and take notes after each session about how your time management went. (Do simple ones)

  • Did you lose time on big picture stuff?
  • Did you need extra familiarity with language specific methods?
  • Do you lose focus midway, and at what particular juncture?
  • What time of the day are you doing these exercises, when do you expect the exam to be? Eating a large meal before sometimes can make you drowsy. So it is good to be aware of your body and time of day. (As well as knowing how much to eat and hydrate during)

Also reading these forums is great debugging practice :slight_smile: . If you’re learning C++, java, or python, you should still be able to read a lot of beginner-level code in other languages (C#, javascript, php, swift) and find errors and get a sense of where common errors hide. It helps build intuition.

It is definitely a learnable skill and while drilling helps up to a point, it doesn’t help you as much long term if the method is inefficient… so it’s great that you’re looking out to improve this!

It also helps to work on mini-projects. This can build your sense of the toolkit of the language you’re working with and can often get you out of jams with quickfixes when you’re completely stuck.

9 Likes

Thank you! This is gold.

3 Likes