Currency Conversion Interview Problem (Python)

preview_player
Показать описание

Currency Conversion is where you take an array of conversion rates and find the conversion rate that maps the 'from' currency to the 'to' currency for every single query. This is a mock interview with a Microsoft engineer in Python. Although it sounds easy, this question is quite tricky!

The solution uses a bidirectional weighted graph and BFS. Keep an eye out for how the interviewee deals with edge cases and breaks down the problem!

TIMESTAMPS
00:00 Start
01:10 Introductions
04:54 Starter Question - Group Anagrams
16:30 Main Question - Currency Conversion
51:50 Feedback
Рекомендации по теме
Комментарии
Автор

It seems like for the currency conversion question, the candidate has made from as to and to as from. I suppose his convention seemed a bit confusing. Was it actually that from according to him is to and to according to him is from? Did any others feel the same? Inputs are appreciated.

koushika
Автор

What about the scenario where we have multiple paths from source to the destination: query: USD->GBP and 3 paths from USD to GBP exist in the graph
1. USD->JPN->GBP, 2. USD->INR->GBP and 3. USD->CHN->GBP.
Should we return the max conversion possible.

QDem
Автор

i never can understand whos interviewing who

I am chinese by the way

Cyborg