Amazon Written Test May 2019 Software Development Engineer I
There are a total of n courses you have to take, labeled from 0 to n-1.
Some courses may have prerequisites, for example, to take course 0 you have to first take course 1, which is expressed as a pair: [0, 1]
Given the total number of courses and a list of prerequisite pairs, is it possible for you to finish all courses?
Examples:
Input: 2,
[1, 0]
Output: trueExplanation: There are a total of 2 courses to take.
To take course 1 you should have finished course 0. So it is possible.
Input: 2, [[1, 0], [0, 1]]
Output: false
Explanation: There are a total of 2 courses to take.
To take course 1 you should have finished course 0, and to take course 0 you should also have finished course 1. So it is impossible.
Recommended Posts:
- Amazon Interview Experience | Software Development Engineer II
- Amazon Interview | Set 58 (On-campus for Software Development Engineer)
- Amazon Interview Experience | Set 323 (Software Development Engineer - Off-Campus)
- Amazon Interview Experience | Set 256 (Written Test for SDE1)
- MAQ Software Interview Experience | Set 12 (Written Test)
- Barclays Interview Experience | Set 1 (On-Campus Written Test for Software Engg)
- How to Prepare for Amazon Software Development Engineering Interview?
- Cadence interview Experience | Software Development Engineer
- Jabong Interview Experience for Software Development Engineer
- Sapient on campus recruitment (Associate Software Development Engineer 2)
- Sapient | campus selections for Associate Software Development Engineer I
- Snapdeal Interview Experience | Set 16 (Off-Campus for Software Development Engineer)
- Sigmoid Recruitment Process for ASDE (Assistant Software Development Engineer) on Campus NIT Patna
- Ittiam Written Test Questions
- Citrix Interview | Set 2 (Written Test Experience)
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



