[IMP] Facebook | E4/5 | London
Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-01-06Added By Anonymous
Source: Link
Company: Meta (Facebook)
Role: E4/E5
Interview Stage: Phone Screen
Location: London
Year: unknown
Original Post Content:
Given environment variables & string pattern which uses vairables, return final formated string by substituting environment variable values. Design Lib for this.
Input -
Environment variable -
"PYTHON" : "/lib/python/bin"
Pattern :
"/username/%PYTHON%"
Output -
"/username/lib/python/bin"
I was able to solve this but not able to complete the code.
Time complexity - O (n^2) where n is length of pattern & length of param
Environment varaible can have variables too which made it little complex.
Answer & Time complexity in the comment will be appreciated.