Sunday, 24 March 2013

How to prepare for the OCPJP 7 exam

One of the important questions you may have when you start preparing for the OCPJP 7 exam is how to go about preparing for the exam. In this post, we answer some of these questions in the form of an FAQ. We mainly focus on the OCPJP 7 exam (Oracle exam codes IZ0-804 and IZ0-805). Note that Chapter I in our OCPJP 7 book addresses many of these topics. 

1.   How long should I prepare before appearing for the exam? 

Short answer: Depending on your level of knowledge and experience in OCPJP 7 topics, it may take from 1 month to 6+ months.  

Long answer: Preparation time depends on your knowledge and experience in Java programming. If you have already cleared OCAJP 7 (Oracle Certified Associate Java Programmer 7) exam, or any of the older Java certifications such as SCJP, it usually takes 1 months to 6 months to prepare for the exam. 

Why does it take time to prepare for the OCPJP 7 exam? Because it is a reasonably difficult exam to crack! For instance, compared to SCJP 5 exam, OCPJP 7 exam is both "broader and deeper": OCPJP 7 covers more topics than SCJP 5 such as NIO.2 and java.util.concurrent utilities; questions asked in OCPJP 7 are more difficult than SCJP 5. 

If you have just cleared OCAJP 7 and plan to appear for OCPJP 7 exam, we would recommend you to spend at least 6 months to prepare for the exam (subject to individual preparation, experience, and available time). You need to spend quite a bit of time to prepare difficult topics such as generics, design patterns, multi-threading and concurrency utilities. 

Even if you are an experienced Java programmer, you may not have exposure to certain topics that are covered in OCPJP 7. For example, if you have never written any code for localization (aka internationalization), then you'll need to prepare on this topic before appearing for the exam. Another possibility is that you may not have exposure to Java 7 features such as try-with-resources statement, diamond syntax in generics, and switch based on strings. Java 7 also has API changes for JDBC, NIO, concurrency utilities, etc. 

Remember that OCPJP 7 exam covers corner cases, unusual aspects and tricky aspects in language features and APIs. So, you'll need to brush-up on difficult topics such as semantics of multi-threading and unusual aspects involved in generics. 

OCPJP 7 exam tests your knowledge and understanding of Java language and library and does not test how well you can memorize things. However, there are certain aspects in OCPJP 7 exam will require you to remember such as format strings (in printf), regular expression syntax, glob syntax (in NIO.2), and format strings for creating custom locales. These topics require preparation, and if you ignore our warning and go ahead to take the exam without any preparation,  then you'll not be able to confidently answer many questions in OCPJP 7 exam. 

If you're ready to throw $300 in dustbin, then do appear for OCPJP 7 exam without any preparation whatsoever! Or a more sensible thing: transfer those dollars to our bank account and we'll gladly accept that ;-)   

Bottom line: No matter how experienced you are in Java, it is unlikely that you'll crack the exam without any preparation!  

2. How should go about preparing for the exam? 

Of course, the first thing we would suggest is to buy our book and read it :-) 

The second thing we suggest is to not to stop preparation with reading our book! Don't get us wrong - the book covers all the topics to the required breadth and depth, but OCPJP 7 is not an easy exam and there is more you need to do to be confident of clearing the exam. What the book provides you is knowledge needed to appear for the exam, but to crack the exam, you need to understand and internalize the concepts! How to achieve that? 

The key to cracking OCPJP 7 exam is to code, code, and code! It is through hands-on programming that you'll really get to understand and internalize the concepts. For example, reading about differences between nested, inner, and anonymous classes is only the first step; more important thing is to really get an intuitive understanding on what these differences are and know the nitty-gritty details of the differences between these variants. The way to achieve it is through writing code. If you don't have good opportunities to learn Java as part of your work, you can try some toy projects.  

Also, there are always topics that you would feel you require more preparation. For example, if you have not done any JDBC programming before, you may want to read more about it. A very good resource for further reading is Oracle's Java tutorial. Specifically, for OCPJP 7 preparation read the topics related to this exam in Oracle's tutorial.

