"Test doubles are objects that replace real dependencies to enable automated testing. They are the automated testing equivalent of movie stunt people: they take the place of the original since having the real one is expensive or impractical." Excellent analogy by @venkat_s
Interview tip Getting a hard question isn't bad You'll be compared to everyone who has had to solve that problem. If it's hard for you, chances are other candidates also found it hard.
4 Random coding tips Write useful comments Stay humble Don't be afraid to ask for help Keep practicing
"I went to school to learn how to program software applications, which inevitably have bug defects. There was no course at my university on testing, debugging, profiling, or optimization. These things you have to learn on your own, usually in a tight deadline." Juixe TechKnow
"Don't tell people how to do things, tell them what to do and let them surprise you with their results." - George S. Patton
"It's hard enough to find an error in your code when you're looking for it. It's even harder when you've assumed your code is error-free." - Steve McConnell
The try/finally structure lets you run cleanup code even if exceptions were raised in the try block. The else block minimizes the amount of code in try blocks. It can be used to perform additional actions after a successful try.
Don't get attached to any particular language, framework or technology. They come and go. Focus on principles.
How to manage access to the resources in a GCS bucket. - ACLs grant access to buckets and individual objects - IAM roles are project or bucket wide permissions Both methods work in tandem. For temporary access to users outside of GCP, use Signed URLs.
Ninety percent of the coding you'll do as a beginner is hunting down bugs.
Make sure your code relies on abstractions. Your classes should know WHAT other classes/functions do But it's better if they don't rely on HOW they do what they do
Design patterns in 1 tweet Observer: A publisher notifies a list of subscribers of changes in a class Ex: People who receive their monthly subscriptions (subscribers/observers) from their favourite maganizes (publishers)
If your bug has a one in a million chance of happening, it'll happen next Friday
If you're overwhelmed by some big complex problem, break it down into small chunks. Focus on each of them individually and then build up your solution. Divide and conquer.
You learn more from "unexpected results" than from getting things right the first time
"The theory behind open source is simple. In the case of an operating system, the source code is free. Anyone can improve it, change it, exploit it. But those improvements, changes, and exploitations have to be made freely available." - Linus Torvalds
The same way musicians practice scales, you should have some exercises to get you up to speed. For example, when I learn a new language, I make sure I implement some algorithms (that I already know) that cover the basics: - Tree traversals - BFS - Mergesort - Etc
7 tips to work more efficiently 1. Have a definition of done for your tasks 2. Define their scope 3. Time estimates are hard 4. Have a rule to decide when to automate a task 5. Work incrementally 6. Premature optimization is the root of all evil 7. Get a rubber duck