Skip to content

Instantly share code, notes, and snippets.

@loktar00
Created October 5, 2023 15:58
Show Gist options
  • Save loktar00/4e1089a14c8e29353ce41c8d72442d2d to your computer and use it in GitHub Desktop.
Save loktar00/4e1089a14c8e29353ce41c8d72442d2d to your computer and use it in GitHub Desktop.
Interview question
// Return an array of movies whos runtime is at least 100 minutes and is rated pg or pg 13
// In the new array we are only concerned with the title, runtime, and rating.
const data = {
"movies": [{
"id": "771315639",
"title": "Home",
"year": 2015,
"mpaa_rating": "PG",
"runtime": 93,
"release_dates": {
"theater": "2015-03-27"
}
}, {
"id": "771355806",
"title": "Insurgent",
"year": 2015,
"mpaa_rating": "PG-13",
"runtime": 119,
"release_dates": {
"theater": "2015-03-18"
}
}, {
"id": "771354922",
"title": "Furious 7",
"year": 2015,
"mpaa_rating": "PG-13",
"runtime": 140,
"release_dates": {
"theater": "2015-04-02"
}
}, {
"id": "771270966",
"title": "Cinderella",
"year": 2015,
"mpaa_rating": "PG",
"runtime": 105,
"release_dates": {
"theater": "2015-03-12"
}
}, {
"id": "771364722",
"title": "Get Hard",
"year": 2015,
"mpaa_rating": "R",
"runtime": 100,
"release_dates": {
"theater": "2015-03-27"
}
}, {
"id": "771380296",
"title": "It Follows",
"year": 2015,
"mpaa_rating": "R",
"runtime": 94,
"release_dates": {
"theater": "2015-04-03"
}
}, {
"id": "771407100",
"title": "Do You Believe?",
"year": 2015,
"mpaa_rating": "PG-13",
"runtime": 115,
"release_dates": {
"theater": "2015-03-19"
}
}, {
"id": "771353298",
"title": "Kingsman: The Secret Service",
"year": 2015,
"mpaa_rating": "R",
"runtime": 128,
"release_dates": {
"theater": "2015-02-13"
}
}, {
"id": "771386174",
"title": "The Second Best Exotic Marigold Hotel",
"year": 2015,
"mpaa_rating": "PG",
"runtime": 122,
"release_dates": {
"theater": "2015-03-06"
}
}, {
"id": "771362998",
"title": "Run All Night",
"year": 2015,
"mpaa_rating": "R",
"runtime": 114,
"release_dates": {
"theater": "2015-03-12"
}
}, {
"id": "771325854",
"title": "The Gunman",
"year": 2015,
"mpaa_rating": "R",
"runtime": 115,
"release_dates": {
"theater": "2015-03-19"
}
}, {
"id": "771360014",
"title": "McFarland USA",
"year": 2015,
"mpaa_rating": "PG",
"runtime": 129,
"release_dates": {
"theater": "2015-02-20"
}
}, {
"id": "771321013",
"title": "Focus",
"year": 2015,
"mpaa_rating": "R",
"runtime": 105,
"release_dates": {
"theater": "2015-02-27"
}
}, {
"id": "771357000",
"title": "American Sniper",
"year": 2015,
"mpaa_rating": "R",
"runtime": 134,
"release_dates": {
"theater": "2015-01-16"
}
}, {
"id": "771361762",
"title": "The SpongeBob Movie: Sponge Out of Water",
"year": 2015,
"mpaa_rating": "PG",
"runtime": 100,
"release_dates": {
"theater": "2015-02-05"
}
}, {
"id": "771311953",
"title": "The Patriot",
"year": 2001,
"mpaa_rating": "R",
"runtime": 110,
"release_dates": {
"theater": "2015-02-12"
}
}]
};
// Return an array of movies whos runtime is at least 100 minutes and is rated pg or pg 13
// In the new array we are only concerned with the title, runtime, and rating.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment