Today 19 Dec 2023, from 01:00 to 01:45 PM, I have a Google Phone Screen Interview
History
Since I am looking for a change I am facing lots of DSA rounds in interviews, and I failed in all
Hence I decided to learn DSA and then Apply,
Surprisingly I got a call from Google HR to explore an opportunity,
I was not prepared, but I wanted interview experience, Hence I proceeded unprepared :(,
Programming Language Used: Kotlin
Question
I felt easy/Medium Level questions during the interview
Q. Given a list of all files and folders, and list of selected files and folder
send selected compressed files or folder as input to CLI(Command Line Interface)
by the following condition
Samples, Input
val all_files = [
"a/b.txt",
"b/c.txt",
"b/d.txt",
"c/e.txt",
"c/f/a.txt",
"c/f/b.txt"
"c/g.txt",
"d/a/b.txt",
]
val selected_Files = [
"b/c.txt",
"b/d.txt",
"c/e.txt",
"c/f/a.txt",
"c/f/b.txt",
"d/a/b.txt",
]
Output: [
"b", <-- both files under folder 'b' is selected hence choose folder itself
"c/e.txt", <-- file 'e' selected but 'g' is not, hence choose a single file
"c/f" <-- all files under folder 'f' is selected hence chosen folder 'f'
"d" <-- all files and folders selected under 'd' folder
]
class Solution {
fun compressInput(allFiles: List<String>, selectedFiles: List<String>): List<String> {}
}The above example code shows what input(s) is/are provided and what to return,
Just for understanding purpose
Note:
Let's Grow by learning together
This is the first article hence, please forgive for any unknown mistake
Here my dry run during my interview, based on what I understood

Thanks