var var = "var" (1/2)

var var = "var" (1/2)

My Bumpy Road To Java OCP Certification

This is part one of a two-part blog post series. Find the second part here.

I recently passed the Oracle Certified Professional (OCP) exam for Java 11. Since it was not easy to get there, I'd like to share the mistakes I've made and how I eventually succeeded.

Some Background

I am kind of a "middle" person: middle-aged, middle intelligent, but highly motivated to learn new things. In the distant past, I worked in networks and application operations. During the last decade, I more and more became a coding person. I have a self-taught history of Perl, Python, C and Java. I've learned most of these languages on the job, supported by books, colleagues, and stackoverflow. This blog post is about the last one on this list, Java.

Progress from Forest and meadows Java

About two years back, I claimed to have forest and meadows (German: Wald- und Wiesen) Java knowledge. I meant that I had used Java to implement two microservices and roughly knew my way around the language. Still, I often found myself looking up basic language concepts. A thorough introduction to the language was missing, which would glue together my knowledge pieces. Ideally, this introduction should consider that I wasn't new to coding.

Puzzle Pieces

Photo by Markus Winkler on Unsplash

OCP Certification For A Solid Foundation

For that purpose, a colleague suggested that I prepare for the Oracle Certified Professional Java Programmer (OCP) certification. I did some certifications back in the network days and always learned a lot, so I instantly liked the idea.

A look at the certificate overview sounded promising:

Candidates who hold this certification have demonstrated proficiency in Java (Standard Edition) software development recognized by a wide range of world-wide industries. They have also exhibited thorough and broad knowledge of the Java programming language, coding practices and utilization of new features incorporated into Java SE 11.

By passing the required exam, a certified individual proves tremendous fluency in Java SE and acquisition of the valuable professional skills required to be a Java software developer. This includes a deep understanding of object-orientation, functional programming through lambda expressions and streams, and modularity.

Yeah - this should be me! I started preparing almost instantly. I did not know back then that this was the beginning of a nearly 10-month journey containing ups and down.

Failing

After preparing for some weeks, I booked the exam and unfortunately failed. This was sad but not unexpected (see below). I returned to study with even more dedication. After a while, I felt confident enough to sit the exam a second time. What a mistake! I failed once again, which caused disappointment, frustration, and self-doubt.

Failing Photo by arash payam on Unsplash

To cheer you up: I then changed my preparation strategy and passed the next time. However, before continuing, I'd like to share what I believe went wrong:

Too early

For the first exam, I used Oracle's special Java anniversary offer. There, the exam fee was 25$ instead of the usual 248$. Since that offer was limited, I could not wait any longer and decided to give it a shot. However, in terms of preparation, I felt that I wasn't there yet.

Learning: Only book the exam when you feel prepared. Otherwise, you feel miserable for no reason.

Too confident

We had some excellent Java developers at work, mostly with +10 years of experience. Some of them did previous versions of the OCP exam and had no real difficulties passing. I was under the assumption that "if I just throw in some more weeks' preparation", I could do it as easy as they did.

Learning: Deep experience in a particular field takes years. This can't be compensated by "just throwing in some extra preparation weeks". If you like to see where you are at, look for people in the same situation.

Wrong book

This one is an example of how rushing leads to small mistakes with significant consequences in the long run. When I started with the exam preparation, the former two exams for OCP, 1Z0-815 and 1Z0-816, were merged into a joint one named 1Z0-819. When I bought the study guide, these three books were available:

  1. OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide(exam 1Z0-815)
  2. OCP Oracle Certified Professional Java SE 11 Programmer II Study Guide(exam 1Z0-816 plus upgrade exam)
  3. OCP Oracle Certified Professional Java SE 11 Developer Complete Study Guide (covers the previous two guides)

The books look very similar. Only the title is different. Probably in a rush, I've ordered the "Programmer II Study Guide" (the 2nd one) and used it for all of my further studying. The consequence was that I did not prepare for things covered in the "Programmer I" study guide, which was roughly 50 % of the topics 🙁.

Learning: Take time to plan your certification. Don't rush. In terms of study guides, you either need "Programmer I" and "Programmer II" or the "Complete Study Guide" (the third one on the list). To minimize confusion, I recommend the latter.

Note: When writing this post, the OCP exam for Java 17 was in the making, the relevant study guide was already announced

Pressure

Since I was optimistic about getting certified soon, I accepted to have the Java certification as a quarterly goal at work. When I failed the second time, this pressured me a lot.

Learning: Try to avoid the certification as an official work goal. If you are dedicated to achieving the certification, extra pressure is not needed. If your manager wants to be formal (e.g. if you also prepare during work time), try to make the certification a long term goal and be transparent about your progress.

Taking The Online Exam

Due to COVID I had to take the first exam online. Pearson VUE calls this "OnVUE". You run their software on your computer. During the exam, you are monitored via your webcam.

