Skip to content

Instantly share code, notes, and snippets.

@abhay8nitt
abhay8nitt / FB-PE-InterviewTips.md
Created August 16, 2021 17:40 — 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

### Uncompressed size of a compressed zip file
RandomAccessFile raf = new RandomAccessFile("test.gz", "r");
raf.seek(raf.length() - 4);
int b4 = raf.read();
int b3 = raf.read();
int b2 = raf.read();
int b1 = raf.read();
int val = (b1 << 24) | (b2 << 16) + (b3 << 8) + b4;
System.out.println(val);
raf.close();
## Determine uncompressed size of GZIP file
info,_ :=f.Stat()
r4 := bufio.NewReader(f)
_size:= int(info.Size())
x,_:=r4.Discard(_size-4)
b4,_:=r4.ReadByte()
b3,_:=r4.ReadByte()
b2,_:=r4.ReadByte()
b1,_:=r4.ReadByte()
@abhay8nitt
abhay8nitt / celery.sh
Created February 7, 2020 02:01 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
@abhay8nitt
abhay8nitt / celery.sh
Created February 7, 2020 02:01 — forked from amatellanes/celery.sh
Celery handy commands
/* Useful celery config.
app = Celery('tasks',
broker='redis://localhost:6379',
backend='redis://localhost:6379')
app.conf.update(
CELERY_TASK_RESULT_EXPIRES=3600,
CELERY_QUEUES=(
Queue('default', routing_key='tasks.#'),
Aug 11, 2015 10:15:14 AM com.couchbase.client.core.logging.CouchbaseLoggerFactory newDefaultFactory
FINE: Using java.util.logging as the default logging framework
Aug 11, 2015 10:15:14 AM com.couchbase.client.deps.io.netty.util.internal.logging.InternalLoggerFactory newDefaultFactory
FINE: Using java.util.logging as the default logging framework
Aug 11, 2015 10:15:14 AM com.couchbase.client.core.env.DefaultCoreEnvironment <init>
INFO: ioPoolSize is less than 3 (2), setting to: 3
Aug 11, 2015 10:15:14 AM com.couchbase.client.core.env.DefaultCoreEnvironment <init>
INFO: computationPoolSize is less than 3 (2), setting to: 3
Aug 11, 2015 10:15:14 AM com.couchbase.client.deps.io.netty.channel.MultithreadEventLoopGroup <clinit>
FINE: -Dio.netty.eventLoopThreads: 4