This is a verified interview question from Gs-(goldman-sachs). Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Deciphering a Hidden Message" covers key patterns like Other.
"Some mysterious drawings have been discovered near Stonehenge in UK, looking somewhat like this: After some analysis, it was concluded that the dots and rhombus represent the English alphabet. The first row's 5 dots represent A, B, C, D and E, the second row dots represent F, G, H, I, J and so on until Z is represented by the lone dot in the sixth row. The letter represented as a rhombus is considered the starting letter, and the navigation lines indicate the sequence of characters in the hidden word. To quickly figure out all the words, a program needs to be written. The image is represented as a grid, and navigation lines are represented using coordinates. Your task is to create a program to decipher the image and print the hidden message. The grid has 6 rows, each containing 5 elements. Every element of this grid is either 1 or 0, where 1 indicates the participation of that character in the message, and 0 indicates absence. The last 4 elements of the last row will always be 0. Each navigation line is represented by using 4 numbers in the following format x1 y1 x2 y2 i.e., the line goes from (x1, y1) to (x2, y2) where x1, y1 and x2, y2 represent the row and column values of characters in the 6x5 grid. Navigation coordinates start with (1,1) at top left and end with (6,5) at bottom right. The sequence of these navigation lines would determine the character sequence in the hidden message.  "
Join thousands of developers practicing for Gs-(goldman-sachs).