0% found this document useful (0 votes)
24 views13 pages

Java Developer Technical Aptitude Battery ISC - Fernando I Solórzan o R.

The document lists various Java technologies and skills. It includes lists of Java APIs, frameworks, IDEs, databases, operating systems, and other programming languages. It also includes a short quiz with multiple choice questions testing Java knowledge.

Uploaded by

feryalla
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)
24 views13 pages

Java Developer Technical Aptitude Battery ISC - Fernando I Solórzan o R.

The document lists various Java technologies and skills. It includes lists of Java APIs, frameworks, IDEs, databases, operating systems, and other programming languages. It also includes a short quiz with multiple choice questions testing Java knowledge.

Uploaded by

feryalla
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/ 13

Java Technical Aptitudes Battery

Name: Fernando Issai Solórzano Rodriguez Tel: 5540080222 Email:[email protected]

Java APIs 3rd Party APIs Databases


O Web O Log4J O SQL Server
O JDBC / ODBC O Apache Commons O DB2
O Java Mail O POI O Oracle
O JMS O SAXON O Informix
O JTA / JTS / JPA O JT-400 O MySQL
O JSTL O Jasper Reports O Cloudscape
O Custom Tags O JSON O MS Access
O RMI-IIOP O Other _____________ O Other _H2_______
O Java 3D
O EJB Operating Systems
O JMX O Windows x86 (NT, 2000, XP, Vista, 7); Win x64
O JNDI / LDAP O Linux (Suse, Mandrake, Redhat)
O Java Security / JAAS / JSSE O Solaris
O SOAP / AJAX O UNIX (AIX, HP-UX, etc)
O JAX-RPC O Mac OS
O SOAP/Web Services O HP-UX
O Annotations O Mac OS X
O Reg Ex O MS-DOS
O GoF Design Patterns O Other ____________________
O Other ___________________

1
Java IDE Productivity Software
O Rational Architect Developer O Adobe Dreamweaver
O Websphere Studio Application Developer O Adobe Flash
O BEA WebLogic O Adobe Fireworks
O SunOne Studio O Adobe Photoshop CS
O Borland JBuilder O Adobe InDesign
O Netbeans O Adobe PageMill
O Gel O Microsoft Office 2000, XP, 2003
O J++ O Microsoft Visual Studio
O Visual Age for Java O Other ________________
O Eclipse
O Other ____IntelliJ IDEA __________

Frameworks Scripting Languages


O Model-View-Controller O JavaScript
O Model-2 O HTML
O Struts O XML
O Velocity O VB Script / ASP
O Hibernate O Flash ActionScript
O Spring O PHP
O Turbine O CSS
O Tapestry O Other ____________
O WebWork
O Cocoon
O InternetBeans Express
O EJB Entity, Session, and Message-driven Beans
O Other ___________________

Other Programming Languages


O C++ O C# O Visual Basic 6 O VB.Net
O 4GL O CGI O Perl O Fortran
O COBOL O Assembly Language O Ruby OC
O Ada O PASCAL O Apple Script O Cold Fusion
O shells (UNIX) O Jython/Python O Basic O Mathematica
O Other _____________________________________________________________________

2
1. Which of these primitive data types are arranged in size from smallest to greatest?
a. byte, char, int, float, long
b. Boolean, int, Long, double, BigDecimal
c. Char, Integer, String
d. int, float, long, double
e. None of the above

2. What does the following segment code do?


Calendar C = new GregorianCalendar();
C.setTimeInMillis(System.currentTimeMillis());
GMT_OFFSET = new Long(getTimeZoneOffset(C));

a. Creates a Calendar object with the current system date.


b. Sets the time zone to Greenwich Mean Time in the calendar object
c. Obtains the number of milliseconds from the time zone offset using a calendar object with the
current system date.
d. None of the above

3. What is this Regular Expression is validating?


String regex = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9-
]+)*(\\.[_A-Za-z0-9-]+)" ;
a. A valid first and last name
b. A valid email address
c. A valid URL
d. None of the above

