Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to do exercises fast

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
I've always had a glance here and there in this Saloon.
I'm very interested in everything about Java since university,
and now that I'm preparing for the OCP6 exam I feel the time
has come to click on the 'register' button

I'm studying on the K&B for a few months now. I can say I've
got almost everything of it about theory, but for some reason
some exercises found in K&B and OCP6 Practice Exams
definitely take too much time to complete.
I grouped them in a few categories:

1. exercises that show you an internet of references to objects
and ask you how many of them become eligible for GC
and/or how many of them are still referenceable; personally
I've always found myself tracking refs with pen and paper, but
I guess I'll be dead if the test center won't provide them...

2. exercises with threads, of the type that you can't do by just
relying on theory and figuring out what the code does, but
also have to consider thread interleaving and other possible
runtime behavior

3. exercises that test you on 2~3 nested for/while loops with 3
counters and break/continue and the like...I try to do them
last, but this does not change the time it takes to give the

4. exercises that make your head pop with an internet of, I LOVE generics (i'm serious), since I started
learning on Java5... and I know the theory, but I still have
problems when tackling these exercises.

What are you doing/have done to actually become faster in
reading/parsing code in these exercises ?
Please help me. I'm not discouraged even a bit, I'm just trying
to figure out what I'm doing wrong...and since a few months
have passed and the OCP7 beta is out, I hope to pass before the
OCP6 becomes totally old.
Posts: 1847
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi and welcome to the Ranch!

Whenever I give my dad pointers on taking tests, I try to de-emphasize speed. Why is that?
Speed will kill you.

But, that said, it's important to stay within the timeframes of the test, right?

Here are my pointers:
1. Know how to read the questions so that you can identify WHAT KIND of question it is quickly. This is key. You'll see questions that reference threads and generics and garbage collection, but the question itself doesn't care about those things... it's focusing on a type of Collection. You can waste all sorts of time if you can't decipher quickly what the question is about.
2. Once you know what the question is about, you should have a list in your head of what goes on with the subject matter, what you're familliar with, and what you know you trip up on.

Most questions on the real exam shouldn't take you more than two minutes to read, decipher, and select an answer. The K&B questions are WAY harder than the actual exam. I used Enthuware and found that there was a good mix... more representative of what's on the real test. Of course you should study the way hard questions, but remember that the exam typically tells you how many answers to select... and most questions aren't loaded up with a ton of code or nuances to figure out.

There's a couple more pointers here to mention...
You should know what your strong and weak points are. You should be able to identify during the exam if something is going to trip you up and know it's ok to spend more time on it.
Some folks go through the exam more than once... getting all the easy picks the first time through, then going back for the harder ones. I keep count of ones I know are right during cert exams... then relax a bit more once I know I'll pass.
I find that descriptions/answers to other questions can give you a tip on a question you're stuck on. During the real, timed exam... if you don't know an answer... mark it and go back. Don't sabotage yourself by trying to get all the questions right.

Above all, precision is more important than speed!

Posts: 1558
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pierluigi,

First things first : go through Sierra & Bates book for SCJP. There, you'll find basics about how to track object during GC question etc. and other tips about threading, generics etc.

Now, about your doubts:

1. For GC questions, keep track of objects getting out of scope - e.g. if an object, or its parent is being set to null etc. or there is cyclic dependency among objects. I myself have given 3 certification exams and the exam center provided me blank sheets, pen, a small 10x12 inches white-board, marker-pen and wiping cloth - each time - and without asking (they provided this to me even for OCMJD essay exam ). So, I don't think this should be an issue. Exam center will at least provide you blank paper sheets and pen/pencil(in worst case, you'll have to ask for it). Only thing is - you have to leave it there (i.e. you cannot carry your rough work out of exam hall).

2.For threading, check out if threads end with any specific order, or are dependent on each other. Also check about synchronization i.e. on which object the lock is obtained and how it is being released etc.

3. Problems with 2-3 for/while loops - paper work is the most efficient way. My personal experience is - most of the time - complex problems like 2-3 nested loops are about compile time error. At least I never saw such problems on real exam.

4. Once you understand theory of generics and rules like where it is allowed to insert element in structure, where one has to do explicit casting, what is meaning of <? extends classname> syntax, then I guess you are good to go here.

Most importantly, as Janeice said, one must be able to identify the real question. It is very much possible that in a question having 5 threads manipulating some data structure, threds were not started by calling start method, but run method, and hence that is sequential execution, not parallel. Or a tough code snippet about generics is failing during compilation since a variable declared in for loop is accessed outside the loop etc.

And yes, you have around 3 minutes per question, which is more than sufficient time. So, try to be accurate, and don't make a prestige issue about any question (i.e. if it is taking more than 3 minutes, move on to next question). Once you increase the accuracy, timing will follow automatically. There's no point in being very fast but inaccurate.

All the best.
Pierluigi Di Giacomo
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Janeice and Anayonkar, thanks for your advices!! They helped me
fix some wrong approaches to various types of questions.

Do you think it's better to go on with the mocks from the OCP6
Practice Exams book and then move to those provided by Enthuware,
or vice versa ?
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic