Dashboard > Terracotta Public Wiki > Home > lsb > Exam App Questions
  Terracotta Public Wiki Log In   View a printable version of the current page.  
  Exam App Questions
Added by Fiona OShea, last edited by Scott Bale on Aug 24, 2008  (view change)
Labels: 
(None)

Exam App Questions

Description

The Exam Application is part of an ongoing effort at Terracotta to define and document a User Session test case from conception to deployment.

This page is a place to add content for the Exam application itself.

Exam Subject - Terracotta

Format - Test Format TBD

Example questions:

What is a Root

What is an Auto Lock

What is a TIM

Can I fit more objects in a shared object graph than what can fit in a JVM

Does wait and notify work in a cluster

How does one find out when nodes join and leave the cluster

What are three ways of configuring your roots, locks and includes

How can one see what objects are in a cluster and each Client jvm

Questions - A list of possible Exam App questions


When you set a TC properties through tc-config.xml, local tc.properties and JVM args, which order of precedence is correct? (Hung)

a) tc-config.xml, local tc.properties, JVM args
b) local tc.properties, tc-config.xml, JVM args
c) JVM args, local tc.properties, tc-config.xml
d) local tc.properties, JVM args, tc-config.xml

Answer: c


What is Terracotta

a) JVM
b) OS Library
c) Caching tool
d) JVM Level Clustering solution

Answer: d


How can you cut off an object graph to prevent state from being unnecessarily clustered? (Geert)

a) Write custom serialization logic by implementing writeObject and readObject.
b) Configure the appropriate fields to be transient for the cluster.
c) Exclude the classes that you don't want to share in the Terracotta configuration.
d) Detect that Terracotta is running and assign 'null' to certain fields.

Answer: b


Under what circumstances will a thread requesting a concurrent lock be blocked? (Walter)

a) requesting a concurrent lock never blocks the requestor; concurrent "locks" aren't really locks at all and should in general be avoided.
b) the requestor will be blocked if another thread in the same VM already owns the lock
c) the requestor will be blocked if another thread anywhere in the cluster already owns the lock
d) the requestor will be blocked until all threads in the cluster line up at the lock, and then one thread will be arbitrarily chosen to unblock.

Answer: a


Using Terracotta requires you to maintain crazy amounts of XML configuration

a) True
b) False

Answer: b (Annotations)


Terracotta is a Distributed Cache

a) True
b) False

Answer: b


Terracotta installations can be configured with no Single Points of Failure

a) True
b) False

Answer: a


How many lock-levels does Terracotta support?

a) 1 (synchronized)
b) 2 (read and write)
c) 3 (read, write and reentrant)
d) 4 (read, write, synchronous-write, and concurrent)
e) 4 (read, write, reentrant, and concurrent)
f) 5 (read, write, reentrant, concurrent, and greedy)

Answer: d


True or False. "dirty reads" of certain data types (e.g. Integers) are safe because they are changed atomically.

a) True
b) False

Answer: b

a bunch of code puzzles created by developers where people need
to try to figure out what would happen etc


Which "outdoor" game is frequently on display "indoors" at Terracotta?

a) Football (american version)
b) Football (soccer to the americans)
c) Frisbee Golf
d) Tennis

Answer: b


What would be printed out below if you run with Terracotta. "map" is declared as a root. (Hung)

public class Main {
  //@Root
  private Map map = new ConcurrentHashMap();
   
  public void run() {
    Map newMap = new ConcurrentHashMap();
    newMap.put("key1", "value1");
    newMap.put("key1", "value2");
    
    map = newMap;
    
    System.out.println("Map size: " + map.size());
  }
  
  public static void main(String[] args) {
    new Main().run();
  }
}

a) Map size: 0
b) Map size: 1
c) Map size: 2

Answer: a


True/false - Terracotta instances which are to be clustered must implement Serializable

Answer: false


True/false - Terracotta honors the semantics of the Java Memory Model (locking, synchronization, wait/notify, etc.) across the entire cluster.

a) True, under all circumstances.
b) True, only for operations involving Terracotta clustered instances.
c) True, for all Java classes instrumented by Terracotta.
d) False, the Java Memory model is only guaranteed at each local node.

Answer: c

Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators