Sr. Java Developer

26 Questions | Attempts: 150
Share

SettingsSettingsSettings
Java Quizzes & Trivia

This quiz contains questions targeted to assess knowledge of a wide range of topics. Knowledge areas include architecture, design and Java language specifics.


Questions and Answers
  • 1. 

    PSI Services, Inc. uses ABC Corporation to print assessment booklets. When the inventory of booklets falls under the reorder level, PSI communicates with ABC via faxes. PSI now wants to build an automated solution. ABC uses a legacy system that supports CORBA interfaces for other companies to interface to them with. ABC's servers are protected by firewalls and will only let HTTP or HTTPS requests through. What is PSI's best option here?

    • A.

      Since ABC will not let CORBA requests through, PSI should continue sending faxes.

    • B.

      PSI should take its business away to ABC's competitors.

    • C.

      PSI should use the popular SOAP protocol since SOAP requests communicate over HTTP.

    • D.

      PSI should use a concept called HTTP tunneling to communicate with ABC.

    Correct Answer
    D. PSI should use a concept called HTTP tunneling to communicate with ABC.
  • 2. 

    "candidate.psiexams.com" is the site where license seekers can register and schedule to take required assessments. One of the exams offered on "candidate.psiexams.com" is "Texas Cosmetology" exam. Candidates who want to register for this exam can select the following portions: Available National Portions: Barber, Nail Technician, Cosmetologist Available State Portions: Barber, Nail Technician, InstructorAvailable Practical Portions: Hair cutting, Permanent Tattooing, Facial TherapyIf exam can only have exactly 1 National portion, 1 State portion and 1 Practical portion, what pattern would be best used here?

    • A.

      Factory Method

    • B.

      Prototype

    • C.

      Builder

    • D.

      Abstract Factory

    • E.

      Singleton

    Correct Answer
    C. Builder
  • 3. 

    When remote calls are made on the container provided implementations of the EJBHome and EJBObject, various transactional and security checks are applied before the call is actually passed on to the bean instance. The Container provided implementations of EJBHome and EJBObject are performing what Design Pattern's task?

    • A.

      Command

    • B.

      Bridge

    • C.

      Facade

    • D.

      Adapter

    • E.

      Decorator

    Correct Answer
    E. Decorator
  • 4. 

    PSI is creating a new e-front for candidate registration and scheduling. Candidates have to create an account to transact with PSI, although an account is not required for browsing the catalog. Candidates can browse exams and add them to a their "license" cart. They can then proceed to registration and scheduling. At this time, they can update details and submit the order. What technologies may be best suited for this application? a. JSP for presentation and Servlets as controllers. b. Servlets for presentation and JSP as controller. c. Stateless Session Bean for License cart. d. Stateless session bean for catalog retrieval. e. Stateful Session bean for shopping cart. f. Stateful session bean for Order update. g. JPA Entity bean for Catalog retrieval. h. JPA Entity bean for Order update.

    • A.

      D, E, & G

    • B.

      A, D, E & H

    • C.

      A, B, E & H

    • D.

      B, E, F & G

    Correct Answer
    B. A, D, E & H
  • 5. 

    Which of the following statements about 'Not Supported' and 'Never' transactional attributes are true? a. 'Not Supported' suspends any transaction until the method is completed whereas 'Never' throws a RemoteException when called with a transaction. b. 'Never' suspends any transaction until the method is completed whereas 'Not Supported' throws a RemoteException. c. If the method is called without any transactional scope, both attributes will work identically. d. If the method is called with a transactional scope, both attributes will work identically.

    • A.

      A Only

    • B.

      A & C

    • C.

      C Only

    • D.

      None of the Above

    Correct Answer
    B. A & C
  • 6. 

    What are the benefits of resource (bean, connection, thread, etc) pooling? a. Resource instances are created during startup, thus avoiding the expense of creation, each time a client requests it. b. Resource pooling allows load distribution over several machines. c. Resource pooling is the container's way of balancing load - moving future requests from client to a different machine, if load increases are encountered. d. Allows a container to use resources as flyweights.

    • A.

      A & D

    • B.

      A & B

    • C.

      C & D

    • D.

      B & D

    Correct Answer
    A. A & D
  • 7. 

    PSI is building a new test delivery engine which will be deployed on workstations at PSI's test centers. They are implementing the solution via applets for richer GUI capabilities. New test delivery applet requires a Java 1.6 Plug in as well as read permission to read cached data from a temporary directory on the host where it's being executed. Is the applet technology viable for this application?

    • A.

      The applet technology is not viable because the sandbox model prevents them from reading or writing to the host where they are executed.

    • B.

      The applet technology is a viable solution because the security policy of the Java 2 Platform is totally flexible.

    Correct Answer
    B. The applet technology is a viable solution because the security policy of the Java 2 Platform is totally flexible.
  • 8. 

    In the Publish subscribe messaging architecture, publishers send messages to:

    • A.

      A specified node, which is then re-distributed to all subscribers.

    • B.

      A designated queue.

    • C.

      Directly to all subscribers in the Topic subscription list.

    • D.

      A component transaction monitor such as an EJB Server for further processing by a message driven bean.

    Correct Answer
    A. A specified node, which is then re-distributed to all subscribers.
  • 9. 

    PSI's "Provider" site has been running smoothly in a production environment for over a year. Due to recently on-boarded clients, site have started to experience three times the volume of normal traffic. PSI architect has suggested that a round robin load distribution mechanism be employed to cope with the issue. How is DNS round robin going to be helpful in this situation?

    • A.

      Splitting requests evenly amongst all back end servers.

    • B.

      The proxy sits behind the backend servers monitoring the performance of each one. When it notices one is being used too much it will automatically forward requests to a different server.

    • C.

      Time each server has available.

    • D.

      A technique used to target certain requests to certain backend servers, e.g. All Servlet requests from one server and all static HTML from another.

    Correct Answer
    A. Splitting requests evenly amongst all back end servers.
  • 10. 

    PSI wishes to add new functionality to their existing data export system and has contracted you as the lead architect for the project. The legacy system has been written in FoxPro. They wish to keep this system running and may switch over to a full Java solution later, depending on the performance of the new functionality. So how will new functionality connect to this legacy system?

    • A.

      Wrap the application using JNI and make it accessible using RMI.

    • B.

      Rewrite the FoxPro code in Java. This shouldn't be too hard because it's converting from one object-orientated language to another.

    • C.

      Use a screen scraper.

    • D.

      Use CORBA to talk to the FoxPro program then get the CORBA to talk to the RMI server.

    Correct Answer
    A. Wrap the application using JNI and make it accessible using RMI.
  • 11. 

    How can you force garbage collection of an object?

    • A.

      Garbage collection cannot be forced.

    • B.

      Call System.gc().

    • C.

      Call System.gc() passing in a reference to the object to be garbage collected.

    • D.

      Call Runtime.gc().

    • E.

      Set all references to the object to new values(null, for example).

    Correct Answer
    A. Garbage collection cannot be forced.
  • 12. 

    Consider these classes, defined in separate source files, public class Test1{          public float aMethod(float a, float b) throws IOException{    }}1.    public class Test2 extends Test1{2.3.   }           Which of the following methods would be legal at line 2 in class Test2?

    • A.

      Float aMethod(float a, float b){}

    • B.

      Public int aMethod(int a, int b) throws Exception{ }

    • C.

      Public float aMethod(float a, float b) throws Exception{ }

    • D.

      Public float aMethod(float p, float q){ }

    Correct Answer(s)
    B. Public int aMethod(int a, int b) throws Exception{ }
    D. Public float aMethod(float p, float q){ }
  • 13. 

    In Java, an abstract class cannot be sub-classed.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
  • 14. 

    What is the name of collection interface used to maintain unique elements?

    • A.

      Set

    • B.

      List

    • C.

      Tree

    • D.

      SortedMap

    • E.

      ArrayList

    Correct Answer
    A. Set
  • 15. 

    What is the optput of this code fragment.1.      int x=3; int y =10; 2.      System.out.println(y%x);

    • A.

      0

    • B.

      1

    • C.

      2

    • D.

      3

    Correct Answer
    B. 1
  • 16. 

    Which of the following can legally be inserted into an interface?

    • A.

      Public static String getPostCode();

    • B.

      Public abstract String getName();

    • C.

      Private String getAverageHousePrice();

    • D.

      Public void setPostCode(String s) { System.out.print(s); }

    Correct Answer
    B. Public abstract String getName();
  • 17. 

    Given the following code, which option if inserted after the line with the comment //Here will result in code that will compile and output SupEx?class Super{    public void go(){        System.out.print("Super");    }}public class SupEx extends Super{    public static void main(String argv[]){        //Here        s.go();    }    public void go(){        System.out.println("SupEx");    }}

    • A.

      SupEx s = new Super();

    • B.

      Super s = new SupEx();

    • C.

      SupEx s = new SupEx();

    • D.

      Super s = new Super();

    Correct Answer(s)
    B. Super s = new SupEx();
    C. SupEx s = new SupEx();
  • 18. 

    Which of the following statements are true?

    • A.

      A try clause must have a matching catch and finally clause

    • B.

      A try clause can be used without a matching finally or catch clause

    • C.

      A try clause can be used with a matching finally clause and no catch clause

    • D.

      A try clause may be declared as public or private but not protected.

    Correct Answer
    C. A try clause can be used with a matching finally clause and no catch clause
  • 19. 

    What will happen when you attempt to compile and run the following code? interface Skeleton{ public char getSize(int iSize);}public class Huskisson implements Skeleton{ int iSize=99; public static void main(String argv[]){ new Huskisson(); } Huskisson(){ int iSize=1; System.out.println(getSize(iSize)); } public int getSize(int iSize){ return iSize; }}

    • A.

      Compilation and output of 1

    • B.

      Compile time error

    • C.

      Compilation and output of 99

    • D.

      Compilation but runtime error

    Correct Answer
    B. Compile time error
  • 20. 

    What will happen when you attempt to compile and run the following code?public class Test{ public static void main(String argv[]){ new Test(); } private Test(){ String[] Sa = {"One", "Two"}; getName(Sa); System.out.print(Sa[0]); } public void getName(String s[]){ s[0]="Three"; }}

    • A.

      Compile time error, a constructor cannot be marked as private

    • B.

      Compilation and output of "One"

    • C.

      Compilation and output of "Three"

    • D.

      Compilation, but runtime error.

    Correct Answer
    C. Compilation and output of "Three"
  • 21. 

    Which of the following statements are true?

    • A.

      The abstract modifier may be applied to classes, methods and primitives

    • B.

      The abstract modifier may be applied to classes but not methods

    • C.

      A non abstract class that extends an abstract class must implement all the abstract methods of the inherited class

    • D.

      The abstract modifier may be applied to both classes and methods

    Correct Answer(s)
    C. A non abstract class that extends an abstract class must implement all the abstract methods of the inherited class
    D. The abstract modifier may be applied to both classes and methods
  • 22. 

    What will happen when you attempt to compile the following code? protected class Wmid{ private Wmid(String sName){ System.out.println("Wmid"); } Wmid(){}}public class Ombers extends Wmid{ public static void main(String argv[]){ Ombers o = new Ombers(); }}

    • A.

      Compile time error, class Wmid may not be marked as protected

    • B.

      Compile time error, a constructor may not be marked as private

    • C.

      Compilation and output of Wmid

    • D.

      Compilation but no output

    Correct Answer
    A. Compile time error, class Wmid may not be marked as protected
  • 23. 

    Which of the following statements are true of the HashMap class?

    • A.

      It does not permit null values

    • B.

      It does not permit null keys

    • C.

      It stores information as key/value pairs

    • D.

      Elements are returned in the order they were added

    Correct Answer
    C. It stores information as key/value pairs
  • 24. 

    Which of the following statements are true?

    • A.

      The idea of threading is the same as multi tasking.

    • B.

      No two threads can access the same variables

    • C.

      Using synchronization within code may cause a performance penalty at runtime.

    • D.

      The use of threads within a program may make the exact path of execution unpredicatble

    Correct Answer(s)
    C. Using synchronization within code may cause a performance penalty at runtime.
    D. The use of threads within a program may make the exact path of execution unpredicatble
  • 25. 

    Which of the following statements are true?

    • A.

      Interface methods cannot be static

    • B.

      Interface methods must have a return type of void

    • C.

      An interface cannot extend another class

    • D.

      An interface method cannot be marked as final

    Correct Answer(s)
    A. Interface methods cannot be static
    C. An interface cannot extend another class
    D. An interface method cannot be marked as final
  • 26. 

    What will happen if you attempt to compile and run the following code public class TimDig{ public static void main(String argv[]){ TimDig td = new TimDig(); td.samcov(); } public void samcov(){ int i=1; int j=2; if((i==20) && (j==(i=i*2))){ } System.out.print(i); if((i==20) & (j==(i=i*2))){} System.out.print(i); int x = i & 2; System.out.print(x); } }

    • A.

      Compile time error the & operator can only take boolean values

    • B.

      Compilation and output of 240

    • C.

      Compilation and output of 120

    • D.

      Compilation and output of 122

    Correct Answer
    D. Compilation and output of 122

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Jan 02, 2013
    Quiz Edited by
    ProProfs Editorial Team
  • Jun 29, 2009
    Quiz Created by
    Bbronshteyn
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.