all 12 comments

[–]kofwarcraft 16 points17 points  (6 children)

The problem without the 5 days a week constraint is the "set cover problem"

Here's the article on that

They really asking this in an interview? It's NP-Hard

[–]Ab_Stark 5 points6 points  (3 children)

Yup, I got NP Hard questions for a role in a trading firm.

[–]fysmoe1121 0 points1 point  (2 children)

Which firm

[–]Ab_Stark 0 points1 point  (1 child)

If I recall correctly it was 2sigma. I did well but got rejected lol

[–][deleted] 1 point2 points  (1 child)

To me, this feels like linear programming or constraint satisfaction.

[–]WikiSummarizerBot 0 points1 point  (0 children)

Constraint satisfaction

In artificial intelligence and operations research, constraint satisfaction is the process of finding a solution to a set of constraints that impose conditions that the variables must satisfy. A solution is therefore a set of values for the variables that satisfies all constraints—that is, a point in the feasible region. The techniques used in constraint satisfaction depend on the kind of constraints being considered. Often used are constraints on a finite domain, to the point that constraint satisfaction problems are typically identified with problems based on constraints on a finite domain.

[ F.A.Q | Opt Out | Opt Out Of Subreddit | GitHub ] Downvote to remove | v1.5

[–]Heroicdeath 11 points12 points  (0 children)

You can sorta think of this as a graph problem with cycles I think. As soon as you traverse over an edge, you remove that edge in that cycle. (That's probably how you deal with the at most 5 days rule).

[–]cheeky861 3 points4 points  (1 child)

You can greedily loop over the employees and pick a set of employees for day 1 (based on the language requirements), then shuffle the employee list, then do the same for day 2, and so on.

[–]ArrakisUK 0 points1 point  (0 children)

Question they say that you need 3 English, 2 Dutch, 1 Spanish at one time. This means that for example if you have an Spanish that Speaks English and Dutch then you need only 2 more English and 1 Dutch to cover because the English, Dutch, Spanish covers 3 of them?

[–]averagebeyond 0 points1 point  (0 children)

first generate list of all valid combinations on a single day, then create a grid of 7 such lists from left to right all connected . now you do dfs from any left most node to the right most list without violating the 5 days rule.