Тёмный
Gordon Zhu
Gordon Zhu
Gordon Zhu
Подписаться
I make problem-solving videos that are disguised as coding tutorials. Previously at Google and the University of Pennsylvania.
Ransom Note - LeetCode 383 - Python
9:15
Месяц назад
Valid Anagram - LeetCode 242 - Python
14:17
Месяц назад
Contains Duplicate - LeetCode 217 - Python
9:53
2 месяца назад
Two Sum - LeetCode 1 - Python
13:15
2 месяца назад
Two Sum | LeetCode 1 | JavaScript | Easy
13:20
9 месяцев назад
Комментарии
@ChrisAthanas
@ChrisAthanas 10 часов назад
Wish you still had your free courses available I sent many students to you and most of them became customers of yours
@sleepybraincells
@sleepybraincells День назад
Damn this is really insightful
@GordonZhu
@GordonZhu День назад
Thank you! Is there a specific part that stood out?
@sleepybraincells
@sleepybraincells День назад
@@GordonZhu I think it's the perspective shift that, DSA questions are not just for testing your knowledge in DSA, but actually to test your general problem-solving abilities; something that takes longer to cultivate. Also, the way you explained how companies need to filter down candidates made sense; it feels less unfair now.
@GordonZhu
@GordonZhu 19 часов назад
@@sleepybraincells Thank you -- that's helpful. It's good for me to understand what messages are getting through.
@sleepybraincells
@sleepybraincells День назад
Nice video
@GordonZhu
@GordonZhu День назад
Thank you!
@sleepybraincells
@sleepybraincells День назад
This channel is so underrated
@GordonZhu
@GordonZhu День назад
Thank you! That means a lot.
@mbabuskov
@mbabuskov 4 дня назад
4. Reliably get easy-to-maintain solutions
@jcroyoaun
@jcroyoaun 6 дней назад
very useful content as ever, I'm going to send this to a few folks that I know have been struggling with interviews lately. btw: Wish I could get an interview for Evil Corp :(, they're just ignoring my resume
@GordonZhu
@GordonZhu 6 дней назад
Thank you jcroyoaun! Haha everyone wants to work at Evil Corp. Also, this advice applies to everything, resumes included. Highly recommend asking your your most competent yet harshest friend to tear it apart a few times :)
@CallousCoder
@CallousCoder 7 дней назад
I guess my GenX generation and my parents (boomer and silent generation) know how to efficiently program. Because we actually developed significant programs on assembly. Doing that forces you to do write, small to the point functions. If you don’t, the program will not get finished as complexity will grind everything to a hold.
@jameslucas5590
@jameslucas5590 7 дней назад
Requirements gathering is skill and constant dialog through all iterations. Design patterns are important.
@monkemode8128
@monkemode8128 8 дней назад
I think this is one advantage I have as a self-taught programmer with the sole focus of being self-employed. My goal is generating income or sell and with selling it's better to have well designed stuff that doesn't take such specialized knowledge. I've had to deal with my code later, the process of deploying it, everything, so... I've learned the value of cleaner code, tests, documentation, and GOOD ABSTRACTIONS. Idek how to systematize learning that, but I just try to anticipate as many use cases as possible and then assume that there are even more, I don't understand. Then I can start designing and making tradeoffs knowing how it'll impact usage.
@PixelKnight93
@PixelKnight93 9 дней назад
this is exactly how I've been approaching programming. it's not enough to have something that works it should be organized and structured in an intuitive way so your peers don't get lost in your codebase
@GordonZhu
@GordonZhu 9 дней назад
What did you think about my analysis at 8:02?
@TheIllerX
@TheIllerX 10 дней назад
Agreed. It is an art to write good code without tons of dependencies and unnecessary complexities. Simple interfaces with as simple types as possible is typically the way to go. And of course to structure the code so that each function and class has a clear purpose without side effects. There is also one very important issue which is pretty hard to get right and that is to make code so that you, without too much trouble, can add and expand the functionality. Also preferably while keeping backward compatibility. Predicting the future needs is very hard though. There is two main mistakes you can do here. 1. Not preparing enough for new features. Example: You have a setting where two options are possible, use the feature or not, so you use a logical toggle on/off for that feature. Then you later on realize that you can have two, or more, different variants of this feature and would need some enum input instead. But then you would break backward compatibility by changing it. So you have a problem, often resulting in doing a "new" variant with different signature, which in time leads to a spam of variants of the same function. 2. Preparing too much for the future. It is also easy to overdo the future proofing step and add tons of general options which might be used one day, but not right now. This often results in complicated interfaces where you have to add a lot of input you really are not interested in. Also, the actual extra functionality you will eventually need in the future will typically be different from what you predicted making the situation even worse.
@ClokworkGremlin
@ClokworkGremlin 11 дней назад
I always try to make sure I understand the code before I check it in. This means I'm slower writing a solution, and it often makes my code slower and bigger, but at the end of the day, I *KNOW* that when I change one part of the program, it's not going to break something in an unrelated part of the project.
@johneyon5257
@johneyon5257 11 дней назад
whew - boring
@rursus8354
@rursus8354 11 дней назад
From one teacher to another: this misses the point, that everybody either know nothing about or take for granted. The student shall have a working small-step methodology that leads them past making mistakes, and where they can successively improve the quality from 1, via 2, to point 3. Nobody conceives a program out of a vacuum, everybody develops code in dialogue, and when they communicate they improve the solution in direction to point 3 if their methodology is correct.
@maximosh
@maximosh 11 дней назад
Crowdstrike overlooked a simple overflow buffer error.. then never tested the rollout of the update on fewer than a global amount of computers.. Obviously number 3 isn't so important.
@ledelste
@ledelste 12 дней назад
The third thing you want - after it working, and being fast enough - can be put different ways, you can call it design, other things, but the effect of it is that the cost of making the product do more - adding features or however you want to put it - doesn’t go up too much over time. Modularity may be close to a complete description of this quality. And the key to it is having the right abstractions. (And generally there isn’t one perfect one.) Most developers can use an abstraction and maybe specialize it. A fraction of them can invent/deduce/whatever the right new abstractions that will maintain your modularity over a long period of time and keep the cost of adding new features low.
@nfaza80
@nfaza80 12 дней назад
Levels of Programming Mastery This analysis deconstructs the concept of "levels" in programming proficiency, exploring the nuances and interconnected nature of these stages. **I. The Perceived Levels** The speaker outlines a progression that appears linear at first glance, but later reveals itself to be more multifaceted: 1. **Basic Functionality:** The initial hurdle involves simply getting code to work. This stage is marked by: - **Struggle with syntax and basic concepts:** Beginners grapple with the fundamentals of a programming language. - **Focus on achieving desired output:** The primary goal is to make the code function, even if it's not elegant or efficient. 2. **Performance Optimization:** Once basic functionality is mastered, the focus shifts to efficiency. This stage involves: - **Understanding algorithms and data structures:** Programmers learn to analyze and optimize code for speed and resource usage. - **Prioritizing efficient solutions:** Emphasis is placed on finding the fastest and least resource-intensive solutions. 3. **Elegant Design:** This level, often overlooked, emphasizes clarity and simplicity. It entails: - **Striving for conceptual clarity:** Code is treated as a medium of communication, aiming for readability and understandability. - **Prioritizing maintainability and extensibility:** Solutions are designed to be easily modified and extended in the future. **II. The Interconnected Nature of Mastery** While presented as levels, these stages are intricately interwoven. * **Good Design Fosters Correctness:** Well-structured code is inherently easier to debug and maintain, making it more likely to be correct. * **Clear Understanding Enables Performance:** A deep understanding of the problem and the chosen solution paves the way for effective optimization. * **Solid Foundations Support Complexity:** Mastering basic concepts and design principles is crucial for tackling complex problems, which are essentially collections of simpler ones. **III. The Importance of Foundational Strength** The speaker emphasizes the critical role of mastering the basics: * **Early Struggles Indicate Future Challenges:** Difficulty in achieving clean and simple solutions for basic problems is a red flag, signaling potential difficulties with more complex tasks. * **Simplicity Creates Headspace for Higher-Level Thinking:** Automating and simplifying foundational elements frees up cognitive resources to focus on design and optimization. * **Strong Foundations are Building Blocks:** Just as a skyscraper relies on a sturdy foundation, complex software depends on well-designed and implemented basic components. **IV. Beyond the Levels: A Multidimensional Perspective** Instead of discrete stages, programming mastery can be viewed as a continuous journey of improvement across multiple dimensions: * **Technical Proficiency:** Mastering language syntax, algorithms, and data structures. * **Problem-Solving Skills:** Developing the ability to break down complex problems into smaller, manageable components. * **Design Thinking:** Cultivating a mindset focused on clarity, simplicity, and elegance in code. **V. Key Takeaways** * **The pursuit of elegance in code is as important as functionality and performance.** * **Strong foundational skills are crucial for long-term success in programming.** * **Programming mastery is an ongoing process of improvement across multiple dimensions.** This detailed breakdown provides a comprehensive understanding of the "levels" of programming proficiency, emphasizing the interconnectedness of skills and the importance of continuous learning and refinement.
@stratuspei9405
@stratuspei9405 12 дней назад
There are software problems whose best/ideal (or very close to ideal) solutions are already known because of prior work. There are problems that can take an hour to figure out the best solution for. There are those that can take a week or two. There are those that can take longer, like months. There are problems whose best solution have never been identified even after years and years.
@georgesealy4706
@georgesealy4706 12 дней назад
I worked in the corporate environment for about 30 years. The biggest failing I have seen is that people program for the 'happy path' and forget about exception handling. When you have code being used across an enterprise by thousands of people and perhaps customers, then the developer has to have the attitude that the code can't fail. It must handle a variety of situations, even unforeseen situations, gracefully. Yes, writing code from an academic perspective is great. However, there is also the reality side that can be overlooked.
@RobertSmith-gu7qo
@RobertSmith-gu7qo 12 дней назад
A lot to be said for the KISS paradigm(?).
@mc4ndr3
@mc4ndr3 12 дней назад
Red Green Refactor If an employer ever hears of this concept, I'd apply.
@prohacker5086
@prohacker5086 12 дней назад
Nobody cares about the 3rd part in the business. Only teachers care about it.
@poketopa1234
@poketopa1234 12 дней назад
I think this is a really good framework for understanding SWE progression
@tincustefanlucian7495
@tincustefanlucian7495 13 дней назад
In reality there are more levels. You need to document the code, to explain not only what does the function, most important is to explain why it's doing it, what logic requires it, what datatypes enter and what exits. You need to cover well the logging to show the call stack if error occurs and clear error messages and to make clear the source of the log, like in API logging to know who did it, when and what exactly did, how it failed. You should make code easy to read, because many will read it after it's created, don't use complex constructs, do the things in the natural way.
@981porsche3
@981porsche3 13 дней назад
The most frustrating thing for me as a software engineer is that people do not take the time to architect the solution (frustrating because I am picking up after them). Software engineers usually just jump into coding without really thinking about the overall design-the actual engineering. To me, it’s the most important part, and it ends up making all the other code you write fall into place much more easily.
@KeithRowley418
@KeithRowley418 13 дней назад
This is fantastic advice. As an engineer I would always focus on'first, just get it going', to demonstrate the principle. Once done and accepted, i would throw that code away and start fro scratch to get it done properly. As an engineering manager, I once had to fire someone who couldn't upgrade his own very slow code - he was so reliant on a a particular method and set of tools that there was no way forward for him. So take this advice from Gordon to heart!
@abogdzie
@abogdzie 13 дней назад
He is right, but philosopher anyway. Reality and limited budget not always allow to be so perfect. And not always it may be so simple.
@dakrontu
@dakrontu 13 дней назад
Most of my best ideas come while lying in bed. One particular solution came in a dream, and I was lucky to remember enough to act on it. Another place to have good ideas is the shower, complicated by the fact that you can't have a notepad or voice recorder or mobile phone with you. Sometimes, after wrestling with a crap idea on how to do something, you realise the desperation of persisting with it, and that sets off the subliminal thought processes that lead to the aforementioned ideas popping up, not always at times when you could write them down. I developed the practice of writing down every idea before it disappears again, partly because it might be useful, as a memory jogger if nothing else, and partly because of the anxiety reduction that follows having got it onto permanent storage so you don't have to try desperately to not forget it. Late at night when sleep is on its way, imagination is approaching its height, kicking off a torrent of ideas, if you happen to be in the right mood, with some bee in your bonnet at the time. I suspect that is why so many programmers do their best work after midnight. I remember reading somewhere that that is true of about half of all programmers. If anyone has any more accurate info, please enlighten us.
@fredrikbergquist5734
@fredrikbergquist5734 13 дней назад
My employer only want to pay me for 1 and 2! 😂
@atsanonwadsanthat166
@atsanonwadsanthat166 14 дней назад
Salesforce, take notes.
@wayneyeo186
@wayneyeo186 14 дней назад
The first step is come up with a list of testable requirements. Analyze how all the bits fit together, then design effective maintainable modules, then the coding step, with a full set of coding standards! It needs to be maintainable. Test the devil out of it. Does it pass all the requirements tests? Pass it off for user testing.. write user manuals... everything signed off, schedule the release.. this is the pint sized version of 400ish pages of software development standards for all levels.
@IntangirVoluntaryist
@IntangirVoluntaryist 14 дней назад
I call it "elegant" solutions
@MrIoes-xh4sr
@MrIoes-xh4sr 14 дней назад
Agreed, but its not the programming, what is the key. A perfect Business process design needs to be done first, it leads to those kind of clear Data and technical Design, what then completes a mostly perfect App when done with those programming skills you mentioned.
@smiechu47
@smiechu47 14 дней назад
How are you gonna test for this skill in a job interview? Lol. Good looking bullshitters get the jobs.
@profikid
@profikid 14 дней назад
Make it work, make it right, make it fast.and premature optimisation is the mother of a FUs
@TerjeMathisen
@TerjeMathisen 15 дней назад
I've been a programmer for 47 years now, to me the best possible code is the one where the design is such that there are no exceptions, there are no inline branches, nothing to slow down the CPU pipeline(s). For many years I had word count (wc) as my benchmark program on every new (x86) microarchitecture: As I went from 8088 via 286, 386 and 486 to Pentium, my "optimal" code changed for every CPU iteration. Finally, on the Pentium I found that I could create a state machine which consistently handled two input characters every three clock cycles, counting lines, words and characters while allowing user-specified word and line separators. That code broke completely (performance-wise) on the PentiumPro, so I had to switch to a model where I have 4-5 different algorithms and benchmark them all on the first 4kB of input before deciding which one to use on the remaining data. It is only after the advent of utf8 everywhere that I have felt the need to revisit that 25+ year old code. My point here is that what you call Level 3 is what I term elegance, something many (most?) programmers are unable to recognize when they see it.
@TheBrain2K
@TheBrain2K 15 дней назад
What about 4. Maintainability/Readability? Even well-designed and working code can often be a nightmare to read, especially in cases where unnecessary effort was put into optimization. For example in a method that handles a button click, there's just no point in doing one-liners, minimizing number of variables and other kinds of optimization that degrade readability.
@flaguser4196
@flaguser4196 15 дней назад
the actual skill is telling your manager, boss or whatever that you need more time to make the code maintainable even if it already works.
@daveg4417
@daveg4417 16 дней назад
I develop 3D software. My main application that I sell is currently at about 1.1 million lines of code that took me about 10 years to write. It is written well enough that I can go back into any section, expand it, and not break anything in the software. For me, code layout and organization is high priority, and documenting the code is key, and using logical programming paradigms. It has taken me more than five decades of programming experience to get to this point though. I started in the 1970's with an HP punch card computer, then assembler on a dozen 8-bit microprocessors, and on to PC's with C, C++, C#, BASIC, and other languages.
@demonrawr4769
@demonrawr4769 15 дней назад
Hello sir, I got some questions that are totally unrelated to the video content, but since u have experience on such massive project - I have heard about a saying that among numerous problems that a software occurs to, those involves parallelism and multi-threading are the ones that are most difficult to solve. I wonder if you agree to such saying, that below the architecture level such problems are usually the hardest. And another question is how do you acknowledge logical programming paradigms? I know Prolog is something for logic programming, and I suppose there're actually quite few paradigms other than that - FP, OOP, C-like process-oriented and nothing else
@nat0106951
@nat0106951 10 дней назад
I want to be an apprentice 🖐️
@CallousCoder
@CallousCoder 7 дней назад
I’m a bit younger but having also worked on PDP-11 in 1995 and written lots and lots of assembly on 8,16 and even 32/64 bit CPUs. We know how to break down things to the simplest bits as that’s the only way to develop in assembly.
@calverley79
@calverley79 16 дней назад
The only reliable thing about programming is that nothing is 100 percent reliable. This is why you beta test. This is why you have "bug fixes" No one can think of every possible scenerio. There are billions of possibilities, to consider each and every one, and reliably have a perfect code on attempt 1 is impossible.
@dalepeters4927
@dalepeters4927 16 дней назад
Bloviation.
@stevecarter8810
@stevecarter8810 16 дней назад
1 and 2 are about competence in tech, 3 is about clarity in the abstract
@iamTheSnark
@iamTheSnark 16 дней назад
Done that. The DB2 optimiser was not ideal. So I had to figure out with Spufi abd Explain what to do. Next I had to figure out HOW to do it. And knowing something about quirks of B+ trees was a bonus.
@user-gh4lv2ub2j
@user-gh4lv2ub2j 16 дней назад
Are you kidding me? #2? That proves you're a pretender. You never optimize prematurely. Pretender.
@gregharn1
@gregharn1 16 дней назад
Yep. Fewest lines of code or simplest infrastructure.
@eldritchcookie7210
@eldritchcookie7210 16 дней назад
0:22 unrealistic most people never make it to 1)
@mikefrank8511
@mikefrank8511 16 дней назад
It's called LEAN coding. Solve the problem with the least character count you can, no more, no less.
@gonegahgah
@gonegahgah 16 дней назад
I've found for myself that the next teir was the documentation of the ideas underpinning the code. You can't alwas just do this as comments because the mechanics can be all over the shop. Documentation allows you to co-ordinate your coding. It 's not just an afterthought. I can come back to my code base at anytime and from the current documentation see why I was doing something in the way that I did.
@nikandfor
@nikandfor 16 дней назад
I also think there is another thing that is even more rare and more important. It's taking responsibility and be accountable for the result. Not just "I closed the task in jira", but "I've made it working, I'm responsible for the consequences if it brings a headache".