-
Read the concept of TCP in this wiki page and try to understand all the concepts of it (deeply):
- How TCP open a connection? what does it need to open a connection?
- Why there are 3 way handshakes but not 2 way?
- What is syn, ack mean?
- Why they have to send 2 "random" sequence numbers? The purpose of this sequence number?
- What if the 3rd handshake fail? How the server can detect it and what does it do in this case?
- How TCP handles the connection?
- What happens if some bits are wrong due to connection errors? How to detect them and fix them?
- How the timeout is handled? what if the timeout is expired?
- What will happen if some "packet" is missing on the way?
- How to detect the appropriate number of packets to send (speed of sending packet)?
- How TCP close the connection?
- What if the internet is dropped in the middle of the connection? Or in case one peer is crash?
- How long you can keep a TCP connection alive?
- How TCP open a connection? what does it need to open a connection?
-
What are the differences between TCP and UDP? And in which case we use which?
-
How Ping command works? What is TTL?? How does TTL will be changed??
-
How HTTP works?
- Why did people say that HTTP is stateless? The reason they make it stateless?
- Can we make a persistent HTTP connection? pros and cons of this way?
- Why HTTP require cookie each time we send the request?
- Can someone use your cookie and log in your Facebook account? How to migrate this?
- What is HTTP session? How does authentication work in HTTP? What is JWT?
- Which type of "data" HTTP can help us to get or push? (binary file? image? text file? video file? music file?)
- REST/RESTful?
- AJAX technique?
- How HTTPs work?
- Learn about some useful headers.
-
When you type "google.com" into your browser, that will happen when you type enter till everything is displayed on your screen?
- DNS lookup (in case you already access google.com before and also in case you do not know the IP of google.com)
- Which protocol DNS use and why?
- The other of place to look up DNS.
- TCP or UDP will be used in this case? why?
- How to know "google.com" require HTTP or https? how browser can know and redirect from HTTP to HTTps?
- After you get the
HTML contentfor "google.com" how to get the*.jsandimagefiles? - When getting
*.jsorimagefiles do why use anotherTCP connectionor use the same one as in the getHTML content? How DNS lookup work in this case? - After your browser display "google.com" fully, is there any connection open?
- Caching can apply to which steps? How caching applied?
- DNS lookup (in case you already access google.com before and also in case you do not know the IP of google.com)
-
What is the connection pool? It's advantages and disadvantages? How to implement connection pool in your programing language?
-
What is socket?
- Why do we need socket? Why socket is a "file" in linux?
- What is
src portwhen you create a connection to a "server"? - What one server can handle multiple connections to the same port? Good answers here but read all answers
- What is the maximum number of connections a server can handle? (if it has unlimited resource) (in case of the same client and in case of multiple clients)
- When you open multiple tabs on your chrome, how OS knows which packet (both sending and receiving) correspond to which tab? (how about in case you open many tabs to the same page "for eg: google.com")
- What are the maximum numbers of connection your machine can connect to "google.com" (if you have unlimited resource)
- Can two processes listen to the same port on your machine? Why? How?
- What is
buffer? why we always need buffer when working with "file"? - What is
unix socket? When to use it?
-
What is
TCP proxy?reverse proxy? andVPN?- How your router at your home works?
- Inside LAN network, it uses IP or MAC address? Why?
- How does it know which packet comes from (or arrive at) which machine?
- What is the difference between Hub and Switch inside LAN?
- How src IP/PORT and dst IP/PORT change on the way to the server?
- How
load-balancerworks? (this one is a tough question) // hint: it opposite to how to router work.- When we send a packet to a
load-balancerhow does it forward to the desired server? (Does it keep any data on its memory?) - When the server wants to send data back to the client, does the connection need to go through the
load-balancer? - What is different between
reverse proxyandload-balancer? - Can
load-balancerbe a bottleneck? (Because it is the end-point of too many requests) (bottleneck about RAM or CPU or Network?) - Try to understand everything in this page (all the answers)
- When we send a packet to a
- How your router at your home works?
-
What is
process,thread? What are the differents between them?- What data
process,threadneed to live? Why they said thatThread is a lightweight process? - How CPU switch (context switch) between
processes/threads`? How data is to ensure safety? (in case single CPU core and multiple CPU cores) - What is
multi-processandmulti-thread? When we should you which one?- Process has how many states? How does it change between each state?
- Scheduling algorithm.
- What will happen if a process is
waiting? Or a thread issleeping? - How CPU detects that a thread is
sleeping? Or detect when it wants to run?
- What is
thread-pool? How to use it? Describe how to create athread-poolin your programming language - Can 2 different processes access or change data of each other
address space? (this question may make you confuse with your knowledge aboutvirtual memory)- Can 2 processes use the same library (for eg: libc is required to every process)? How?
- How does
debuggerwork? How it can attach to a running process and change data of that process? (so cool, right?)
- How 2 processes can communicate with each other? (There are a lot of ways but focus on the OS's way)
- What is
child-process? How to create achild-process?- What data a
child-processhave when we create it? - Can it read/write data on it's
parent process? - What is
copy on write (COW)? (this concept is important to understand OS) // if you love computer security like me you can read more aboutDirty COW, it's fabulous - What will happen when
child-processchanges a variable ofparent process? - If
file descriptoralso beinheritedby thechild process. What if 2 processes can handle a samefile descriptoror even a samesocket? can refer here
- What data a
- What data
-
ConcurrencyvsParallels? (in case single CPU core and multiple CPU cores)- What is
critical zone? - What is
race conditionand how to handle this case? - What is locking mechanism?
mutex?semaphore?spinlock?read lockvswrite lock? - What is
deadlockand how to avoiddeadlock?
- What is
-
How does memory is managed in the OS?
- What is
virtual memory? Why do we need it? How does it work?- How large
virtual memoryis? - What is
paging? - Can 2 processes map to the same
physical address? How and in which case?
- How large
- What is
heap spaceandstack space? - What will happen with memory when you open an application?
- What will happen you call another function (with parameters) or return from a function?
- What will happen with stack? (why we do not use heap here?)?
- What will happen with registors?
- What causes stack-over-flow?
- What is dynamic allocating? How does it work?
- How does deallocation work?
- What happens when your computer is full of memory?
- Why you do not need to "deallocate" local variable?
- How does
Garbage Collectionwork? When it will be triggered? - What is a pointer? What difference between
pass by valueandpass by reference? - Where
global variablewill be saved?
- What is
-
Why in Linux
everything is "file"?- How does mouse/keyboard/monitor..... communicate with your computer?
- What is
file descriptor? - What is
buffer? Why do we needbuffer? - What will happen if 2 processes read/write to the same file?
-
What is
system call (syscal)?- How to do a
syscal? - What happens with CPU when we execute a
syscal? - What is
user spaceandkernel space?
- How to do a
-
Caching:
- What is in-memory cache? (memcached/redis)
- LRU? implement LRU in your program language! (How about multi-thread?)
- How to migrate
Cache stampede? - Quicksort(O(n^2) in worst case) vs Merge sort (O(nlogn) in worst case). Which is faster? Why? How they use these 2 sorting algorithms in real life?
- Good resources:
-
Compare
Relational DB (SQL)vsNoSQL. It's also really nice to know aboutnewSQL(a kind of auto sharding DB which supportSQL stuffbut scale likeNoSQL)- How these 2 things can scale up?
- How Transaction is handled?
ACIDofSQLandBASEofNoSQL? WhyNoSQLiseventual consistency?CAPtheorem in this case. This is a so nice graph
-
What is
parameterized statement(in Java it'sprepared statement)? How does it work internally?- What is
SQL injection? how to avoid it? - How many "requests" you have to send to
Databasein a singleprepared statementquery? // one for compile and one for execute - Can you reuse the
compiledquery multiple times? (does it help to speed up your application?)
- What is
-
How
indexingworks internally?- What algorithm and data structure
indexingused? And why? - How
composite indexingworks? - How to know your query is using index?
- How index work in this case:
WHERE age = 5andWhere age > 5? The complexity to go to the next record? - Indexing with char?
- What algorithm and data structure
-
The complexity of SQL query? How to measure it? How SQL optimize a query?
- Compare
WHERE id = 'a' AND id = 'b' AND id = 'c'vsWHERE id in (a, b, c)? - Complexity of this query
SELECT * FROM abc ORDER BY name LIMIT 10 OFFSET 1000000// SELECT 10 record from offset 10^6 after sort by name (which is a char)? How to optimize it? - What is the complexity of
COUNT(*)query? - How to write query to avoid full table scan?
- Complexity of
JOIN,INNER JOIN,OUTTER JOIN?
- Compare
-
What is Database Replicating? When we need it?
- What is
bin log? HowMaster DBsync withSlave DB? - Can a
Slave DBbe a slave of anotherSlave DB(we do not need to sync fromMaster DBdirectly)?
- What is
-
What is Database Sharding? When we need it?
- Which rule we can apply to DB Sharding?
- How to ensure
primary keyis globally unique when sharding? - How we can shard a table to multiple tables (same server) and multiple DB (multiple servers)?
- How query can work when we sharding? for example query but the data is in different tables/dbs?
-
What is database transaction?
- How
rollbackworks internally? ACID? What isdirty read?- How transaction work when there are many concurrent requests?
- How to avoid
race conditionin DB?Read/Writelock? Distributed transaction? How to make a transaction when a query needs to access multiple DB?
- How
-
Hash vs Encrypt vs Encode
- Are there any way we can crack
Hash - symmetric vs asymmetric encryption? AES vs RSA?
- Fast Hash vs Slow Hash?
- When we use Encode??
- What is the perfect hash function?
- What is the load factor of hashing?
- Are there any way we can crack
-
SSL/TLS
- How to verify a certificate? How many kinds of certificates are there?
- What is CA? how to verify certificate of a CA?
- What is
public/privatekey? what is symmetrickey - What is digital signature? What is
HMAC?
-
How to store credential information efficiency? (user password, config key, database credential, user information, secret key,.... )
-
Describe a way to defense DDOS? (actually, there are many kinds of DDOS not just network or memory, so this question is pretty complicated)