Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 KB | None | 0 0
  1. Hi,
  2. We'd like you to complete a take-home coding exercise. This exercise is not meant to be tricky or complex; however, it does represent a typical problem faced by the HipChat Engineering team. Here are a few things to keep in mind as you work through it:
  3. * The position is for a front end developer. As a Desktop team, we work primarily with front-end technologies (React JS, LESS, etc). If you are not comfortable working with React, we encourage you to code your solution using the JS framework of your choice, otherwise https://github.com/facebookincubator/create-react-app is a good starting point.
  4. * There's no time limit; take your time and write quality, production-ready code. To us, production-ready means a solid UI, test coverage, good documentation, etc... Treat this as if you're a member of the HipChat Engineering team and are solving it as part of your responsibilities there.
  5. * Be thorough and take the opportunity to show the HipChat Engineering team that you've got technical chops.
  6. * Using frameworks and libraries is acceptable. We are looking for how you would solve a problem like this on the job. If that involves bringing in libraries then do so, and even better, tell us why you made the choice.
  7.  
  8. When you think it's ready for prime time, push your work to a public repo on Bitbucket or Github and send us a link.
  9.  
  10. Now, for the coding exercise...
  11. Please create a user interface that takes a chat message string as input and displays a JSON object containing information about its contents as described below.
  12.  
  13. Your service should parse the following data from the input:
  14. 1. mentions - A way to mention a user. Always starts with an '@' and ends when hitting a non-word character.
  15. 2. Emoticons - For this exercise, you only need to consider 'custom' emoticons which are alphanumeric strings, no longer than 15 characters, contained in parenthesis. You can assume that anything matching this format is an emoticon. (https://www.hipchat.com/emoticons)
  16. 3. Links - Any URLs contained in the message, along with the page's title. (We recommend https://cors-anywhere.herokuapp.com/ as a work-around for CORS errors)
  17.  
  18. The output should be a JSON object containing arrays of all matches parsed from the input string, displayed in the UI.
  19. For example, entering the following text should result in the corresponding outputs.
  20. Input: "@chris you around?"
  21. Output:
  22. {
  23. "mentions": [
  24. "chris"
  25. ],
  26. "emoticons": [],
  27. "links": []
  28. }
  29. Input: "Good morning! (megusta) (coffee)"
  30. Output:
  31. {
  32. "mentions": [],
  33. "emoticons": [
  34. "megusta",
  35. "coffee"
  36. ],
  37. "links": []
  38. }
  39.  
  40. Input: "Olympics are starting soon; http://www.nbcolympics.com"
  41. Output:
  42. {
  43. "mentions": [],
  44. "emoticons": [],
  45. "links": [
  46. {
  47. "url": "http://www.nbcolympics.com",
  48. "title": "2018 PyeongChang Olympic Games"
  49. }
  50. ]
  51. }
  52.  
  53. Input: "@bob @john (success) such a cool feature; https://twitter.com/jdorfman/status/430511497475670016"
  54. Output:
  55. {
  56. "mentions": [
  57. "bob",
  58. "john"
  59. ],
  60. "emoticons": [
  61. "success"
  62. ],
  63. "links": [
  64. {
  65. "url": "https://twitter.com/jdorfman/status/430511497475670016",
  66. "title": "Justin Dorfman on Twitter: "nice @littlebigdetail from @HipChat (shows hex colors when pasted in chat). http://t.co/7cI6Gjy5pq""
  67. }
  68. ]
  69. }
  70.  
  71. Good luck!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement