Generate All Combinations from a Parameter Grid

Problem overview from a real Pinterest interview:

You are given a parameter grid as a 2D string array parameters. Each row has the form [key, value1, value2, ...]. Generate every configuration in the Cartesian product by choosing exactly one value from each row.

Check more interview questions and experiences about Pinterest

Please log in to view interview details