Data Structures & AlgorithmsVery hardProduct company OA · Amazon/Microsoft-style OA
In how many ways can a 3 x 4 grid be covered completely by non-overlapping 1 x 2 dominoes (each domino covers two adjacent cells, in either orientation)?
- A. 13
- B. 10
- C. 11
- D. 19
Correct answer: C. 11
A profile DP tracks which cells of the next column are already covered. The 3 x 4 grid has 11 domino tilings; a 3 x 2 grid has 3 and a 3 x 6 grid has 41, so the sequence grows by a fixed recurrence.
More Coding Interview Problems questions
- The universe {0, ..., 5} must be covered by a union of chosen sets from {0,1,2}, {2,3}, {3,4,5}, {0,4}, {1,5}. What is the minimum number…
- How many subsets (including the empty subset) of {1, 2, ..., 10} have a sum divisible by 3?
- From the values [3, 34, 4, 12, 5, 2, 19, 8], choose any subset (the empty subset allowed). What is the smallest possible value of |(sum of…
- Arrays A = [1, 2], B = [-2, -1], C = [-1, 2] and D = [0, 2] each have two entries. How many index quadruples (i, j, k, l) satisfy A[i] +…
- How many subsets of {1, 2, ..., 10} have a sum of exactly 10? The single-element subset {10} counts as one of them.
- A subset-sum question has n = 40 values. Splitting them into two halves of 20, how many subset sums must be enumerated for ONE half?