# Web Systems

If you're a backend guy, study your butt off to understand everything in this section. If you're not (mobile, front-end, etc), just review the list lightly. Pay close attention to the HTTP section.

Note: Below is stolen from [Triplebyte](http://www.triplebyte.com/).

## Databases

### [Normalization](http://www.dreamincode.net/forums/topic/179103-relational-database-design-normalization/)

Companies **usually don't seem to want you to know the meanings of the different normal forms (1NF, 2NF, etc)**, but they do want you to be able to design a normalized schema. You should also know about why denormalizing your schema might sometimes be a good idea (it can speed up your reads, and it also lets you [enforce some constraints you wouldn't be able to enforce otherwise](http://dba.stackexchange.com/a/15798)).

### Database indexes

[Read this](http://20bits.com/article/interview-questions-database-indexes). It is very important to know about these! They speed up reads for the column that they are on, but they make writes slower and increase memory requirements. They are usually implemented with [B-trees](https://en.wikipedia.org/wiki/B-tree).

(You can have [composite indexes](http://stackoverflow.com/questions/795031/how-do-composite-indexes-work), which are indexes on multiple columns)

### SQL explain

[Read this](https://www.postgresql.org/docs/9.4/static/using-explain.html).

### Query planning in Postgres

[Read this](http://postgresguide.com/performance/explain.html).

### NoSQL

It’s worth knowing a little bit about it. Mongo is probably the most famous NoSQL database. [Read this.](http://stackoverflow.com/questions/10553860/nosql-use-case-scenarios-or-when-to-use-nosql)

### [ORMs](http://stackoverflow.com/questions/1279613/what-is-an-orm-and-where-can-i-learn-more-about-it)

There's kind of a cultural association with ORMs which makes it important to know about them: lots of old-school programmers in PHP or C# or whatever don't use them, and startups are wary of hiring people like that. It's useful to remember that ORMs protect you from SQL injection attacks.

### Lecture notes

If you want to learn much more about databases, read lecture notes from the [Hellerstein course](https://sites.google.com/site/cs186spring2015/home/schedule-and-notes).

## HTTP

* Read all about the protocol [here](https://www.tutorialspoint.com/http). Some fun facts to know: How does [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) work?
* Suppose I'm browsing Reddit at work, over HTTPS. Does HTTPS prevent my boss from seeing that I'm browsing Reddit? Does it prevent my boss from seeing what page I'm on?
* How do cookies work?
* How does a web application control the caching behavior of its clients? [check this out](https://www.digitalocean.com/community/tutorials/web-caching-basics-terminology-http-headers-and-caching-strategies)
* [WebSockets](http://blog.teamtreehouse.com/an-introduction-to-websockets)

## TCP/UDP

Know the difference between the two.

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://heapclub.gitbook.io/heapclub-algorithms/interview-preparation/system-design/web-applications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
