Company: American Express

Difficulty: easy

Problem Statement

Archive File Audit You are given a string containing a detailed listing of files. Your task is to evaluate a simple query over a certain subset of them. The string consists of N lines separated by end-of-line characters (ASCII code 10). Each line describes one file in three columns: date , size and name , in that order. Every column except the last has a fixed length, and the columns are separated by exactly one space. The date column has length 10 and holds the last modification date of the file in the format yyyy-mm-dd . The size column has length 10 and holds the size of the file in bytes, aligned to the right and padded on the left with spaces. The size is less than 2^31 bytes. The name column has variable length and holds the name of the file. A name is made of at most 255 printable ASCII characters and contains at least one dot. The part of the name after the last dot is called the extension . File names are case-sensitive and may themselves contain spaces. We are interested only

More American Express OA questionsInterview experiences