ByteByteGo 19小时前
EP174: 16 Coding Patterns That Make Interviews Easy
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文汇集了多篇技术文章,涵盖了从URL缩短器的工作原理到数据库学习路线图,再到HTTPS的安全通信机制。此外,还探讨了Netflix的扩容演进历程,并列举了多项初创公司的招聘信息,为技术从业者提供了丰富的学习资源和职业机会。文章聚焦于实用的工程工具和技术,旨在帮助工程师提升软件开发效率和系统稳定性。

🚀 URL缩短器工作原理:文章详细解析了用户输入URL后,浏览器如何通过多层缓存和DNS解析找到服务器IP地址,并建立HTTPS连接,最终获取并渲染页面内容,强调了HTTPS在保障通信安全中的关键作用。

📚 数据库学习路线图:提供了一个结构化的数据库学习路径,从基础概念(如ACID、OLTP)到数据模型、查询语言(SQL、NoSQL)、索引优化、安全备份及扩展策略,再到常用工具和云服务,帮助学习者系统掌握数据库知识。

🔒 HTTPS安全通信:深入阐述了HTTPS如何通过TCP握手、证书验证和密钥交换(利用非对称加密和对称加密)来确保浏览器与服务器之间的数据传输安全和私密性。

📈 Netflix扩容演进:回顾了Netflix从早期单体应用到引入微服务架构,再到使用Zuul API Gateway的演进过程,展示了其为应对用户增长和功能需求而不断优化系统架构的策略。

💡 工程招聘机会:汇集了多家初创公司的软件工程师招聘信息,涵盖了AI、DevOps、供应链、金融科技等多个领域,为求职者提供了广阔的职业发展平台。

DevOps Kit: Practical Tools for Engineering Teams (Sponsored)

The DevOps model can help you build software faster, ship applications with confidence, and break down silos across your engineering organizations. Gain instant access to hands-on resources from Datadog:

Download the kit


This week’s system design refresher:


How Does a URL Shortener Work?


16 Coding Patterns That Make Interviews Easy

    Two-Pointer Technique

    HashMaps

    Linked Lists

    Fast and Slow Pointers

    Sliding Window Technique

    Binary Search

    Stacks

    Heaps

    Prefix Sum

    Trees

    Tries

    Graphs

    Backtracking

    Dynamic Programming

    Greedy Algorithms

    Intervals

Over to you: Which other coding pattern will you add to the list?


Shipping late? DevStats shows you why. (Sponsored)

Still pretending your delivery issues are a mystery? They’re not. You’re just not looking in the right place.

DevStats gives engineering leaders brutal clarity on where delivery breaks down, so you can fix the process instead of pointing fingers.

✅ Track DORA and flow metrics like a grown-up

✅ Spot stuck work, burnout risks, and aging issues

✅ Cut cycle time without cutting corners

✅ Ship faster. With fewer surprises.

More AI tools won’t fix your delivery. More Clarity will.

👉 Try DevStats for free


How to Learn Databases?

Databases power everything from websites and apps to enterprise systems. Here’s a learning map that can help you master databases:

    Database Fundamentals
    This includes topics like “What is a database”, RDBMS, SQL vs NoSQL, ACID vs BASE, OLTP vs OLAP, Transactions, and Isolation Levels.

    Data Models and Types
    Consists of topics like Relational Databases, Non-Relational Databases, and Data Types (Integer, String, Boolean, Date, JSON, etc).

    Querying and Language
    This includes topics like SQL Basics (SELECT, INSERT, etc), Advanced SQL (Views, Indexes, CTEs, etc), and NoSQL Querying (Aggregation and Key-Value Lookups).

    Indexing and Optimization
    Consists of topics like Indexing (B-Tree, Hash, and Bitmaps), Query Execution Plans, Denormalization vs Normalization, Sharding, Connecting Pooling, and Query Batching.

    Security, Backups, and Scaling
    This includes topics like User Roles, Permissions, Encryption, SQL Injection, High Availability (Replication and Failover), Horizontal vs Vertical Scaling.

    Tools and Ecosystem
    Consists of topics like Popular SQL Databases, NoSQL Database, GUI Tools, ORMs, Cloud DB services (RDS, DynamoDB, Google Cloud SQL, etc.)

