Google Software Engineering Interview: Serialize Strings

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

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
@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
@terreyshih1628
@terreyshih1628 3 жыл бұрын
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 3 жыл бұрын
We're glad you liked it!
@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.
@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.
@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
@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.
@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
@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/
@mehulgoel5875
@mehulgoel5875 4 жыл бұрын
Great video
@tryexponent
@tryexponent 4 жыл бұрын
Thank you!
@harikuduva
@harikuduva 2 жыл бұрын
I thought it was a trie implementation... At least this way we can filter out the common characters.
Software Engineer Mock Interview: 3 Sum Algorithm Problem
24:33
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 78 МЛН
小路飞还不知道他把路飞给擦没有了 #路飞#海贼王
00:32
路飞与唐舞桐
Рет қаралды 77 МЛН
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 112 МЛН
Google Interview Experience | Accepted... then Rejected
17:23
Keep On Coding
Рет қаралды 397 М.
I Asked Google Software Engineers How To Get Hired
10:31
Sajjaad Khader
Рет қаралды 37 М.
Google Coding Interview With A Facebook Software Engineer
49:59
Clément Mihailescu
Рет қаралды 943 М.
System Design Interview Walkthrough: Design Twitter
23:04
Hello Interview - SWE Interview Preparation
Рет қаралды 60 М.
Design Twitter - System Design Interview
26:16
NeetCode
Рет қаралды 524 М.
5 Signs of an Inexperienced Self-Taught Developer (and how to fix)
8:40
Perfect Pitch Challenge? Easy! 🎤😎| Free Fire Official
00:13
Garena Free Fire Global
Рет қаралды 78 МЛН