Test Técnico de Java

Escrito por Juanjo el Monday, 2 de February del 2009 a las 3:50 pm

No me acuerdo exactamente donde fue que encontré las siguientes preguntas, pero si son verídicas, soy un completo ignorante (por cierto, no es lo mismo intuirlo que corroborarlo). Al parecer, son preguntas que se hacen en la parte “técnica” de las entrevistas de trabajo para ingenieros informáticos en el Reino Unido. Son bastante bastante concretas sobre Java… y no sé ni una. Creo que me queda mucho que estudiar para aspirar a las certificaciones Sun…

Aquí van las preguntas (en inglés):

1- Troubleshoot the following class that is producing performance errors on the site:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.blah.dataaccess;  
 
import java.sql.*; 
import javax.sql.*;  
import com.blah.data.*;  
 
public class GetFormats {   	
 
   private Connection con;  	
 
   public static String GetFormat(String user) 	{ 	 		
      String format = "mpeg4_150k";
      try {
         con = ConnectionFactory.getConnection();
         String sql_string = "select wfmt_urlroot from wprf, wfmt where wprf_value = wfmt_id and wprf_type = 'bandwidth' and wprf_wusr_id = ?";
         PreparedStatement pstmt = con.prepareStatement(sql_string);
         pstmt.setString(1, user);
         ResultSet rs = pstmt.executeQuery();
         if (rs != null) {
            while (rs.next()) { 
               format = rs.getString(1);
            }
         }
      } catch (SQLException e) {
          String error = ""+ e.toString();
      }
      return formats;
      }
   }
}

2- What’s wrong with the following Tag:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.blah.webui;  
 
import java.sql.*; 
import java.lang.*; 
import java.util.*; 
import java.net.URLEncoder;  
 
public class OutputFooter extends TagSupport {
 
   public String Footer() {
      String html = "";
      html = html + "</body></html>";
      return html;
   }
 
   public int doStartTag() throws JspException {
      try {
         // and write out the formatted content to the page
         pageContext.getOut().write(Footer());
      } catch (java.io.IOException ioe) {
         throw new JspTagException(ioe.getMessage());
      }
      // and skip evaluating the body of the tag (as there shouldn't be one)
      return SKIP_PAGE;     
   }
}

3- If you need to obtain and return the referring URL into a JSP page, how would you do it?

4- Describe how you would set up servlet mappings in Tomcat or any other J2EE servlet container, what would you do to involve Apache in this process to provide a unified URL convention for static and dynamic elements of the site.

5- Describe the steps involved in making Apache and a servlet container such as Tomcat work together. Discuss the relative merits of mod_jk and mod_proxy.

6- Discuss the differences between redirection and forwarding in the Java server environment within a cluster, between servers in a cluster and between sites.

7- Describe how serving of static and dynamic fragments can best be done in a clustered environment for high efficiency under high load with maximum availability.

8- The company has decided to settle on memcached to provide a distributed cache store. Describe how you would create a set of custom tags to provide an interface to memcached to provide for creating, updating, invalidating and retrieving cached items.

9- Explain the steps, giving references to libraries you would use, to enable elements from a content management system to connect with XML-RPC services to provide pings.

10- What’s your preferred way of parsing incoming XML and why?

11- Describe the stages involved in getting Ant, subversion and Eclipse working together to automatically build a tree from a subversion repository and deploy it to Tomcat.

12- Discuss the relative merits of

<c:import>

and

<jsp:include>

13- Discuss the difference between a custom tag which supports EL and one which supports RT.

14- Describe (with code examples if possible) how you would use an EL based JSP fragment to iterate through a simple XML file and make decisions based on the values of certain nodes.

15- The introduction of JSR-220 brought with it JPA. Hibernate is an open source ORM solution. Briefly describe, with a small example if possible, the impact JPA has had on the Hibernate project, and what steps would need to be taken to convert an existing hibernate project to conform with the JPA specification in JSR-220. What advantages to would this conversion bring?

16- When using a persistence layer within a multi-threaded environment which has the potential for a long object lifetime, special precautions must be made to ensure the system can maintain a high degree of concurrency, and also work correctly in a clustered environment. Give a short explanation of the problem domain and a potential high-level solution.

17- Explain the following method signature:

<T extends Myobject> T getMyobject(Class<T> MyObjectType);

18- Explain the difference between phantom, soft, strong and weak references and give a context they would be used in.

19-Diagnose the following exception, found in the tomcat catalina.out file:

java.security.AccessControlException: access denied (java.net.SocketPermission 192.168.1.244:80 connect,resolve) 
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264) 	
        at java.security.AccessController.checkPermission(AccessController.java:427) 	
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
 	at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
 	at sun.net.www.http.HttpClient.openServer(HttpClient.java:459)
 	at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
 	at sun.net.www.http.HttpClient.New(HttpClient.java:287)
 	at sun.net.www.http.HttpClient.New(HttpClient.java:299)
 	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:796)
 	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:748)
 	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:673)
 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:917)
 	at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireReader(ImportSupport.java:331) 
.......

20- Design a simple three database table structure which would allow the creation, editing and publication of a webpage stored in a content management system.

Concurrencia, clústering, parsing XML, diseño DB, Templates….. En pocas palabras, la-le-che :P

Categoria: Coding, Informática

2 Comentarios

Comentario de alexis perez

Realizado el Wednesday, 9 de June del 2010 a las 7:41 pm

Pero no hay que ser un ingeniero para darse cuenta que por ejemplo en la pregunta 1, reclama o lanza una excepcion porque no se ha declarado la variable: “formats”…solo se declaró la variable “format”…Sutilezas solamente. Hay que aprender a leer. Lo mismo pasa en la pregunta 2, no se ha declarado la variable “SKIP_PAGE”.

Saludos :D

Despues sigo leyendo las demás preguntas :P

Comentario de Juanjo

Realizado el Wednesday, 9 de June del 2010 a las 11:17 pm

Buenas alexis!
Tienes razón en la primera, aunque me extraña que lo enuncien como errores de rendimiento “performance errors” cuando ese código ni compila :S
En el segundo caso, ya no me queda tan claro. ¿Cómo sabes que SKIP_PAGE (en mayúsculas y por tanto una presumible constante) no está declarada en el padre, TagSupport?
¿Cómo ves las demás?
Salu2

Escribir un comentario

XHTML: Puedes usar estos tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Comentarios Recientes
  • alexis perez: Pero no hay que ser un ingeniero para darse cuenta que por ejemplo en la pregunta 1, reclama o lanza...
  • débora: te eché de menos :-(
  • egeo87: LOS INDIANOS, EMPIEZA LA CUENTRA ATRAS! http://www.lapalma.es/post/201 0-01-16-los-indianos-empiez...
  • Roger: Gracias, nos veremos, soy este chico en ropas blancas y un sombrero :-)
  • Roger: Ustedes ya saben que dia sera Los Indianos este ano?
  • Sergio: Mamonazo!! como es posible que si busco en google “los indianos 2010″ tú blog sea el 2º...
  • Jose Frechín: Hace poco estuve tentado de usarlo, pero claro, soy un vago y eso de bajarme los archivos y luego...
  • Óscar: Juanjo eres un grande tio!!! de mayor (cuando acabe la técnica) quiero ser como tú
  • Juanma: Sip, se podría decir que sip !!!!
  • Juanma: En cuanto pases por esta situación seguro que no te hace la misma gracia :p .. Saludos !!


All's clear