FastPrepCourse Schedule
Problems/Course Schedule

Course Schedule

Nykaa logoNykaa● MediumFULLTIMEPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamples

Problem statement

Source note: Reported in a Nykaa phone screen for a full-time role. The report points to a standard algorithm exercise. We chose the function interface, the limits, fixed rules, and the examples.

There are numCourses courses labeled from 0 to numCourses - 1. Each pair [course, prerequisite] means the prerequisite must be completed before the course.

Return true if all courses can be completed, or false if the prerequisite graph contains a cycle.

Interview Follow-up

The interviewer asked follow-up questions about alternative solutions, edge cases, and complexity analysis.

Function

canFinish(numCourses: int, prerequisites: int[][]) → boolean

Examples

Example 1

numCourses = 2prerequisites = [[1,0]]return = true

Example 2

numCourses = 2prerequisites = [[1,0],[0,1]]return = false

Each course requires the other first, creating a cycle.

Source note: Author-written prompt excerpt retained for source fidelity.

More Nykaa interview questions

  • Employees Who Earn More Than Their ManagersPHONE SCREEN · Seen Nov 2026
  • Longest Substring Without Repeating CharactersPHONE SCREEN · Seen Nov 2026
  • Remove Duplicates from Sorted ArrayPHONE SCREEN · Seen Nov 2026
  • Max Consecutive Ones IIIPHONE SCREEN · Seen Sep 2026
  • Reverse a String Keeping Dashes in PlaceONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Course ScheduleAmazon · PHONE SCREEN · ONSITE INTERVIEW
  • Course ScheduleBloomberg LP · PHONE SCREEN · ONSITE INTERVIEWBloomberg LP interview questions
  • Course Schedule FeasibilityTesla · PHONE SCREENTesla interview questions
  • Course ScheduleOracle · ONSITE INTERVIEWOracle interview questions
  • Course SchedulePlaud · ONSITE INTERVIEW
  • Course ScheduleFlexTrade · ONSITE INTERVIEWFlexTrade interview questions
  • Can You Finish All Courses?Intuit · OAIntuit interview questions
  • Can All Courses Be FinishedC3.ai · ONSITE INTERVIEWC3.ai interview questions
  • Trace Terminal Company OwnershipPalantir · ONSITE INTERVIEWPalantir interview questions
  • Task Build Order and File-Change RerunsVanta · PHONE SCREEN
All Nykaa interview questionsSee Nykaa hiring insights
Saved
class Solution {
    public boolean canFinish(int numCourses, int[][] prerequisites) {
      // write your code here
    }
}
Checking account…