Skip to content

Instantly share code, notes, and snippets.

@calo81
Last active December 2, 2019 10:04
Show Gist options
  • Save calo81/02e23976caad3debf5d5cb3ac24facd5 to your computer and use it in GitHub Desktop.
Save calo81/02e23976caad3debf5d5cb3ac24facd5 to your computer and use it in GitHub Desktop.
simplified twitter excercise

Objective:

  • We want to see your coding and pairing practices.
  • Imagine this is a ral world example. So use your usual practices

given this:

{
 id: 1,
 name: 'john',
 tweets: [
   {id: 1, content: 'I love insurance'},
   {id: 2, content: 'insurance is good'},
 ]
},
{
 id: 2,
 name: 'luis',
 tweets: [
   {id: 1, content: 'I love donuts'}
 ]
},
{
 id: 3,
 name: 'pedro',
 tweets: [
   {id: 1, content: 'Donuts are good...'},
   {id: 2, content: ... but insurance is best'},
 ]
}

Based on the number of times the word insurance is mentioned in their tweets, compute their "insurance score":


[
{id: 1,  name: 'john', score: 2},
{id: 2,  name: 'luis', score: 0},
{id: 3,  name: 'pedro', score: 1}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment