Clarify the definition of a blank space cell (e.g., ' ' vs '.' vs '0') and confirm whether the grid should be modified in-place or a new grid returned. Then iterate through each cell, replacing blanks with '*' while leaving wall characters unchanged, and print or return the result.
Pro tip: Mention that you would handle edge cases like empty grid, null input, and non-rectangular grids, and discuss time/space complexity (O(m*n) time, O(1) extra space if in-place).
Ask the interviewer to define what constitutes a blank space (e.g., ' ', '.', '0') and whether the transformation should be in-place or produce a new grid.
Check for null or empty grid, and consider if rows can have different lengths (jagged arrays).
Loop through each row and column; if the cell is a blank space, replace it with '*'; otherwise leave it unchanged.
Print the modified grid row by row, or return the new grid if not modifying in-place.
State that the time complexity is O(m*n) where m is rows and n is columns, and space complexity is O(1) if in-place, else O(m*n) for a new grid.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.