Skip to content

Instantly share code, notes, and snippets.

@sahilsk
sahilsk / FB-PE-InterviewTips.md
Created April 18, 2022 02:44 — forked from ameenkhan07/FB-PE-InterviewTips.md
Facebook Production Engineering Interview

What to Expect and Tips

• 45-minute systems interview, focus on responding to real world problems with an unhealthy service, such as a web server or database. The interview will start off at a high level troubleshooting a likely scenario, dig deeper to find the cause and some possible solutions for it. The goal is to probe your knowledge of systems at scale and under load, so keep in mind the challenges of the Facebook environment.
• Focus on things such as tooling, memory management and unix process lifecycle.

Systems

More specifically, linux troubleshooting and debugging. Understanding things like memory, io, cpu, shell, memory etc. would be pretty helpful. Knowing how to actually write a unix shell would also be a good idea. What tools might you use to debug something? On another note, this interview will likely push your boundaries of what you know (and how to implement it).

Design/Architecture 

Interview is all about taking an ambiguous question of how you might build a system and letting

@sahilsk
sahilsk / x.json
Created March 5, 2021 20:07 — forked from KensoDev/x.json
{
"Volumes": [
{
"AvailabilityZone": "us-west-2a",
"Attachments": [
{
"AttachTime": "2013-09-17T00:55:03.000Z",
"InstanceId": "i-a071c394",
"VolumeId": "vol-e11a5288",
"State": "attached",
{
"DBInstances": [
{
"PubliclyAccessible": false,
"MasterUsername": "mymasteruser",
"MonitoringInterval": 0,
"LicenseModel": "general-public-license",
"VpcSecurityGroups": [
{
"Status": "active",
@sahilsk
sahilsk / mock_requests.py
Created February 24, 2021 17:41 — forked from evansde77/mock_requests.py
Example of mocking requests calls, python requests.get mock
#!/usr/bin/env python
"""
mocking requests calls
"""
import mock
import unittest
import requests
from requests.exceptions import HTTPError
@sahilsk
sahilsk / async-await.js
Created January 12, 2021 22:54 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@sahilsk
sahilsk / predict2.py
Created June 17, 2020 19:44 — forked from rajarsheem/predict2.py
Temperature Predictions
# PROBLEM LINK : https://www.hackerrank.com/challenges/temperature-predictions
import numpy as np
from sklearn import ensemble
def isfloat(value):
try:
float(value)
return True
@sahilsk
sahilsk / onedrivefix.bat
Created June 9, 2020 11:57
microsoft onedrive fix for cannot connect to drive error
cd %systemroot%\system32\drivers
sc query cldflt
sc config cldflt start=auto
@sahilsk
sahilsk / sts-decode.py
Created June 7, 2020 08:18
aws sts decode-authorization-message
import boto3
import json
import sys
encodedMessageStr = sys.argv[1]
client = boto3.client('sts')
response = client.decode_authorization_message(
EncodedMessage=encodedMessageStr
)
@sahilsk
sahilsk / ec2-aws-hostanme-change.md
Last active May 20, 2020 18:09 — forked from diegopacheco/ec2-aws-hostanme-change.md
How to change Hostname on Amazon Linux - EC2 AWS?

Summary

  1. Change file /etc/sysconfig/network
  2. Change file /etc/hostname
  3. Chnage file /etc/hosts
sudo vim /etc/sysconfig/network
@sahilsk
sahilsk / wafv2.yaml
Created March 19, 2020 15:40
cloudformation-yaml-wafv2 parametrized DefaultAction using custom action
Description: Create WebACL example
Parameters:
WebACLDefaultAction:
Type: String
AllowedValues:
- Allow
- Block
WebACLRuleAction:
Type: String