Google Software Engineering Interview: Serialize Strings

  Рет қаралды 21,233

Exponent

Exponent

Күн бұрын

Пікірлер: 25
@tryexponent
@tryexponent 3 жыл бұрын
Don't leave your career to chance. Sign up for Exponent's system design interview course today: bit.ly/3JXmRHk
@terreyshih1628
@terreyshih1628 4 жыл бұрын
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.
@tryexponent
@tryexponent 4 жыл бұрын
We're glad you liked it!
@deathbombs
@deathbombs 4 жыл бұрын
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
@liuauto
@liuauto 3 жыл бұрын
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
@utsavsharma2292
@utsavsharma2292 3 жыл бұрын
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).
@kumarc4853
@kumarc4853 3 жыл бұрын
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()
@nitinkale4985
@nitinkale4985 2 жыл бұрын
Got it thanks @kumar C
@aiayumi
@aiayumi 2 жыл бұрын
This is the standard solution for general serialization I think. Len:str. But using char to encode string length is smart.
@z08840
@z08840 2 жыл бұрын
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...
@Donutshop2365
@Donutshop2365 3 жыл бұрын
This approach may not work well in some languages, like C++, due to its unfriendly int to unicode conversion.
@j-espresso
@j-espresso 4 жыл бұрын
Hey @Exponent team? Based on this video, is it important to analyse time/space complexity when solving a problem during the interview?
@tryexponent
@tryexponent 4 жыл бұрын
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
@BrownGuru
@BrownGuru 3 жыл бұрын
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.
@NannanAV
@NannanAV 3 жыл бұрын
I think you missed the case when the number of characters exceeds 255..!
@astroleast
@astroleast 3 жыл бұрын
What if string contains numbers? Format won’t works
@binkygoh6787
@binkygoh6787 2 жыл бұрын
It works if the string contains numbers, as once we get the length of the word, we'll skip the next few characters.
@nehachauhan7488
@nehachauhan7488 4 жыл бұрын
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!!
@tryexponent
@tryexponent 4 жыл бұрын
Hey Neha! This might help: blog.tryexponent.com/pm-resume-checklist/
@joachimmartin
@joachimmartin 4 жыл бұрын
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.
@tryexponent
@tryexponent 4 жыл бұрын
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).
@wulymammoth
@wulymammoth 4 жыл бұрын
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
@harikuduva
@harikuduva 2 жыл бұрын
I thought it was a trie implementation... At least this way we can filter out the common characters.
@mehulgoel5875
@mehulgoel5875 4 жыл бұрын
Great video
@tryexponent
@tryexponent 4 жыл бұрын
Thank you!
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 7 МЛН
Accompanying my daughter to practice dance is so annoying #funny #cute#comedy
00:17
Funny daughter's daily life
Рет қаралды 20 МЛН
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 1,2 МЛН
Coding Interview | Software Engineer @ Bloomberg (Part 1)
30:05
Keep On Coding
Рет қаралды 4,7 МЛН
Amazon System Design Interview: Design Parking Garage
29:59
Exponent
Рет қаралды 1,4 МЛН
Software Engineer Mock Interview: 3 Sum Algorithm Problem
24:33
Google Coding Interview With A Facebook Software Engineer
49:59
Clément Mihailescu
Рет қаралды 946 М.
Why I Fail Candidates During Google Interviews.
5:40
Alex Nguyen
Рет қаралды 148 М.
Solving Meta's 2022 Most Asked Interview Question
11:40
AlgosWithMichael
Рет қаралды 18 М.
Medium Google Coding Interview With Ben Awad
51:27
Clément Mihailescu
Рет қаралды 1,3 МЛН