Have your been Asked this question in a phone interview before?( LC 568 maximum vacation days)

Goldman Sachs bhaktard
Oct 9 19 Comments

I got in a mock interview and I took whole time coming up with the solution.๐Ÿ˜ญ
LC 568 maximum vacation days

Have your been Asked this question in a phone interview before?( LC 568 maximum vacation days) Have your been Asked this question in a phone interview before?( LC 568 maximum vacation days)

comments

Want to comment? LOG IN or SIGN UP
TOP 19 Comments
  • NVIDIA acfm
    Might help to actually say what question you got asked

    Edit: Thanks OP for posting snifflesโ€™ screen
    Oct 9 1
    • Goldman Sachs bhaktard
      OP
      Sorry it's a long description don't know if people would read
      Oct 9
  • Goldman Sachs pollydrai
    Simple DP
    Oct 9 4
  • Sphera sniffles
    Did you steal my screenshots!?
    Oct 9 1
    • Goldman Sachs bhaktard
      OP
      Yes.๐Ÿ˜„
      Oct 9
  • Well itโ€™s locked on leetcode so letโ€™s hear a description
    Oct 9 1
  • Yes, from FANG ๐Ÿ˜’.

    LeetCode wants to give one of its best employees the option to travel among N cities to collect algorithm problems. But all work and no play makes Jack a dull boy, you could take vacations in some particular cities and weeks. Your job is to schedule the traveling to maximize the number of vacation days you could take, but there are certain rules and restrictions you need to follow.

    Rules and restrictions:

    1. You can only travel among N cities, represented by indexes from 0 to N-1. Initially, you are in the city indexed 0 on Monday.

    2. The cities are connected by flights. The flights are represented as a N*N matrix (not necessary symmetrical), called flights representing the airline status from the city i to the city j. If there is no flight from the city i to the city j, flights[i][j] = 0; Otherwise, flights[i][j] = 1. Also, flights[i][i] = 0 for all i.

    3. You totally have K weeks (each week has 7 days) to travel. You can only take flights at most once per day and can only take flights on each week's Monday morning. Since flight time is so short, we don't consider the impact of flight time.

    4. For each city, you can only have restricted vacation days in different weeks, given an N*K matrix called days representing this relationship. For the value of days[i][j], it represents the maximum days you could take vacation in the city i in the week j.

    You're given the flights matrix and days matrix, and you need to output the maximum vacation days you could take during K weeks.
    Oct 9 0
  • Amazon 8yf5uD
    If a company asks you this on the phone interview, don't go to that company. From what I've interviewed, questions are generally on the easy-medium side in most interviews. If it's hard, you'll be given sufficient hints and your thought process will be tested rather than getting the answer. If all of us stop over-Leetcoding interviews might actually become easier.
    Oct 9 2
    • Goldman Sachs bhaktard
      OP
      Actually this was on interviewing.io and the interviewer was from Amazon.๐Ÿ˜„. He was a SDM.
      Oct 9
    • Amazon 8yf5uD
      Okay Amazon SDMs don't code so ignore this question.
      Oct 9
  • Sphera sniffles
    Oct 9 1
  • Is the question in the title? I am confused.
    Oct 9 1
    • Goldman Sachs bhaktard
      OP
      Sorry LC 568 maximum vacation days
      Oct 9

Salary
Comparison

    Real time salary information from verified employees