Your Coding Teacher
382 subscribers
10 links
Coding, software engineering & #bitcoin technologies. I'll make you a better thinker, not just a better developer | Ex
Amazon, Senior DevOps @eBay
Download Telegram
In Java, all classes inherit from othe Object class the following methods: - toString - equals - hashcode - clone - finalize - getClass - notify - notifyAll - wait They're available to any object you create, and you can override most of them.
"When in doubt, use brute force." - Ken Thompson
Some balanced binary search trees - Red-black: rules based on node colours - AVL: heights of left and right subtrees <= 1 - Splay: after every access, the tree is readjusted. - B-trees: balanced N-children trees. Used commonly in databases
4 JavaScript interview questions Why does typeof null return object? What's the difference between Spread operator and Rest operator? What are closures? How to create an object without a prototype?
Bash exercise: Read from file.txt and output all valid phone numbers to stdout. A valid phone number appears in one of the following two formats: (xxx) xxx-xxxx or xxx-xxx-xxxx No leading or trailing whitespaces grep '^(\d{3}-|\(\d{3}\) )\d{3}-\d{4}$' file.txt
Interview tips: - There are factors outside your control. Keep applying - Be friendly. The interviewers will be working with you if you get hired. - Get a referral - Prepare. Both for tech and behavioural questions - Code fast. Follow-ups are opportunities for you
It is easier to optimize correct code than to correct optimized code
MATLAB (MATrix LABoratory) was created in 1978 by Cleve Moler MATLAB is both a programming language and a development environment, widely used in many industries: - Automotive - Aerospace - Finance - Telecommunications - Machine learning and AI disp('Hello, world!')
Design patterns in 1 tweet Strategy: Encapsulate an algorithm in a class, using interfaces Ex: Class to shuffle cards that contains a shuffleStrategy object. This object can be changed at runtime to change the shuffling method.
7 Common array interview questions 1. Binary search & variants 2. Rotate an image by 90 degrees 3. Dutch national flag 4. Merge two sorted arrays 5. Find missing element 6. Print a matrix in spiral form 7. Kadane's sum algorithm Try to solve them (easily googable)
5 Random coding tips Plan out your approach RTFM - Read The F* Manual Delete unused code Take responsibility for your mistakes Name variables and functions appropriately
Caches - Based on locality: If X was used before, it's likely to be used again - Are smaller but faster to access than RAM - If info is in cache (hit), retrieved faster - If not in cache (miss), RAM needs to be queried - OS can't control what goes into the cache
Stacks are simple data structures that maintain a LIFO, last-in first-out, ordering. Queues are simple data structures that maintain a FIFO, first-in first-out, ordering. Can you build a queue using 2 stacks?
Software is about working applications Methodologies, languages, operating systems, frameworks, etc. are secondary
When a process terminates, all of its open files are closed automatically by the kernel. However, If your application is working with files, remember to close() them.
3 JavaScript interview questions What are Classes? What are ES6 Modules? What's the difference between undefined and null?
The only code that will work forever is the code you never write
Keyword arguments in Python: - Clarify the purpose of each argument - Can have default values - Make it easy to extend an existing function Example: def fullName(surname, lastName): ... fullName(surname='Bob', lastName='Smith')
GCP discounts - Sustained Use Discounts: The longer you use your virtual machines (and Cloud SQL instances), the higher the discount–up to 30% - Committed Use Discounts: Up to 57% discount if you commit to a certain amount of CPU and RAM resources for a period of 1 to 3 years
Teaching others what you learn is one of the best ways to reinforce what you already know.