4. Which of these are Wrapper classes?


a. Integer, Double, Long
b. String, Character, Boolean
c. BigDecimal, Short, ArrayList
d. None of the above

5. What is the output of the following code segment?


String one = "0";
String two = "FM";

if("1".equals(one) || (two!=null && "FM".equals(two)))


System.out.println("TRUE!");
else
System.out.println("FALSE");
a. TRUE!
b. FALSE
c. Code does not compile
d. An exception is thrown

3
6. Is there an error in this code?
HashMap<String, Long> HM = new HashMap<String, Long>();
HM.put("Time", System.currentTimeMillis());
HM.put(Integer.valueOf(10), Long.valueOf("112012912912"));

a. Code does not compile because of different arguments in the “put” method
b. The HashMap is null and will throw an exception when putting elements into it
c. No errors

7. What is the output of the following code?


public double factorial(double i){
if(i==0){
return 1;
}else{
return i*factorial(i-1);
}
}

System.out.println(factorial(6));
a. java.lang.ArithmeticException: / by zero
b. 32768.0
c. 720.0
d. Code does not compile
e. java.lang.IllegalArgumentException

8. Explain what each access modifier does to a class, method, and/or variable:

Class Method Variable


public the property or method is the property or the property or
accessible from any method of method is accessible method is
another class. from any method of accessible from any
another class. method of another
class.

protected classes in the same package classes in the same package


classes in the same package and inheriting from the class and inheriting from the
and inheriting from the class can access the property or class can access the
can access the property or method. property or method.
method.

private only the class can only the class can


only the class can access the property or access the property
access the property or method or method
method

[default access] When no access When no access


When no access modifier is specified modifier is specified
modifier is specified for a class , method or for a class , method
for a class , method or data member – It is or data member – It

4
data member – It is said to be having the is said to be having
said to be having the default access the default access
default access modifier by default. modifier by default.
modifier by default.
The data members, class or The data members, class
The data members, methods which are not or methods which are not
class or methods declared using any access declared using any access
which are not modifiers i.e. having default modifiers i.e. having default
declared using any access modifier are accessible access modifier are
access modifiers i.e. only within the same package accessible only within the
having default access same package
modifier are
accessible only within
the same package

9. Which one of these is not a valid escape sequence?


a. \"
b. \n
c. \a
d. \t
e. \\

10. Which of these operators does not exist in Java?


a. The unary sum operator ++
b. The pointer operator ->
c. The bitwise left-shift operator <<
d. The bitwise XOR operator ^
11. Explain what each keyword is used for
a. Final

The final keyword in java is used to restrict the user. The java final keyword can be used in many context. Final
can be:

1. variable
2. method
3. class

If you make any variable as final, you cannot change the value of final variable(It will be constant).

If you make any method as final, you cannot override it.

If you make any class as final, you cannot extend it.

b. static

The static keyword in Java is used for memory management mainly.


5
We can apply static keyword with variables, methods, blocks and nested classes.

The static keyword belongs to the class than an instance of the class.

The static can be:

Variable (also known as a class variable)

Method (also known as a class method)

Block

Nested class

If you declare any variable as static, it is known as a static variable.

The static variable can be used to refer to the common property of all objects (which is not unique for each
object), for example, the company name of employees, college name of students, etc.

The static variable gets memory only once in the class area at the time of class loading.

If you apply static keyword with any method, it is known as static method.

A static method belongs to the class rather than the object of a class.

A static method can be invoked without the need for creating an instance of a class.

A static method can access static data member and can change the value of it.

Java static block

6
Is used to initialize the static data member.

It is executed before the main method at the time of classloading.

c. Synchronized

Multi-threaded programs may often come to a situation where multiple threads try to access the same resources
and finally produce erroneous and unforeseen results.

So it needs to be made sure by some synchronization method that only one thread can access the resource at a
given point of time.

