Guest User

Untitled

a guest
Apr 20th, 2019
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. A. Problem - Requirement:
  2. 1. Given an organization id, all the employees of the organization has to be returned.
  3. 2. Given an employee id, find and return the organization details.
  4.  
  5. Sample Data:
  6. var people = [{
  7. name: 'Sandeep',
  8. empId: 0,
  9. age: 23,
  10. orgId: 1
  11. }, {
  12. name: 'Arjun',
  13. empId: 1,
  14. age: 25,
  15. orgId: 2
  16. }, {
  17. name: 'Nanha',
  18. empId: 3,
  19. age: 22,
  20. orgId: 1
  21. }, {
  22. name: 'Nandu',
  23. empId: 4,
  24. age: 53,
  25. orgId: 3
  26. }];
  27.  
  28. var organizations = [{
  29. name: 'Razorthink',
  30. id: 1,
  31. employees: [0, 3]
  32. }, {
  33. name: 'Apple',
  34. id: 2,
  35. employees: [1]
  36. }, {
  37. name: 'Microsoft',
  38. id: 3,
  39. employees: [4]
  40. }];
  41.  
  42.  
  43.  
  44. B. Problem - Requirement: 1. Find the max vector in each quadrant of a graph given an array of points.
  45.  
  46. Sample Data:
  47. var points = [{x: 1, y: 1 }, {x: -1, y: 1 }, {x: -1, y: -1 }, {x: 1, y: -1 }, {x: 2, y: 2 }, {x: -1, y: 2 }, {x: -1, y: -2 }, {x: 1, y: -2 }, {x: 1, y: 6 }, {x: -1, y: 4 }, {x: -3, y: -1 }, {x: 1, y: -1 }, {x: 10, y: 1 }, {x: -1, y: 11 }, {x: -1, y: -1 }, {x: 1, y: -1 } ]
RAW Paste Data