Over to you: What else will you add to the list for learning databases?


What happens when you type a URL into a browser?

Let’s look at the process step by step.

Step 1: The user enters a URL (bytebytego .com) into the browser and hits Enter. The first thing we need to do is to translate the URL to an IP address. The mapping is usually stored in a cache, so the browser looks for the IP address in multiple layers of cache: the browser cache, OS cache, local cache, and ISP cache. If the browser couldn’t find the mapping in the cache, it will ask the DNS (Domain Name System) resolver to resolve it.

Step 2: If the IP address cannot be found at any of the caches, the browser goes to DNS servers to do a recursive DNS lookup until the IP address is found.

Step 3: Now that we have the IP address of the server, the browser sends an HTTP request to the server. For secure access of server resources, we should always use HTTPS. It first establishes a TCP connection with the server via TCP 3-way handshake. Then it sends the public key to the client. The client uses the public key to encrypt the session key and sends to the server. The server uses the private key to decrypt the session key. The client and server can now exchange encrypted data using the session key.

Step 4: The server processes the request and sends back the response. For a successful response, the status code is 200. There are 3 parts in the response: HTML, CSS and Javascript. The browser parses HTML and generates DOM tree. It also parses CSS and generates CSSOM tree. It then combines DOM tree and CSSOM tree to render tree. The browser renders the content and display to the user.


How HTTPS Works?

HTTPS ensures secure communication between your browser (client) and a website’s server using encryption.

    TCP Handshake: Before any secure communication occurs, the client and server first establish a basic connection using the TCP handshake process. At this point, the data is not encrypted.

    Certificate Check: This stage is meant to verify the server’s identity. The client starts the TLS handshake with a “hello” message that offers supported encryption algorithms. The server replies, choosing algorithms and sending its digital certificate, which contains the public key. The client verifies the certificate to ensure it’s from a trusted Certificate Authority (CA).

    Key Exchange: Once the client validates the certificate, it starts the key exchange process. The client uses the server’s public key (from the certificate) to encrypt the session key. The encrypted session key is sent to the server, and the server can decrypt it using its private key. The change cipher spec message signifies that from this point onward, all messages will be encrypted using the agreed-upon session key and cipher. This step uses asymmetric encryption to securely exchange the session key.

    Data Transmission: Now, both sides switch to symmetric encryption (faster) using the shared session key. Messages are encrypted and decrypted with the same key. All data exchanged is now secure and private.

Over to you: Will you add anything more to explain the HTTPS process?


The Evolution of Scaling at Netflix

Over the years, Netflix went through several growth stages. With each stage, they had to evolve the scaling approach.

    Stage 1 (Early Streaming Architecture)
    It was a typical 3-tier consisting of a client, an API, and a database.

    The API application was named NCCP (Netflix Content Control Protocol). It was a monolithic application that contained all functionalities.

    Stage 2 (Introducing Microservices)
    As more features were added, maintaining the engineering velocity became critical. To support this, the monolithic application was broken up into microservices.

    Features were extracted from the NCCP application and developed as separate applications, but the orchestration logic remained in the NCCP application.

    Stage 3 (Zuul Gateway)
    Next, Netflix split the application. The NCCP stayed there for the playback experience while other APIs started to handle other features.

    A Zuul API Gateway was introduced to reduce the coupling between the client and the services.

Reference: Netflix TechBlog

Over to you: Have you come across any other nuance of how Netflix scaled to its current level?


Early teams hiring engineers

If you’d like to find interesting job opportunities at startups or meet like-minded peers (like co-founders or collaborators), check out Next Play on Substack


SPONSOR US

Get your product in front of more than 1,000,000 tech professionals.

Our newsletter puts your products and services directly in front of an audience that matters - hundreds of thousands of engineering leaders and senior engineers - who have influence over significant tech decisions and big purchases.

Space Fills Up Fast - Reserve Today

Ad spots typically sell out about 4 weeks in advance. To ensure your ad reaches this influential audience, reserve your space now by emailing sponsorship@bytebytego.com.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

URL缩短 数据库 HTTPS Netflix 工程招聘
相关文章