Java provides a way of creating threads and synchronizing their task by using synchronized blocks. Synchronized
blocks in Java are marked with the synchronized keyword. A synchronized block in Java is synchronized on some
object.

All synchronized blocks synchronized on the same object can only have one thread executing inside them at a time.

All other threads attempting to enter the synchronized block are blocked until the thread inside the synchronized
block exits the block.

d. Native

The native keyword is applied to a method to indicate that the method is implemented in native code using JNI
(Java Native Interface). native is a modifier applicable only for methods and we can’t apply it anywhere else. The
methods which are implemented in C, C++ are called as native methods or foreign methods.

The main objectives of native keyword are:

To improve performance of the system.

To achieve machine level/memory level communication.

To use already existing legacy non-java code.

e. transient
transient is a variables modifier usetransient is a variables modifier used in serialization. At the time of
serialization, if we don’t want to save value of a particular variable in a file, then we use transient keyword.
When JVM comes across transient keyword, it ignores original value of the variable and save default value
of that variable data type.

transient keyword plays an important role to meet security constraints. There are various real-life examples
where we don’t want to save private data in file. Another use of transient keyword is not to serialize the
variable whose value can be calculated/derived using other serialized objects or system such as age of a
person, current date, etc.
Practically we serialized only those fields which represent a state of instance, after all serialization is all
about to save state of an object to a file. It is good habit to use transient keyword with private confidential
fields of a class during serialization.
f. volatile
7
Using volatile is yet another way (like synchronized, atomic wrapper) of making class thread safe. Thread
safe means that a method or class instance can be used by multiple threads at the same time without any
problem.

12. Fill the truth table below with the corresponding values

AND Expression OR Expression XOR Expression NOT Expression


false&&false false false||false false false^false false !false true
true&&false false true||false true true^false true
false&&true false false||true true false^true true
true&&true true true||true true true^true false !true false

13. What is the scope of these JSP Objects?


a. page ________________________________________________________________
b. request ________________________________________________________________
c. session ________________________________________________________________
d. application ________________________________________________________________

14. When using the “read committed” transaction isolation level, what errors may occur? (check all that
apply)
a. The results may include phantom data
b. A deadlock may occur with high concurrency
c. This transaction isolation level seldom causes errors
d. A non-repeatable read may occur
e. None of the above

15. What is the superclass of all exceptions and errors in the java language?
a. java.lang.Error
b. java.lang.Exception
c. java.lang.Throwable
d. java.lang.RuntimeException
e. None of the above

16. What does this line do in a JSP page <%@page contentType="application/vnd.ms-excel"%>?


a. It renders the current page in text-only format
b. It renders the current page as a Microsoft Excel worksheet
c. It starts Microsoft Excel when the page loads
d. None of the above

8
17. Given the following 2x2 Matrix create a method that computes the determinant of this Matrix given by
the formula ad-cb, ∀ a,b,c,d ∈ R.

18. A vector V in the Cartesian plane centered at the origin with endpoints (x, y) has a magnitude r and a direction θ
where r = √(x2 + y2) and θ = Tan-1(y/x) (the angle between the vector and the x-axis). Given a vector A with
magnitude r1 and direction θ 1 and a vector B with magnitude r2 and direction θ 2, create a method that takes two
vectors and tests to see if both vectors are identical. If both vectors are identical, the method returns true, otherwise
it returns false.

19. Create a method that utilizes a brute-force algorithm to find and print the first 10 numbers that satisfy Pythagoras’
Theorem such that c 2 = a2 + b2, ∀ a,b,c ∈ Z

20. Create a method that implements the Fundamental Theorem of Calculus such that for any given function
F(x) = ∫f´(x) dx we can find the value for F(x) = ∫abf´(x) dx. For this, we assume that f´(x) = 2x2 and F(x) = (2/3)x3
and that F(x) = F(b)-F(a) ∀ a,b ∈ R. Create a function that takes in a and b as floating-point numbers and computes
the integral F(x) = ∫abf´(x) dx.

