Your Coding Teacher
380 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
Instead of trying to figure out what's the next incremental improvements for a slow algorithm,

sometimes it's better to try a complete different approach
Make something fool-proof

and someone will make a better fool
4 JavaScript interview questions

What is a Callback function?
What are Arrow functions?
What is the usage of Function.prototype.bind?
How to check if a value is null?
We live in a world governed by distributed systems.

From small intranets, to share printers, to the Internet
Bit-level operations on an integer x

x |= 1<<7 -> set bit 7 (the first bit starts at index 0)
x &= ~(1<<7) -> clear bit 7
x ^= 1<<7 -> toggle bit 7
mask = ((1<<8)-1) -> create an 8 bit mask
(x >> 16) & 0xf -> extract bits 16 through 8
(x >> 7) & 1 -> test bit 7
I've also wasted long hours debugging issues that came from:

- Reading the wrong configuration file
- Using outdated information from an internal wiki page
- Problems with someone else's code
- Copy-paste related errors

When things go wrong, check your assumptions.
Perl was developed by Larry Wald in 1987 as a scripting language for text editing

It is commonly used in:

- Linux system administration
- Web development
- Network programming

print "Hello, World!\n";
Some questions to consider to clarify requirements:

- Read/write heavy sistem? (or both)
- Expected # Users (average and peak)
- Traffic patterns
- Amount of data to store (for how long)
- SLA
- Consistency model?
- Cost of development vs operations/maintenance
Some properties of distibuted systems:

- Reliability: the system can tolerate faults (software or hardware)
- Scalability: the system has good performance when load increases
- Maintainability: the system is easy to extend and to operate
"A man provided with paper, pencil, and rubber, and subject to strict discipline, is in effect a universal machine"
- Alan Turing
If you pass a boolean to a function, there might be an if statement somewhere

Why not refactor that function into two functions and call the appropriate one?
Some developers think that writing convoluted code makes them look smart.

Writing simple code that reads easily and is easy to understand is what takes real skill.
5 JavaScript interview questions

What is Scope?
What does the new keyword do?
What are the falsy values in JavaScript?
What is an IIFE, what is the use of it?
What's the value of this in JavaScript?
"Around computers it is difficult to find the correct unit of time to measure progress.
Some cathedrals took a century to complete.
Can you imagine the grandeur and scope of a program that would take as long?"
- Alan J. Perlis
"Smart" one-liners also have to be maintained
"Simplicity is a great virtue but it requires hard work to achieve it and education to appreciate it. And to make matters worse: complexity sells better."
- Edsger W. Dijkstra
4 JavaScript interview questions

What's the difference between var, let and const keywords?
What is the difference between Implicit and Explicit Coercion?
What is Object Destructuring?
What does "use strict" do?
Be accountable for your ideas

Especially the "good" ones
Containers 101

- Containers makes it easy to package and run an app in an isolated environment
- Docker is the most popular container engine
- Kubernetes (k8s) is used to orchestrate containers
- Some public clouds provide fully-managed k8s engines, like GKE or EKS
"It depends" is the answer to all good software engineering questions

The good software engineer should know on what it depends
Spin locks

- Thread synchronization mechanism
- Similar to mutex
- Instead of blocking by sleeping, the process is blocked by spinning (waits doing nothing) till it can acquire the lock
- Should be held only for short, since the CPU can't do anything else while it's waiting