It is important to focus on the exam topics especially if you are pressed for time. For this reason, reading general Java tutorial books or references is not a good idea for exam preparation when your exam dates are close by. Why? In general reading general Java tutorials or references is good, but Java is vast and there are just too many topics to read and learn. You're likely to get lost in ocean of details without getting into required depth in topics relevant to OCPJP 7. For example, java.util.concurrent utilities are not covered well in most Java books meant for general reading; however, OCPJP 7 requires you to have considerable knowledge in these utilities. Also, many topics that are covered in detail are simply irrelevant for OCPJP 7 exam, such as Swing or AWT programming, Network programming, JavaBeans, Security, RMI, and Reflection. 

3. Which topics should I focus for effective OCPJP 7 exam preparation? 

Focus especially on Java 7 features, focus on topics that are difficult in general for most OCPJP 7 exam takers, and focus on topics that are difficult to you. 

OCPJP 7 has special focus on Java 7 exam topics. As we have already mentioned, these are topics such as try-with-resources, precise rethrow, diamond syntax, binary literals, and switch for strings in addition to API changes in JDBC, NIO.2, etc. From our experience taking the exam, we found a larger share of questions from this topic (one possibility for disproportionate number of questions on Java 7 is that Oracle's question bank for IZ0-804 exam and IZ0-805 exam are shared!). Since you're likely to get a significant number of questions on Java 7 topics, better be prepared for it.  

In general, certain OCPJP 7 topics are difficult for most OCPJP 7 exam takers, such as design patterns, generics and concurrency utilities. So, we would recommend you to prepare well for these topics.

You may not have exposure to some specific topics in OCPJP 7, such as IO fundamentals and NIO.2, JDBC, localization, or multi-threading. Naturally, you have to prepare more for these topics.  

How do you know what specific topics to prepare for? 

A qualitative (and naive approach that is likely to work) is to rate yourself on each exam topic in the scale of 0 to 10 where 0 stands for no knowledge, and 10 stands for very good knowledge. Order the topics in ascending order and now you have a prioritized list of topics to prepare. 

A quantitative (and more grounded approach that works for sure) is to take one or two sample tests, and create a prioritized list of topics based on the topics based on your score. This is the approach we have recommended in the pre-test (Chapter II) in our book. 
  
4. Do you have any insights gained for effective OCPJP 7 exam preparation?  

Yes! During our exam preparation, taking the exam, and writing the book we had a few "Aha!" moments where we got some insights that could help you in effective preparation for cracking the OCPJP 7 exam!

Our first insight is about kind of exam questions in OCPJP 7 exam. Reflecting on our experience in taking the exam, we realized that specific OCPJP 7 exam topics had more conceptual questions, and few other specific exam topics had more programming-based questions. Immediately after taking our exams, we started working on preparing the mock tests. While trying to coming-up with questions, we found that it is easier to come up with conceptual questions for certain topics and natural to come up with programming questions for certain topics! 

We'll illustrate this with two simple examples. For the exam sub-topics such as "Develop code that implements "is-a" and/or "has-a" relationship" and "Define the layout of the JDBC API", it is easier to ask or create conceptual questions. Now consider these two sub-topics: "Use java.util.concurrent collections" and "Search, parse, and replace strings by using regular expressions, using expression patterns for matching limited to: . (dot), * (star), + (plus), ?, \d, \D, \s, \S, \w, \W, \b. \B, [], ()." For these two topics, asking programming questions is easy!   

This experience was in sync with our experience taking the exam! In general, "Object-Oriented Design Principles" is the topic in which you're likely to get almost all questions to be conceptual questions, whereas "String Processing" is a topic where you're likely to get almost all the questions to be programming-based questions. As you can see, for top-level topics it is difficult to make such a distinction, but for sub-topics it is easy to make such differentiation. 

So what does this insight help you in exam preparation? When you look for a sub-topic, just think what kind of questions you're likely to get - and prepare based on that! 

Our second insight is about the distribution of the questions within and across exam topics. When we started, we somehow assumed that the questions will be equally distributed across all the exam topics (e.g., equally distributed among 12 topics in  IZ0-804). However, when taking our exam we realized that there are more questions in certain topics than others topics! In other words, questions are not equally distributed among exam topics. If you look at Oracle's website for OCPJP exam, it is mentioned nowhere that exam questions will be equally distributed among the exam topics (if you saw, please let us know!). 

When preparing mock tests, we realized that it is easier to create questions on topics such as regular expressions and collections, but difficult to create questions in topics such as design patterns, and sub-topics such as "Watch a directory for changes by using WatchService" and "Create custom exceptions". For example, we didn't get any questions on "custom exceptions" when we took the exam, but got quite a few programming-based questions on regular expressions, glob in NIO.2, custom date and time formats in locales.    

So, what does this insight help you when you prepare for the exam? Just think what kind of questions can one create for an exam topic. If it is difficult for you to mentally create possible questions on an exam topic, it is likely that you may not get such questions in the exam!  

Our third insight is on ambiguous questions. When we prepared for the exam and created mock-test (Chapter II in our book), we somehow assumed that the questions in actual exam would be unambiguous, completely self-descriptive or self-contained. However, when we took the exam, it wasn't so: some questions were ambiguous, not so self-descriptive that we had to assume some context, or imagine some missing aspects that the person who had created the exam assumed. Surprising but true! Since we wanted our mock tests (appendix II and III in our book) to be as close to the exam taking experience as possible, we designed our mock tests the same way. Of course, the downside of the approach we have taken is that readers (i.e., you) may complain that we have not done a good job, but that's a conscious risk we took! 

So, what does this insight help you when you prepare for the exam? Don't naively assume that the exam questions will be perfect, unambiguous, or completely free of the possibility for subjective interpretation. If you have that assumption before you go to take the exam, you may be frustrated when you don't find that "perfect exam" that you imagined. When you prepare for the exam with an understanding that questions may not be "perfect", that allows you for more effective exam preparation - you'll be prepared to do some guesswork during the actual exam! 
  
Our last insight is on writing sample code for exam preparation. During our exam preparation as well as writing the book, we used both Eclipse IDE as well as command-line for trying out sample programs. And we noticed something interesting: We got better understanding of certain language and API details when we used command-line than when using GUI! That's unusual, right, but why? 

One reason is that when we made mistakes in the program code, it took more time for us to realize that there was a compiler error (since edit-compile-reedit takes longer when working in command-line). Eclipse would immediately identify the mistake and high-light warnings and errors, and so we would immediately fix them without giving considerable thought to it. Since exam preparation is more about understanding than productivity, we started using command-line more than IDE. 

Another reason why using command-line works better than using an IDE is this: without help from IDE in showing the methods, or the arguments, or the type of the arguments, we had to more carefully remember, look-up, or understand the API documentation. Eclipse makes us lazy about learning and remembering API method details. Understanding and remembering key API details is especially important from exam perspective. 

There are few more reasons, such as being more careful and attentive while writing code (since its more time consuming when we make mistakes) which we don't discuss here, and if you think about it, it is easy to understand why.

One last point: We found javac's -Xprint option to be especially useful. For example, we always get confused about exact differences between Comparator and Comparable, Runnable and Callable, etc. When in doubt we would quickly type them in console to recollect the differences. For example: 

$ javac -Xprint java.lang.Comparable
package java.lang;

public interface Comparable<T> {
  int compareTo(T arg0);
}

$ javac -Xprint java.util.Comparator
package java.util;

public interface Comparator<T> {

  int compare(T arg0,
    T arg1);

  boolean equals(java.lang.Object arg0);
}
$

That's quite handy instead of looking up in Eclipse or Java documentation, right? 

Don't get us wrong: We are not against Eclipse or any other IDE. What we are just saying is that we found using command-line especially useful from exam perspective. So, if you're using only an IDE consider using command-line.  

So, what does this insight help you when you prepare for the exam? If you use command-line for trying out sample programs for exam preparation, you're likely to be more attentive during the exam, get better knowledge and understanding of APIs, which will improve your chances of cracking the exam! 

Got any questions? Feel free to post your question as a comment to this blog post. 

No comments:

Post a Comment

Post a Comment