0% found this document useful (0 votes)
151 views12 pages

Actimize Test

This document contains 20 multiple choice questions testing knowledge of JavaScript/FrontEnd, Security/SSL, Networking, Java, and other programming topics. It asks the reader to choose the best answer or answers for each question, with some questions having multiple correct options. The questions cover a range of concepts like retrieving form values with JavaScript, refreshing windows, SSL certificates, HTTP response codes, Java expressions and data types, threads, interfaces vs abstract classes, and more.

Uploaded by

David Dominguez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
151 views12 pages

Actimize Test

This document contains 20 multiple choice questions testing knowledge of JavaScript/FrontEnd, Security/SSL, Networking, Java, and other programming topics. It asks the reader to choose the best answer or answers for each question, with some questions having multiple correct options. The questions cover a range of concepts like retrieving form values with JavaScript, refreshing windows, SSL certificates, HTTP response codes, Java expressions and data types, threads, interfaces vs abstract classes, and more.

Uploaded by

David Dominguez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Page 1 of 12

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:

<input id="address" type="text" name="Customer Address"/>

a) document.getElementById("address").value;
b) document.getInputValue("address");
c) document.getElementByName("Customer Address").value;
d) document.input.address.value;

2) At the bottom of an HTML page is a button…

<input type="button" id="finish" value="Finish"/>

Which of the following techniques would prevent users from seeing it?

a) Set the style="display:none"


b) Set the style="visibility:hidden"
c) Set the style="hidden:true"
d) Call the JS function document.getElementById("finish").style.display="none";
e) Call the JS function document.button("finish").hide();

3) What are the attributes you would use to change the look of a button? (Give at least 2 different
attributes.)

<button type=”button” style=”background-color:red”>Button Text</button>

<button type=”button” style="border-color:blue; color:white">Button Text</button>

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

6) What are some reasons that an SSL certificate might be invalid?


a) The hostname of the certificate does match the URL of the website
b) The certificate is expired
c) The signature algorithm uses “secure hash algorithm” encoding.
d) The certificate was sent as an email attachment
e) The certificate is not signed by a valid certificate authority

*** 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

8) Consider a scenario in which:


 A Java client program makes HTTP requests to a server.
 It first makes a login request, then performs subsequent requests every 5 minutes using the
same TCP connection.
 All requests to the backend server are handled by an HTTP proxy
 The proxy is configured with a “idle connection timeout” of 2 minutes.

What kind of error could the client expect to encounter?

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>

12) What are the uses of Interface and Abstract?


An abstract class is used to generalize behavior, on the other hand, an interface is used to standardize
behavior.
 If it is needed to add new methods in the future, then an abstract class is a better choice.
Because if the programmer adds new methods to an interface, then all of the classes that
already implemented that interface will have to be changed to implement the new methods.
 If it is needed to create multiple versions of our component, is better to create an abstract
class. Abstract classes provide a simple and easy way to version our components. All
inheriting classes are automatically updated with the change by updating the base class.
Interfaces, on the other hand, cannot be changed once created. If a new version of an
interface is required, the programmer must create a whole new interface.
 If it is desired to provide common, implemented functionality among all implementations of
our component, is better to use an abstract class. Abstract classes allow us to partially
implement our class, whereas interfaces contain no implementation for any members.

13) What is static variable?


Page 4 of 12

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.

15) What is StringTokenizer and when would we want to use it?

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

18) Consider the following:

What will be the output (Explain your answer)?

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).

19) Consider the following:


Page 6 of 12

What will be the output (Explain your answer)?

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.

20) Lets say we change the upper function to:


Page 7 of 12

What will be the output now (Explain your answer)?

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.

Employees (emp) Departments (dep)

id Name dep_id id name


1000 Dan Moss 100 100 Sales
1001 Alex Ortega 101 101 Support
1002 Tom 100 102 Marketing
1003 Maria 101

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;

25) Consider the following query.

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.

a) create index abc on emp(dep_id);


b) create index abc on dep(id)
c) create index abc on dep(name);
d) create index abc on dep(name, id);
e) create index abc on emp(name, id);
Page 10 of 12

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

What will be the output?

32) What will be the values of “i” and “j” after executing the following lines:
Int i=5;
Int j=i++;

You might also like