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?
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
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
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.
- 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";
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
- 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
- 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
- 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?
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.
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?
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
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
"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
- 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?
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?
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
- 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
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
- 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
4 Main NoSQL data models:
- Column: Tables, rows and flexible columns. Ex: Cassandra, HBase, DynamoDB
- Document: Semi-structured data. Ex: Linkedin profiles stored in MongoDB
- Key-value. Similar to a hash table. Ex: Redis, memcached
- Graph. Ex: Twitter follow in Neo4J
- Column: Tables, rows and flexible columns. Ex: Cassandra, HBase, DynamoDB
- Document: Semi-structured data. Ex: Linkedin profiles stored in MongoDB
- Key-value. Similar to a hash table. Ex: Redis, memcached
- Graph. Ex: Twitter follow in Neo4J
In a Linux filesystem, an inode is a data structure that stores information about a file: type, permissions, where in the disk the data is located, etc.
Inodes are identified by numbers in an inode table.
Inodes are identified by numbers in an inode table.