TLDR; go ahead destroy me!! experience - 15+ java, includes 8+ android obligatory tc - just as my handle says, so there's that. returned from an fte interview today, was posed this problem to solve on white-board. i had previously solved this, at least 4 months ago ever since i began LCing hard. isIsomorphic("egg", "add") -> true isIsomorphic("foo", "bar") -> false before beginning to write the code, i started off with the discussion to set the ground rules, seeking multiple clarifications. is isomorphism uni-directional or bi-directional? of course bi-directional. however, there's two kinds of bi-directional. 1) 'e' can be replaced with 'a' from left-to-right, so 'e' can be replaced only with 'a' from right-to-left as well. 2) left-to-right and right-to-left, each independent uni-directional replacement at the same index need not match, although since we are checking both directions, it's still bi-directional. isIsomorphic("ab", "ca") -> true every time 'a' appears in the left input, there must be a 'c' in the right input. but every time 'a' appears in the right input, it does not have to be 'c' in the left input. LC establishes the second-rule. clarification with the interviewer, i was suggested the first-rule, although I did not verbally ask about the "ab", "ca" comparison. i write pseudo-statements for as many clarifications and ground-rules toward a corner of the white-board. based off the clarification i was given, i solved it wrong in LC standards. i won't get the job!!
So what was your solution?
absolute one-on-one char-mapping, irrespective of what character appears at an index in which input, left or right, the associated mapped character should be spotted at the same index in the other input. which is not how "ab", "ca" works. not coming up with "ab", "ca" sample input was my poor programming skills?
I still don’t get how “ab” “ca” is an edge case. All you need is mapping char to char.
Maybe you have bad communication skills (or are just frustrated and communicating over text is difficult) because I understand the problem pretty well but don’t understand your interpretation or how “ab”,”ca” is an edge case. A maps to c, b maps to a. The better edge case is something like abc, dff.
Which company?
Tech Industry
Yesterday
3348
I do tech screens at Google. AMA
Health & Wellness
9h
708
Issues with sleep
India
11h
2540
Why is it so G*damn difficult to move money out of India
Cars
Yesterday
1680
Cyber truck killer: Chinese version of EV truck
Ask Blinders
16h
648
Why Pronouns shit captured US ? I don’t see this anywhere else
Ok?