|
| 1 | +# Turnitin Java Coding Exercise 2 |
| 2 | + |
| 3 | +Welcome! We're excited you've decided to talk with us about a position on our |
| 4 | +engineering team. |
| 5 | + |
| 6 | +The purpose of this exercise is so we can have a conversation about your |
| 7 | +technical background and abilities. We think that asking you to code on a |
| 8 | +whiteboard during an interview isn't a great way to have a conversation. And |
| 9 | +even if we sit down and pair during an interview it's a higher pressure |
| 10 | +situation than it could be. |
| 11 | + |
| 12 | +Instead we ask that you read these instructions and do _at most_ a few hours of |
| 13 | +work, on your time, to complete the exercise. During the interview we'll talk |
| 14 | +about decisions you've made, the resulting application, and how you might |
| 15 | +change it given different circumstances. |
| 16 | + |
| 17 | +Below are two sections: |
| 18 | + |
| 19 | +- _Instructions_: the problems we'd like you to solve along with expectations we |
| 20 | + have about your solution. |
| 21 | +- _Logistics_: constraints around the problem, and how we'd like you to |
| 22 | + communicate your solution to us |
| 23 | + |
| 24 | +# Instructions |
| 25 | + |
| 26 | +Please solve the following two problems as described below using Java 11 preferably |
| 27 | +(or older versions if necessary). Feel free to create classes, |
| 28 | +structures, interfaces, or any other construct needed to solve this. |
| 29 | + |
| 30 | +## Sample Data |
| 31 | + |
| 32 | + PHRASES = { |
| 33 | + { "1", ["afterward", "whenever", "however", "until", "as soon as", "as long as", "while", "again", "also", "besides"]}, |
| 34 | + { "2", ["therefore", "thus", "consequently", "as a result", "for this reason", "so", "so that", "accordingly", "because"]}, |
| 35 | + { "3", ["in addition to", "so", "moreover"]}, |
| 36 | + { "4", ["in general", "for the most part", "as a general rule", "on the whole", "usually", "typically", "in summary"]} |
| 37 | + } |
| 38 | + |
| 39 | + INPUT_TEXT = "Afterwards, soon yellow bird landed on the tall tree in addition to a lazy tortoise. However, he had a " + |
| 40 | + "read beak. In addition to white the patches on the wings, he was completely yellow. In summary, it was yellow bird. " + |
| 41 | + "In summary, it did not sing." |
| 42 | + |
| 43 | + |
| 44 | +## Problem 1 |
| 45 | +Get the frequencies of each phrase from PHRASES above, ie how many times the phrase appears in the text as described in INPUT_TEXT. |
| 46 | +Of course, it should be able to work with any text. |
| 47 | + |
| 48 | +For example, If you were given the following: |
| 49 | + |
| 50 | + PHRASES = {{ "1", ["until, "so", "usually"]}} |
| 51 | + INPUT_TEXT = "So, I have not seen this. So, usually, I don't follow all trends." |
| 52 | + |
| 53 | +It will create the following output: |
| 54 | + |
| 55 | + frequencies: "until":0, "so": 2, "usually":1 |
| 56 | + |
| 57 | +## Problem 2 |
| 58 | +Based on the phrases in PHRASES, create a unique vocabulary of phrases, and generate a vector that |
| 59 | +represents the frequency of each phrase for the given text. |
| 60 | + |
| 61 | + |
| 62 | +For example, if we have the following: |
| 63 | + |
| 64 | + PHRASES = {{"1", ["until, "so", "usually", "so"]}} |
| 65 | + INPUT_TEXT = "So, I have not seen this. So, usually, I don't follow all trends." |
| 66 | + |
| 67 | +It will have the following output: |
| 68 | + |
| 69 | + vocabulary = ["so", "until", "usually"] |
| 70 | + vector = [2, 0, 1] |
| 71 | + |
| 72 | +# Logistics |
| 73 | + |
| 74 | +##1. Timeframe |
| 75 | + |
| 76 | +You should take a max of three hours to complete this exercise. We want to be |
| 77 | +both respectful of your time and fair to other candidates who might not have |
| 78 | +a whole weekend to work on it. |
| 79 | + |
| 80 | +##2. Git |
| 81 | + |
| 82 | +You will need to use git for this exercise. To get these instructions and a |
| 83 | +repo with test scripts do the following: |
| 84 | + |
| 85 | +1. [Create a Github account](https://github.com/join) if you don't already have |
| 86 | + one. For the examples below we assume a user `pusheen`. |
| 87 | +2. Clone our repository: |
| 88 | + |
| 89 | +``` |
| 90 | +# Using ssh |
| 91 | +$ git clone [email protected]:turnitin/java-coding-exercise-2.git |
| 92 | +
|
| 93 | +# Using https |
| 94 | +$ git clone https://[email protected]/turnitin/java-coding-exercise-2.git |
| 95 | +``` |
| 96 | + |
| 97 | +##3. Remote |
| 98 | + |
| 99 | +Once you are done you can put your solution in your own repository by adding it |
| 100 | +as a remote and pushing to it. |
| 101 | + |
| 102 | +1. Create a new repo via the github UI, let's assume you call it |
| 103 | + `java-coding-exercise-2` to mirror ours. |
| 104 | +2. If possible use a private repo. If you've run out of private repos on github |
| 105 | + them no worries, we'd just like to make sure that every candidate's work is |
| 106 | + his or her own. |
| 107 | +3. Add your repo as a remote and push: |
| 108 | + |
| 109 | +``` |
| 110 | +$ git remote add myrepo [email protected]:pusheen/java-coding-exercise-2.git |
| 111 | +$ git push myrepo master |
| 112 | +``` |
| 113 | + |
| 114 | +##4. Access |
| 115 | + |
| 116 | +Provide following users read access to your repository |
| 117 | + |
| 118 | +- skumar-tii |
| 119 | +- <> |
| 120 | + |
| 121 | +##5. Notify us |
| 122 | + |
| 123 | +At least a day before your in-person interview, email `[email protected]` |
| 124 | +your repo address. |
0 commit comments