-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreadme.txt
More file actions
42 lines (33 loc) · 1.52 KB
/
Copy pathreadme.txt
File metadata and controls
42 lines (33 loc) · 1.52 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
PALINDROME FINDER CODE SAMPLE
The source file of particular interest is palindrome.CodeSample
Designed as a command line tool. Assumes that part of the activity is to
demonstrate not only the ability to write a palindrome algorithm, but also
demonstrate some knowledge about Java libraries.
As such decided to use the following:
* Maven (http://maven.apache.org/): building the jar
* XOM (http://www.xom.nu/): XML Parsing Library
* JUnit (http://www.junit.org/): unit testing framework
* Guava (http://code.google.com/p/guava-libraries/): collections processing
* commons-cli (http://commons.apache.org/cli/): command line parser
Usage is as follows:
java -jar palindrome-0.0.1-SNAPSHOT-jar-with-dependencies.jar -input /path/to/dataset.xml -output /path/to/output/answers.xml
NOTES
The example input XML file as-is is not valid XML. I assumed this was an
oversight as opposed to part of the test. You can see the issue in the comment
I've included in the - cleaned up - example below:
<?xml version="1.0"?>
<dataset>
<data1>Don't nod</data1>
<data2>Dogma: I am God</data2>
<data8>Was it Eliot's toilet I saw?</data8>
<data3>Never odd or even</data3>
<data10>How are you era who</data10>
<data4>Too bad � I hid a boot</data4>
<data5>Rats live on no evil star</data5>
<data7>No trace; not one carton</data7>
<data9>Murder for a jar of red rum</data9>
<!-- made the assumption that the invalid character "&" was an oversight -->
<!-- <data11>Madam, I&m Adam</data11> -->
<data11>Madam, I'm Adam</data11>
<test>This is not data</test>
</dataset>