• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

How should you approach code questions?

 
Ranch Hand
Posts: 40
1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Kathy and Bert,

How should you approach code questions?

As someone who has taken the newest version of the exam twice and failed, I realized one of my biggest issues was getting lost in the code. By the end of each exam, not only was I out of time without a chance to review any of the questions, I was physically exhausted. I felt like I really had no system for analyzing the code.

I've read accounts of programmers who have been writing Java for years not doing well on this exam. This is a luxury I don't currently posses; as I'm currently a university student with this being my 3rd and final Java course and certification being a requirement of passing and graduating. One might think, I would find solace in the fact that even experienced programmers can have difficulty with this exam but it's pretty demoralizing (not to mention expensive, considering Oracle doesn't discount the test for retakes) to fail this exam; especially after studying as hard as I have and still not improving my score from exam to exam.

Of all the accounts I've read, some people seem to score exceptionally well yet provide little feedback on how they approach a question (most only elaborate on the study materials they used).

When presented with code, I get quickly overwhelmed and I know I missed questions due overlooking errors that may have been obvious with a more systematic breakdown of the code. I also suspect that I got lost trying iterating through code that I didn't need to because it's meant as a distraction, not what the question is asking.

Of the two exams that I took, there were few if any questions that didn't involve reading code and knowing the output. Any insight you can provide is greatly appreciated.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

When I first started preparing for JP exam, I did find analyzing code snippets for question a bit tedious and time consuming. In fact it took me 3 tries to pass the JP exam.

Anyway, my approach these days is as follow: given your concepts are ground solid or 90%+

identify whether it's "what the output of the program" or "what code to insert on line XX"
go to the answer choices, see if there is a compilation error option or runtime error option
Glance the program getting a gist of what it is doing
See if you can identify any compilation or runtime error, if so, choose that option. If not sure

For output questions:
Take note of how different the answer choices are
Run the loop/System.out.println() snippet in your head, identify if some sort of pattern exist then choose the closest option to your own execution
Note: If your execution is WAY OFF from the answer choices, it means you did it wrong, but don't waste time re-executing, use that pattern you noticed and choose the closest answer

For insert code questions:
Take note of the answer choices, base on that some answers can be eliminated such as that class doesn't even exist in the API or the API is used incorrectly
Go back to the question and ask yourself if I plug this answer/code in does it make sense/compile/no runtime error
Note: able to compile DOES NOT mean there will be no runtime error


As always, when preparing for JP exams, practice practice practice. Writing more code will allow you to identify whether there is error in code snippet.

Hope this helps
 
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As K. Tsang said, practice is the answer.

But I can sense the stress and tension in your question. Its just a humble advice. Please don't mind. I feel, while studying/coding/practicing, if you can try to forget about passing/graduating and just concentrate calmly on the code, you will feel the change. The physical exhaustion is more due to the stress of passing/graduating. In the real exam, many feel the stress. The only way to not be overwhelmed is to be passionate about coding. Then you will enjoy. And what one enjoy becomes a play!!! I know it can be difficult in your situation. But there is no other way than to concentrate.

I hope you did not mind my advice. This one came from my personal experience.
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
About needing to pass the certification, since for Java 7 there are 2 certs: OCA and OCP.

OCA is indeed easier than OCP.

Which is required?
 
Brian Brumpton
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ K. Tsang - Thank you very much for sharing your approach to the questions. Your approach for the different types of questions makes a lot of sense to me. The test I have pass is the OCA.

@ Bindu Lakhanpal - I greatly appreciate your advice and you are correct about the stress and tension. I feel much more at ease now than I did with the previous two attempts but there is still a lot of anxiety centered around taking the exam. I am fascinated by code and enjoy the puzzles that problem solving with code produces. I have been more focused on slowing down this time through and really taking the time to play with the all elements of the Java code. I feel I'm grasping the concepts more concretely than before. Time will tell as I now start to study flow control and try/catch statements, and handling exceptions. Those are the bits that seem to really make code jump around and harder to follow. My second attempt at the exam seemed like it was riddled with try/catch and exception handling questions. Those were the most confusing to me and were concepts I didn't have much experience with.
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think I see what you are stressed about. It's not really the code because your concepts are just not up to par.

This applies to both OCA and OCP exams. If the concepts are not solid, you most likely end up having too many choices to consider because you can't eliminate them. You will fall into the trap of read choice A, ok then choice B make sense ... by the end all choices would be hmm every answer choice seem logically correct blablabla.

You get the idea.

You can fall into such trap/thinking even for questions with NO CODE snippets.

I shall not scare you any more. But understanding the concepts is key. Time management can be worked on later.

Oh for code snippet questions, the indentation can be horrible. You have been warned

Happy coding to learn
 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Brian,

Most of the successful candidates I hear from took a lot of practice exams. You didn't mention whether or not you've done that. We think this is an essential aspect of preparing. So essential that K & B 7 has more than 500 mock exam questions! And most successful candidates don't stop there - they find more mock exams to take.

Can you tell us how much time you've spent taking mock exams?
 
Brian Brumpton
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ Bert Bates - I did take practice exams. I purchased the Enthuware testing engine and questions. They have great support (especially for how little it costs) on their questions forum. Prior to my 2nd exam attempt, I focused heavily on the questions section by section until I could pass each section repeatedly. Obviously, it was not enough to get me on the level of achieving a passing score. Quite possibly, I ended up memorizing the answers to the questions instead of mastering the concepts of each.

I also felt a lot of the questions were written more for trickery than they were to test knowledge. To clarify that point, there were a lot syntax anomalies (ways you could write things in Java but wouldn't) that you wouldn't see from someone writing production level code. Someone who has written a lot of Java would surely be able to spot those; as for myself, I'm still trying to rack up enough experience compiling code to know Java front to back.

I say this, not to take anything away from Enthuware (Not passing the exam was certainly all on my lack of grasping the concepts), but as feedback on how I will use that resource the next time around. I think it's a tool best used near the end of your studies for testing your mastery of all topics combined, rather than reinforcing your knowledge of areas as you study.

Most certainly, mock exams will be a big part of my studies going forward and yours will be on my list.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Brian!

I passed the OCAJP 7 this spring, the older version. (Although my score should have been higher. That's another story.)
Whenever I really wanted to understand a concept, I'd read the corresponding section in the Sierra & Bates guide to the OCPJP 6. I am loving the new Sierra & Bates guide to OCA/OCP SE7 that just came out.

But if you are studying for OCAJP 7, you should hang out on: https://coderanch.com/forums/f-117/ocajp
They will have more OCA appropriate topics.

Good luck!
Andrea
 
Brian Brumpton
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ Andrea Black - Thanks for the advice. I was really wishing, during my last two attempts, that Sierra & Bates guide was available. Currently, I'm reading Mala Gupta's book again and working with her in a new Java 12 week Java mentoring program she is offering that takes you through the guide chapter by chapter. I also plan to pick up a copy of Kathy and Bert's latest prior to taking the exam again. I'd rather know more than I need to going in this time around than not enough.
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic