Python interview with a Microsoft engineer: Reverse string (but keep punctuation)

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


Рекомендации по теме
Комментарии
Автор

They can hear each other starting at 2:00

ThisAintMyGithub
Автор

Not sure if I was a big fan of the interviewer. He came across as more than a bit demeaning.
Like when he questioned her method of swapping variables at 10:14, and kinda made fun of her for forgetting the join() method at 13:30.

I'm sure this was unintentional by the interviewer, but this is the exact type of subtle behavior/language that can negatively affect computer science students/junior programmers, especially underrepresented groups such as women. I urge interviewers like this one to consider their tone and methods for communicating with interviewees, as we want potential candidates to feel supported, not ridiculed. I know this is just practice, but I hope interviewees at Microsoft don't go through this 😣.

Altogether though, I love this channel and check out every mock interview that I can!

TobiTheGreat
Автор

1. The interviewer gave a bad example.
2. Are people allowed to check syntax by running the code during an interview?

Charles-rnke
Автор

it *should be led* in this way:
1. an interviewee gets a task
2. then gets 5-10 mins to think over that problem to find some good and fast approach
3. and then they start talking, not just right away.

lukkash
Автор

"This, is a test!". Why is the reverse not "test! a is This, "

vigneshsoap
Автор

split_string = ['This', 'is', 'a', 'test!']

print (" ".join(split_string))
>> This is a test!

brettbreet
Автор

P1 -
def reverse_word(input_string):
return ' '.join([word for word in reversed(input_string.split(' '))])

P2 -
def
punctuation = [(pos, char) for pos, char in enumerate(input_string) if char.isalnum() == False and char != ' ']
words = ''.join([char for char in input_string if char.isalnum() == True or char == ' '])
clear_string = reverse_word(words)
for pos, mark in punctuation:
clear_string = clear_string[:pos] + mark + clear_string[pos:]
return clear_string


What other ways are there to tackle P2?

__Reaps
Автор

Could be done something like this, I guess.
def reverseString(input_str):
return " ".join([s for s in reversed(input_str.split(" "))])

sricharan
Автор

The interviewer made a mistake, confused poor soul :(

MinecrafterFlicker
Автор

def reverseString(input_str):

output = ""
for word in input_str.split(" "):
output = word + " " + output

print(output)

adeelsyed
Автор

This interviewer is mumbling, enunciate your words bro.

bigdizzle
Автор

def reverseString(input_str):
return input_str.split(" ")[::-1]

darwindpatel
Автор

Had no idea joaquin phoenix knew coding :p

neerajraut
Автор

The interviewee is not ready for the interview... Does not listen to the interviewer! Keep saying, huh??

MK-tzhg
Автор

This a massive waste of time. Coding interviews are just an anti-pattern.

ManuelMontoyaRdz
Автор

I believe she is an intelligent girl but her approach to the problems were harder than normal. She needs to learn how to take different approaches from an interviewer

menaagina