Actimize Test
Actimize Test
IMPORTANT: Some questions may have multiple correct answers. Choose ALL that apply.
Javascript/FrontEnd
1) Which of the following Javascript expressions could be used to get the value of the following text
field:
a) document.getElementById("address").value;
b) document.getInputValue("address");
c) document.getElementByName("Customer Address").value;
d) document.input.address.value;
Which of the following techniques would prevent users from seeing it?
3) What are the attributes you would use to change the look of a button? (Give at least 2 different
attributes.)
4) What are the different ways to refresh a window using JavaScript? (Give at least 3 possible
answers.)
You can use the location.reload() JavaScript method to reload the current URL. The following is the
syntax for reloading a page: window.location.reload(); or document.location.reload();
<input type="button" value="Reload Page" onClick="window.location.reload(true)">
The History function is another method for refreshing a page. The following is the syntax for reloading
a page: history.go(0);
setTimeout("location.reload(true);", 5000);
Page 2 of 12
Security/SSL
5) What is of the following are utilities for viewing and manipulating keystores?
a) javac
b) keytool
c) netstat
d) java_key
e) openssl
*** NOTA: If the “a” means “does NOT match…”, then it should be selected as an answer, otherwise, if it
means “the certificate matches the URL…” then it shouldn’t be selected as an answer.
Networking
7) Which of the following HTTP response codes do NOT indicate that some kind of error has
occurred:
a) HTTP 200
b) HTTP 302
c) HTTP 304
d) HTTP 400
e) HTTP 404
f) HTTP 500
a) SocketTimeoutException
b) ConnectException: Connection Refused
c) IOException: Connection reset by peer
Page 3 of 12
d) NullPointerException
e) InterruptedException
Java
9) If the Boolean variables “x” and “y” are both true and “z” is false, which of the following Java
expressions evaluates to be true.
a) ((x && y) && z)
b) ((x || z) && x)
c) (!z && x)
d) !(x && z)
e) ((x == z) || (y != z))
10) Which of the following Java expressions will result in a String with a value of “Actimize”.
a) new String("Actimize")).replace("A","a")
b) "Acti" + "mize"
c) new String("mize").prefix("Acti")
d) new String("NICEActimize").substring(4)
e) new String("actimize").capitalize()
f) new StringBuffer("actimize").toString()
11) Which of the following commands can be used to generate a java thread dump.
a) javacore <pid>
b) jstack <pid>
c) kill -3 <pid>
d) jcmd <pid> Thread.print
e) coregen <pid>
A static variable indicates that the declared entity is the same across all instances of that class and
that it can be accessed even before an object of that class is created.
14) When will you use String and when StringBuffer and why?
The String class is used to manipulate character strings that cannot be changed. Simply stated,
objects of type String are read-only and immutable. So it’s suitable to use in a multi-threaded
environment. Immutability can share across functions because there is no concern of data
inconsistency.
The StringBuffer class is used to represent characters that can be modified and provides Thread
safety.
The significant performance difference between these two classes is that StringBuffer is faster than
String when performing simple concatenations.
StringTokenizer class in Java is used to break a string into tokens. This class has methods that allow
testing if tokens are present for the StringTokenizer’s string, counting the number of tokens in a
string, and knowing if there are more tokens in a string next to it. Using tokenization, organizations
can continue to use this data for business purposes without incurring the risk or compliance scope of
storing sensitive data internally.
16) What is reflection for and what information can we get from it?
Reflection is a feature in the Java programming language. It allows an executing Java program to
examine or "introspect" upon itself, and manipulate internal properties of the program. For example,
it's possible for a Java class to obtain the names of all its members and display them.
Reflection can be used to get information about class, constructors, and methods. Reflection gives us
information about the class to which an object belongs and also the methods of that class that can be
executed by using the object.Through reflection, we can invoke methods at runtime irrespective of
the access specifier used with them
17) What’s the meaning of the synchronized keyword when used in method declaration?
The synchronized keyword when used in a method declaration tells Java to use a monitor on that
method to grant thread safety to it, which means that it will lock and unlock the method in a multi-
threading environment in order to prevent race conditions.
Page 5 of 12
The output will be “This is new String for A”. This is so because the method changeString will not
affect the value of the String A outside its declaration. This behavior is due to the fact that Java passes
Strings by value and not by reference (since Strings are immutable), which implies that the changes
done to the String stringA that such method receives are being effected on a copy of the original
stringA given as argument, and not on the real one. Finally, the value that is printed in the console will
be the value stringA had before calling the method changeString (i.e., it is left intact).
Size=5
The size of the hashmap will be 5. From the instantiation of the ClassB (calling the constructor) we
obviously get the first 3 elements (key 1, key 2, key 3). After that, Java calls the function someMethod,
which creates a scope variable called “newHashMap”, nevertheless, objects in java are passed by
reference, which means that the line 17 (HashMap newHashMap = hash;) is not really creating a new
object, but assigning the old hashMap to that new variable. Consequently, by putting new elements
to it (key 4, key 5) you are actually putting elements to the old table. At the end the table has 5
elements (key 1, key 2, key 3, key 4, key 5). The line 20 doesn’t add a new element, but updates the
previous one with the new value.
Size=3
The new method is indeed creating a new HashMap, not referencing the other one. When you use
the “hash.clone()” method you are creating a clone of the previous hash table and assigning that to
the new table. At the end you have 2 different tables, the first one is the one created at the beginning
of the constructor of the Class, the second one is created whenever you call the someMethod
function. The old hashtable, “hash”, has 3 elements (key 1, key 2, key 3), the new one,
“newHashMap” has 5, the 3 from the old table and the new two elements (key 4, key 5).
Page 8 of 12
XML
21) Which of the following lines are syntactically valid XML?
a) <employee><name="Bob Smith"></employee>
b) <colors><red><green><blue></colors>
c) <reptile name="Cobra"/>
d) <pets><dog>Rex</pets></dog>
e) <elements><element name="Iron"/><element name="Carbon"/><elements/>
f) <planets><mars/><earth home="true"/><venus/></planets>
22) Which of the following email addresses match the following case-sensitive regular expression:
^g.*_[A-Z]*[0-9][email protected]$
a) [email protected]
b) [email protected]
c) [email protected]
d) [email protected]
e) [email protected]
f) [email protected]
Page 9 of 12
SQL
The following questions use the two tables defined below.
The “dep_id” column in the employees (emp) table is a foreign key that refers to the “id” in the
departments (dep) table.
23) Which of the following queries will return the names of all the employees in Sales or Marketing?
a) select name from emp where dep_id in (select id from dep where name in ('Sales ', 'Marketing');
b) select emp.name from emp, dep where emp.dep_id = dep.id and dep.name ('Sales',
'Marketing');
c) select name from emp where dep.name = 'Sales' or dep.name = 'Marketing';
d) select emp.name from emp from emp, dep dep.name ('Sales', 'Marketing');
24) Which of the following queries will return the number of people in each department?
a) select dep.name, count(1) from emp where dep.id = emp.id;
b) select dep.name, count(1) from emp, dep where emp.dep_id = dep.id group by dep.name;
c) select dep.name, (select count(1) from emp where emp.dep_id = dep.id) from dep;
d) select emp.dep_id, count(emp.dep_id), name from dep;
e) select emp.dep_id, count(1) from emp inner join dep on emp.dep_id = dep.id;
select emp.* from emp inner join dep on emp.dep_id = dep.id and dep.name like '%e%'
If we assume that neither of the table have any indexes or primary keys, which of the following
indexes could conceivably improve the performance of this query if both table have thousands of
rows.
Operating Systems
26) On a Linux system, which of the following commands could be used to find a machine’s IP
addresses?
a) Ip_config
b) ifconfig
c) hostname -I
d) ip addr show
e) network -l
27) On a Linux system, which of the following commands could be used to show the amount of CPU a
various process are consuming?
g) cpuinfo
h) ps
i) top
j) vim
k) procstat
28) On a Linux system, which of the following commands could be used to list all files in the current
directory whose name contain the word “fox”?
a) ls *fox*
b) ls | grep fox
c) files -c fox
d) find . | grep fox
e) wc fox *
f) which *fox*
29) Which of the following encodings are capable of Chinese/Japanese/Korean (CJK) characters.
a) ISO-8859
b) UTF-8
c) UTF-16
d) Extended ASCII
e) Windows 1251
30) A malicious website in one browser tab takes advantage of the fact that a user is logged into their
bank’s website in another tab and performs actions against the bank website without the user’s
knowledge. This kind of security vulnerability is called:
a) SQL injection
b) Phishing
c) Denial of Service
d) Man-in-the-middle attack
e) XSS attack
Page 11 of 12
C++
31) Consider the following:
Page 12 of 12
32) What will be the values of “i” and “j” after executing the following lines:
Int i=5;
Int j=i++;