Katkat

Parse password from indexed matrix file

InstacartSoftware Engineer · Onsite

Last updated

This question evaluates file parsing, matrix indexing with a specified coordinate origin, handling multiple indexed blocks, and string assembly into an ordered password, testing competencies in file I/O, coordinate transformations, and robust input handling.

Question

Given a filepath to a text file containing one index line [x, y] followed by a matrix of characters (origin at lower-left (0, 0)), return the character at coordinate (x,y). Extend to multiple (index, matrix) blocks in the same file: for each block read the character and prepend it to a password string using its index order, then return the password. If the file contains several passwords, stop after constructing the first complete password and return it.