Don't leave your career to chance. Sign up for Exponent's system design interview course today: bit.ly/3JXmRHk
@deathbombs4 жыл бұрын
very fast, but I feel like he knows the answer from experience, rather than having to come up with the algorithms on the spot. adding encoding to string is not something most people will invent without a hint
@terreyshih16283 жыл бұрын
This is one of the best videos I have seen on coding interview questions. The answer is actually not just about homework like data structure and algorithm questions but it involves real world industry software API design skills. This is a skill that'd distinquish a junior and senior level engineers. Kudos to you on showing this. In addtion, the way he answered your question by factoring in all the considerations from a "software system" perspective gives us an idea of the level of discussion and commiunication that is needed in a FANG level coding interview.
@tryexponent3 жыл бұрын
We're glad you liked it!
@liuauto3 жыл бұрын
If we already know the bits length of a number say a 32 bit integer, then we can encode each 8-bit segment into a char. So it will use 4 chars for each number
@utsavsharma22923 жыл бұрын
The solution is incorrect and the deserialize method will not work for strings of length >= 16, since you are assuming that the length encoding is going to a single character. So, it will only support strings of length till 0xF (= 15).
@kumarc48533 жыл бұрын
We are not encoding the string with chr() but the length of the string . And length of the string is at most 64k, and that can be mapped to a char with chr()
@nitinkale49852 жыл бұрын
Got it thanks @kumar C
@aiayumi2 жыл бұрын
This is the standard solution for general serialization I think. Len:str. But using char to encode string length is smart.
@z088402 жыл бұрын
2:53 it's a nonsense - if you have a string of length 64000 you don't worry that number representation of its length is too long...
@Donutshop23653 жыл бұрын
This approach may not work well in some languages, like C++, due to its unfriendly int to unicode conversion.
@BrownGuru3 жыл бұрын
the problem with this approach is how will one know all the elements of the list were serialized. He needs to add the length of the list in the beginning to.
@j-espresso4 жыл бұрын
Hey @Exponent team? Based on this video, is it important to analyse time/space complexity when solving a problem during the interview?
@tryexponent4 жыл бұрын
Hey @Kevin Juma, we think it is important - and great to bring up on your own! We discuss it briefly in this video around 6:30
@NannanAV3 жыл бұрын
I think you missed the case when the number of characters exceeds 255..!
@astroleast3 жыл бұрын
What if string contains numbers? Format won’t works
@binkygoh67872 жыл бұрын
It works if the string contains numbers, as once we get the length of the word, we'll skip the next few characters.
@joachimmartin4 жыл бұрын
Why does serialize() use an array to collect serialized values instead of string concatenation? I'm not a python programmer, is array join() faster? I would think in 2020 string concat has been optimized. The overhead of maintaining the array for a large list and then converting to string must be higher than just using a string.
@tryexponent4 жыл бұрын
Hey @Joachim Martin, good question. It's still considered more "pythonic" to use join, though you're likely right about optimizations nowadays. As with anything in interviewing, the important thing is that you're able to justify your technical choices. Check out Google's python style guide for other best practices (google.github.io/styleguide/pyguide.html#310-strings).
@wulymammoth4 жыл бұрын
Depends on the VM, but joining a list seems to remain the fastest, but it's most notable on PyPy -- blog.ganssle.io/articles/2019/11/string-concat.html
@nehachauhan74884 жыл бұрын
Hi Exponent Team , What are your thoughts on PM Portfolio ? For a person like me , trying to break in into Product Management , how creative or crucial is it to present a PM portfolio alongside my CV ? P.S. Really insightful courses, Thankyou!!
@tryexponent4 жыл бұрын
Hey Neha! This might help: blog.tryexponent.com/pm-resume-checklist/
@mehulgoel58754 жыл бұрын
Great video
@tryexponent4 жыл бұрын
Thank you!
@harikuduva2 жыл бұрын
I thought it was a trie implementation... At least this way we can filter out the common characters.