AIS Advanced Information Systems

Home
 

AIS Staff Recruitment Self Assessment Questions

Vacancy GS-AIS-2012-143-LD

Congratulations! You have been selected to proceed to the next stage of the recruitment process.

In this stage you will be asked to pass a technical exam to be completed on-line. It consists of two parts: Java and SQL, each taking around 40 minutes to complete (80 minutes in total). To give you an idea of the type of questions you might expect, here is a selection of questions that we would expect you to be able to answer reasonably well.

Click here to reveal the correct answers highlighted in yellow.

Questions

1. Given The following, what is the output:

import java.util.*;

public class Test {
    public final static void main(String $[]) {
        List<String> one = new java.util.ArrayList<String>();
        List<String> two = new java.util.ArrayList<String>();
        List<Object> three = new java.util.ArrayList<Object>();
        one.add("A");
        two.add("A");
        three.add(new String("A"));
       
        System.out.println(one == two);
        System.out.println(one.equals(two));
        System.out.println(one.equals(three));
        System.out.println(one.getClass().equals(three.getClass()));
    }

}
  1. Does not compile
  2. Prints: true true true true
  3. Prints: false true true true
  4. Prints: false true false true
  5. Prints: false true false false
  6. Prints: false true true false

2.  Which of the following statements are valid?

  1. List < String > list = new Vector < String > ();
  2. HashSet < Number > hs = new HashSet < Integer > ();
  3. Map < String, ? extends Number > hm = new HashMap < String, Integer > ();
  4. HashSet < ? super ClassCastException > set = new HashSet < Exception > ();
  5. List < Object > values = new LinkedHashSet < Object > ();

Given: ArrayList al = new ArrayList(); What would al.add(2); be example of?

  1. Autoboxing
  2. Type coersion
  3. Polymorphism
  4. Parameterised types

4. Given: ArrayList al = new ArrayList(); What would al.remove(2); be example of?

  1. Autoboxing
  2. Type coersion
  3. Polymorphism
  4. Parameterised types

5. What would be the output of the following groovy code:
[3, 2, 4, 1].collect {it * 2}.findAll{it > 4}.sort{a,b-> a==b ? 0: a > b ? -1 : 1 }

  1. [8, 6]
  2. [4, 6, 8]
  3. [4, 3, 2, 1]
  4. [6, 4, 8]

6. Given the standard Oracle table of employees (emp) and departments (dept). Which queries would count the number of employees in every department.

  1. SELECT dept.dname, count(emp.empno) FROM dept, emp WHERE dept.deptno = emp.deptno GROUP BY (dept.dname)
  2. SELECT dept.dname, count(emp.empno) FROM dept, emp WHERE dept.deptno = emp.deptno(+)
  3. SELECT dept.dname, count(emp.empno) FROM dept LEFT JOIN emp ON dept.deptno = emp.deptno GROUP BY (dept.dname)
  4. SELECT dept.dname, (SELECT count(emp.empno) FROM emp WHERE dept.deptno = emp.deptno) FROM dept

7. Given the following table, What would be the result of: select AVG(Price), COUNT(Price) from Prices

Table: Prices
Item     Price
-------- -------
Book           1
Table          2
Chair    NULL
Hat            3
Coat           2
  1. ERROR
  2. 1.6, 5
  3. 2, 4
  4. 2.2, 3

8. Given the following PL/SQL cursor: SELECT ENAME, SAL FROM SCOTT.EMP;Which statement would print all match rows.

  1. FETCH c1 INTO name, sal; WHILE c1%FOUND LOOP DBMS_OUTPUT.PUT_LINE(name||' '||sal); END LOOP;
  2. WHILE c1%HASDATA LOOP FETCH c1 INTO name, sal; DBMS_OUTPUT.PUT_LINE(name||' '||sal); END LOOP;
  3. FOREACH emp_rec IN c1 DO DBMS_OUTPUT.PUT_LINE(emp_rec.ename||' '||emp_rec.sal); END;
  4. FOR emp_rec IN c1 LOOP DBMS_OUTPUT.PUT_LINE(emp_rec.ename||' '||emp_rec.sal); END LOOP;

 

Take the next step...

Now that you have seen what to expect, you may decide to either:

  • Proceed to the next stage. In this case, please contact us again by email at Staff.Interviews@cern.ch (please include the vacancy ID GS-AIS-2012-143-LD in the subject line) before 13:00 CET on Monday September 17th 2012. Responses that arrive after this time can unfortunately not be considered further for this vacancy. You will then receive further instructions for performing the exam in the coming days, at your convenience. The results of this test will be added to your candidate dossier at CERN.
  • You may consider not doing the tests, if you found that you did not answer many questions correctly. We will not consider you further for this post and your candidate dossier will not be altered, and you are of course welcome to apply to other posts at CERN that you feel are closer to your area of expertise.

 

 

 

AIS Webmaster