润之大朋友

精心编撰的题目们

C++

模板编程

template <typename T> T foo(T a, T b);

// 显式实例化
template <long> long foo(long a, long b);

// 具象化
template <> string foo<string>(string a, string b) {}
template <> string foo(string a, string b) {}

命名空间

常见一些的命名空间的用法

std::cout;
using std::cout;
using namespace std;
#include <iostream>
using namespace std;

namespace first_space {
    void func() {
        cout << "Inside first_space" << endl;
    }

    namespace second_space {
        void func() {
            cout << "Inside second_space" << endl;
        }
    }
}

using namespace first_space::second_space;

int main () {
    func();
    return 0;
}

宏(条件编译)

#ifndef _HEADER_FILE_H_
#define _HEADER_FILE_H_

// a lot of code

#endif

CSS

简述 flex 和 grid 的布局区别

A Complete Guide to Flexbox

flex 是一个柔性盒子布局, 目的是提供一个即便在不知道其大小或者容量的前提下, 将其子元素进行排列对齐.

grid 是网格布局, 能够像操作表格一般将元素进行排列, 相比 <table> 它可以方便地实现一个元素占用多个单元格, 以及指定行或者列的长度或者宽度.

SHELL

SIGTERM 和 SIGKILL 的区别

SIGKILL - The SIGKILL signal forces the process to stop executing immediately. The program cannot ignore this signal. This process does not get to clean-up either.

SIGTERM - This signal requests a process to stop running. This signal can be ignored. The process is given time to gracefully shutdown. When a program gracefully shuts down, that means it is given time to save its progress and release resources. In other words, it is not forced to stop. SIGINT is very similar to SIGTERM.

说一下环境变量 PATH 的作用

DHCP

简述工作流程

DHCP 协议原理及其实现流程 -- wuruixn - CSDN

新的计算机加入, 客户机广播寻找 DHCP 服务器, DHCP 服务器向客户机发送消息(包含一个或者多个可用的 IP)(目标是谁? 工作在哪一个网络层上), 客户机向 DHCP 服务器发送选择其中一个 IP
(广播通告所有 DHCP 服务器), DHCP 服务器向客户机发送消息表示确认收到其选择请求(同时所有的 DHCP 服务器都会收回所提供的多余的 IP)

DNS

经典迭代查询和递归查询

使用非默认 DNS 对于 CDN 的工作影响

HTTPS

HTTPS 的信任问题, 证书的信任链关系

非对称加密: 私钥加密只有公钥能够解密, 公钥加密也只有私钥能够解密.

签名: 计算 hash 以后使用私钥加密得到密文并附加在原文之后, 其他人只需要使用公钥解密这段密文, 然后比对自己根据原文计算得到的 hash 即可认证.

ROOT 证书是无条件信任的, 证书中存有用户的公钥(也存有 CA(数字证书认证机构) 的公钥). ROOT 证书保存在一个安全的地方, ROOT 用私钥对其他 CA 的公钥进行签名, CA 再使用公钥对用户的私钥进行签名.

EPOLL

讲一讲 EPOLL 吧~

JWT

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务