This setup sounds convenient. The issue is that taking notes during the exam is prohibited. I assume this rule exists to avoid stealing exam questions. However, many OCP exam questions require you the "head-execute" a piece of code. For some, you need to keep track of multiple variables, e.g. in a nested for loop. Without pen and paper, these questions are unnecessarily complicated.

Learning: Take the exam at a real-world test centre. There you are provided with an A4 whiteboard for note-taking.

Enthuware And "Let's Get Certified" As The Winning Team

After all that misery, here is your happy end 😉. To re-charge, I took some timeout from certification and after that investigated what other people did to pass the OCP exam. A common choice seemed to be an exam simulator, so I decided to buy the corresponding Enthuware product. These were the best 10$ spent throughout my entire certification effort.

The simulator provides 16 mock exams plus three so-called "last day" exams that mimic an actual exam. They are even a bit tougher since they require you to answer around 55 questions in roughly 97 minutes compared to the 50 questions in 90 minutes in the actual exam. After finishing an exam, you get a passing score and step through the questions and the expected answers. Almost all of the questions contain detailed explanations, which I found very valuable.

example enthuware question Example question of the Enthuware exam simulator providing detailed answers

Additionally, some answers link to a video explanation by Dr Seán Kennedy. His gentle and calm way to express things is remarkable and was a clear highlight in the ups and downs of my preparation. Thank you, Seán!

screenshot Let's Get Certified Video Screenshot of a Let's Get Certified Video

Disclaimer: I am not related to Enthuware in any way. The tool just helped me a lot.

Working With The Exam Simulator

When I started practising with mock exams, my first results were between 50 % - 60 %. Some months later, one day before the actual exam, I scored an average of 80 %. I got there by tackling every single exam with the following routine:

  1. go through my notes and recap (60 min)
  2. take the mock exam (~ 90 min)
  3. revisit the questions, study the answers (also the correct ones since sometimes you score by accident) (90 min - 120 min)

I tried to do 1) and 2) together (e.g. in the morning) and 3) whenever there was time.

Passing

When I felt ready, I booked the exam. My last preparation were the three remaining "last day" tests. On average, I there scored 80 %, which made me feel confident.

On exam day, I took a long walk to the test centre, did some breathing exercises and started to work on the questions without being too nervous. I also expected to score around 80 % and was surprised to see my passing score of 71 %. Enough to get through anyway - it was over 😌.

My OCP Certification Algorithm

The road towards the OCP certification was a bumpy one. If I turned back time, I would not choose a certification as a learning path for Java again. Instead, I would look for something more hands-on and applied. See my separate post for more details.

If I had to do it again, here is how I would go forward:

  1. Buy the OCP Oracle Certified Professional Java SE 11 Developer Complete Study Guide and work it through. Try to answer the questions at the end of each chapter.
  2. Buy the Enthuware mock exams and train until you reach 80 % on average.
  3. Go and sit the exam

Time Effort

How much preparation time you can fork off depends on your personal situation. In my case, this is a family, a 40 h workweek and extra duties due to COVID and homeschooling.

My employer offered me to use "a few hours" per week for preparation which I, depending on the workload, sometimes used more and sometimes less. The rest of the time was private time.

Roughly, I had three studying phases:

  1. Majority of the preparation time: 6 h - 8 h per week
  2. Last two weeks: 10 h - 12 h per week
  3. Last three days: full time

Overall, the OCP certification kept me busy for almost ten months.

Learning Tools

I tried a couple of setups for note-taking and coding experiments, including a Jupyther notebook with a Java kernel.

However, taking purely digital notes never worked for me. I think with the pen and like to have the freedom to scribble.

index cards and notebooks Index cards and notebooks were my main learning tools

Here is the setup I've ended up with:

  • index cards to capture specific topics (thank you again Seán, for this tip)
  • analogue notebook for thoughts and insights that are not ready yet for an index card
  • the jshell to interactively experiment with code (see Appendix section)

Wrapping Up

Thank you for making it down here. Although I am proud that I've finally made it, I would not recommend the OCP exam as a learning path to someone else. If you are interested in the "Why", continue reading here.

However, if you plan to take the exam, I hope this post helps you avoid my mistakes and learn more effectively.

Appendix - Talk to Java With The Jshell

Since Java version 9, there has been an interactive language prompt (aka a REPL) called jshell. I used it a lot, and I can highly recommend it. If you are new to the jshell I suggest going through the user's guide. You might also find the following tips useful:

println alias

When you invoke jshell with the PRINTING argument, the usual print methods are available at top level:

 $ jshell PRINTING
|  Welcome to JShell -- Version 17.0.2
|  For an introduction type: /help intro

jshell> println("hi")
hi

This saves you from countless typing the System.out prefix.

Auto-Indent

Somewhen between Java 11 and Java 17, jshell learned to auto-indent code:

➜  ~ jshell
|  Welcome to JShell -- Version 17.0.2
|  For an introduction type: /help intro

jshell> class Foo {      
   ...>     int bar;     // cursor got auto-indented with 4 spaces
   ...> }                // when typing '}', the character is automatically 
                         // moved to the beginning of the line

Although a minor thing, I found those visual aids helpful.