more MCQ questions on coreJava skills #GregR

You can find sample MCQ questions in Brainbench, Select2perform and IKM. Let me know if you want me to help you review and select some good questions — not obscure, not ambiguous…

Below are my own inventions, including those I sent before. (So you can discard the last mail.)

For candidates — Please pick the most likely answer for the most typical case, even if the question is not 100% clear. You can ignore corner cases.

  • Q1: which command produces java bytecode [correct answer is marked with *]
    • A) java (lower case)
    • B) * javac (lower case)
    • C) jar (lower case)
    • D) jvm (lower case)
    • E) None of the above
  • Q1b: which command executes the bytecode
  • Q1c: which command is the java debugger
  • Q1d: which command could launch the JVM
    Q1e: which command can read but not execute java bytecode
  • Q2: which among these is a modifier on a class
    • A) finally
    • B) finalize
    • C) * final
  • Q2b: which is actually the name of a well-known method? [B]
  • Q2c: which is a keyword only used inside methods? [A]
  • Q3: which keywords are legal for a method? (multiple correct answers)
    • A) * synchronized
    • B) virtual
    • C) * final
    • D) mutable
    • E) * abstract
    • F) const
    • G) override
    • H) deprecated
    • I) volatile
    • J) atomic
  • Q3b: which keyword is related to concurrency (all lower case, multiple correct answers) [ A/I ]
  • Q3c: which ones are not java language keywords [Advanced question. B/D/F/G/H/J]
  • Q4: do I need at least one “import” to use basic java threads? [Answer is no]
  • Q4b: how about java collections?
  • Q4c: how about java generics, assuming I avoid generic collections
  • Q5: if your java app creates no thread, will there be any other thread beside the main thread, in a typical java app? [Answer is yes]
  • Q11: if I have a typical java application’s bytecode compiled under 32-bit, can I use it in a 64-bit JVM?
    • A) * Usually yes, sometimes with minor changes.
    • B) Usually no, as it requires recompilation under 64-bit
  • Q11b: how much more memory can the 64-bit java use compared to 32-bit, in theory?
    • A) About double
    • B) * Much, much more
    • C) About the same.
  • Q11c: how much faster will the 64-bit jvm run that same bytecode, compared to the 32-bit jvm, assuming it needs minimal memory? [Advanced]
    • A) about double or higher
    • B) much, much faster
    • C) * About the same
  • Q12: which download has more content — jdk or jre? [ answer is jdk]
  • Q13: does garbage collection slow down a typical java server on a single-processor machine?
    • A) yes. Clearly Noticeable and very significant
    • B) * slightly
    • C) Should have no impact
  • Q13b: what if the app uses very little memory? [Answer is C]
  • Q13c: what if the app creates a huge amount of short-lived objects? [Advanced. Answer is B]
  • Q13d: what if the app creates a fair but not excessive amount of long-lived objects? [Advanced. Answer is B]
  • Q14: have you used any java debuggers? If yes, can you see the content of protected fields?
  • Q14b: can you see the content of protected static fields?
  • Q14c: can you modify its value using the debugger? [Advanced question. answer is yes]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s