Skip to content

Instantly share code, notes, and snippets.

View paulfranco's full-sized avatar

Paul Franco (he/him) paulfranco

View GitHub Profile
Test Driven Development
Main Principle: Write the test case before the implementation of the function (only for unit tests)
Convention:
1. You should only have one assertion per test case
- Why? Because we immediately want to know the cause of the failed test case
- Note: Sometimes there is no way around having multiple assertions.
Steps:
Extract Variable = command Option V
Run Test = Control Shirt R
Extract Method = Highlight Code then Command Option M or Control Alt M (Windows)
Go To Test or Create New test if none exists = Command Shift T
//
// main.swift
// protocols and delegates
//
// Created by Paul Franco on 8/16/20.
//
protocol EmergencyMedicalTechnician {
func performCPR()
}

JavaScript Interview Questions

Q1: Explain equality in JavaScript ☆

Answer: JavaScript has both strict and type–converting comparisons:

  • Strict comparison (e.g., ===) checks for value equality without allowing coercion
  • Abstract comparison (e.g. ==) checks for value equality with coercion allowed

Android Interview Questions

Q1: Explain activity lifecycle ☆☆

Answer: As a user navigates through, out of, and back to your app, the Activity instances in your app transition through different states in their lifecycle.

To navigate transitions between stages of the activity lifecycle, the Activity class provides a core set of six callbacks: onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy(). The system invokes each of these callbacks as an activity enters a new state.

Interview Questions

Kotlin

Q1: What is a primary constructor in Kotlin? ☆☆

Answer: The primary constructor is part of the class header. Unlike Java, you don't need to declare a constructor in the body of the class. Here's an example:

Interview Questions

MongoDB

Q1: Explain what is MongoDB? ☆

Answer: MongoDB is an open-source document database that provides high performance, high availability, and automatic scaling. It's Key Features are:

  • Document Oriented and NoSQL database.

Interview Questions

Node.js

Q1: What do you mean by Asynchronous API? ☆☆

Answer: All APIs of Node.js library are aynchronous that is non-blocking. It essentially means a Node.js based server never waits for a API to return data. Server moves to next API after calling it and a notification mechanism of Events of Node.js helps server to get response from the previous API call.

Source: tutorialspoint.com

Gradle configuration
Add this in your project level build.gradle file
Under buildscript
ext.coroutines_version = "1.3.0"
ext.room_version = "2.2.2"
ext.glide_version = "4.8.0"
ext.nav_version = "2.1.0"
ext.daggerVersion = '2.14.1'

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user