9
21. Define join and name different type of joins?

A SQL join is a Structured Query Language (SQL) instruction to combine data from two sets of data (i.e. two tables).

(INNER) JOIN: Returns records that have matching values in both tables
LEFT (OUTER) JOIN: Returns all records from the left table, and the matched records from the right table
RIGHT (OUTER) JOIN: Returns all records from the right table, and the matched records from the left table
FULL (OUTER) JOIN: Returns all records when there is a match in either left or right table

22. Is it possible for a table to have more than one foreign key?

In addition to the primary key, a table can have zero or more foreign keys, which are columns that reference the
primary keys of other tables.

23. What is difference between Local and Global temporary table?

Variable table (DECLARE @t TABLE) are only visible to the connection that is created and are removed when the
batch or stored procedure ends. display: inline-block; width: 336px; height: 280px "data-ad-client =" ca-pub-
4860592551209305 "data-ad-slot =" 4807115270 "data-adsbygoogle-status =" done ">

Local temporary tables (CREATE TABLE #t) are only visible to the connection that is created and are removed when
the connection is closed.

Global temporary tables (CREATE TABLE ## t) are visible to everyone, and are cleared when all connections
referenced to them have been closed.

Tempdb persistent tables (USE tempdb CREATE TABLE t) are visible to everyone, and are removed when the server
is restarted.

24. Can we rename a column in the output of SQL query?


10
25. Difference between TRUNCATE, DELETE and DROP commands?

DROP removes existing objects in a database. If it is a table, the table with all its records will be dropped.

TRUNCATE removes ALL records from a table, think it's like "Initializing" the table, resetting it to zero.

TRUNCATE has some important differences with DELETE. TRUNCATE removes all records, with no possibility of
filtering or setting conditions.

26. What keyword does an SQL SELECT statement use for a string search?

The LIKE operator


This operator is applied to data of type string and is used to search records, it is able to find matches within a string under a
given pattern , example:

select *
from EMPLEADOS
where APELLIDOS like 'R%'

27. Consider the following two query results:

SELECT count(*) AS total FROM orders; SELECT count(*) AS cust_123_total FROM orders WHERE customer_id = '123';

+-------+ +----------------+
| total | | cust_123_total |
+-------+ +----------------+
| 100 | | 15 |
+-------+ +----------------+
Given the above query results, what will be the result of the query below?

SELECT count(*) AS cust_not_123_total FROM orders WHERE customer_id <> '123'

AS cust_not_123

85

11
28. Given a table TBL with a field Nmbr that has rows with the following values:

1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1

Write a query to add 2 where Nmbr is 0 and add 3 where Nmbr is 1.

INSERT INTO TBL (Nmbr)


VALUES (0)
WHERE Nmbr = 0

INSERT INTO TBL (Nmbr)


VALUES (0)
WHERE Nmbr = 0

INSERT INTO TBL (Nmbr)


VALUES (1)
WHERE Nmbr = 1

INSERT INTO TBL (Nmbr)


VALUES (1)
WHERE Nmbr = 1

INSERT INTO TBL (Nmbr)


VALUES (1)
WHERE Nmbr = 1

29. Write a SQL query to find the 10th highest employee salary from an Employee table. Explain your
answer.
(Note: You may assume that there are at least 10 records in the Employee table.)

SELECT TOP 1 Salary


FROM
(
SELECT TOP N Salary
FROM Employee
ORDER BY Salary DESC
) SalarySubquery
ORDER BY Salary ASC
12
In the query we will show the highest salary in the employee table, it is ordered by DESC salary and there is a
subquery that orders everything by ASC salary.

30. Given a table dbo.users where the column user_id is a unique identifier, how can you efficiently select
the first 100 odd user_id values from the table?
(Assume the table contains well over 100 records with odd user_id values.)

SELECT *
FROM (
SELECT *
FROM dbo.users
ORDER BY user_id DESC
)
WHERE rownum <= 100

13

You might also like