10Buns

面试遇到让把 http code 三位数字拆开分别解释含义的

  •  
  •   10Buns · Dec 15, 2021 · 10915 views
    This topic created in 1785 days ago, the information mentioned may be changed or developed.

    给我整的有点自闭,先解释了 1xx 、2xx 、3xx 、4xx 、5xx 大概是哪些错误分类,首位表示状态标识。

    然后举个 201 、301 具体的响应意义,结果让我解释 201 的 2 、0 、1 三位数字分别具有什么含义?

    我内心是纠结的,并在最后有什么想问的环节把这个问题抛回去了。

    面试官让我回去自己查 http code 状态码表有解释,感觉自己太菜鸡

    57 replies  •  2021-12-16 22:34:55 +08:00
    AoEiuV020
    AoEiuV020
    Dec 15, 2021
    1
    一一对应的东西能有什么含义,还能找规律不成,
    话说第二位有不是 0 的吗,
    huyan0909
    huyan0909
    Dec 15, 2021❤️4
    2
    茴香豆的茴有几种写法
    demo
    demo
    Dec 15, 2021❤️9
    3
    有没有一种可能,面试官让你回去自己查,其实是自己也不知道。
    kyokuheishin
    kyokuheishin
    Dec 15, 2021❤️8
    4
    建议让这种人解释 418 的三位数字分别是什么意思
    AoEiuV020
    AoEiuV020
    Dec 15, 2021
    5
    查了下,4 开头的报错可真多,09 不够用就 10 了,后两位怎么看都是合起来查表解释的,没有什么含义,
    10Buns
    10Buns
    OP
    Dec 15, 2021
    6
    @AoEiuV020 实际开发中常见的 415 不支持
    zen1
    zen1
    Dec 15, 2021
    7
    无语
    trn4
    trn4
    Dec 15, 2021 via iPhone❤️2
    8
    @kyokuheishin 哈哈我也会让他解释 418
    shyrock
    shyrock
    Dec 15, 2021❤️7
    9
    我知道的知识都是基础扎实、经验丰富的证明;我不知道的知识都是华而不实的奇技淫巧。。。
    coderluan
    coderluan
    Dec 15, 2021❤️1
    10
    楼主没啥问题,面试官太奇葩,而且还鸡贼,他最后要是回复你了,你一旦有点疑问他自己未必解释的清,所以让你自己查。
    Pastsong
    Pastsong
    Dec 15, 2021
    11
    第一位是分类,后面两位是 sequence ,能有啥意义
    Dvel
    Dvel
    Dec 15, 2021❤️71
    12
    第一位代表了五类响应。
    第二位第三位代表了个位和十位,面试官在考察你十进制的知识,回答内容要围绕着“个位不够,满十进一”来展开。
    IvanLi127
    IvanLi127
    Dec 15, 2021
    13
    告诉他分开后,2 能表示正常,其他位没任何含义呗
    10Buns
    10Buns
    OP
    Dec 15, 2021
    14
    @Dvel 学到了,原以为后两位就是从 0 递增定义状态
    hakr
    hakr
    Dec 15, 2021
    15
    @Dvel #12 优秀
    joshua7v
    joshua7v
    Dec 15, 2021
    16
    问问大家 在最后环节把前面的问题抛回去是常规操作么
    作为面试者的时候想知道答案也这么做过 但感觉引起对方不悦
    作为面试官的时候也被最后反问过 我就当技术交流回答了
    pengtdyd
    pengtdyd
    Dec 15, 2021
    17
    不想招你问啥的都有,想招你你说啥就是啥
    cxe2v
    cxe2v
    Dec 15, 2021❤️4
    18
    如果这个这个人能回答上来你的反问,我还当他是个人才

    谁知,却只是让你去查手册,既然可以查,你问个球
    reallittoma
    reallittoma
    Dec 15, 2021
    19
    @Dvel #12 没有错,作为程序员,小学数学必须及格
    Leonard
    Leonard
    Dec 15, 2021
    20
    @joshua7v 个人感觉不算常规操作,但是抛回去时语气正常的话也不算冒犯。对方不悦只能是 1.对方自己也不确定; 2.对方太小心眼了。
    10Buns
    10Buns
    OP
    Dec 15, 2021
    21
    @joshua7v #16 随机应变了,基本不会反问,但是这个我是没忍住
    qq976739120
    qq976739120
    Dec 15, 2021
    22
    什么煞笔问题.....
    momocraft
    momocraft
    Dec 15, 2021
    23
    你看这个 1 他比 0 大一点 又比 2 小一点
    66beta
    66beta
    Dec 15, 2021
    24
    这不 SEO 一波公司名?
    coderluan
    coderluan
    Dec 15, 2021
    25
    @joshua7v 这事不同问题不同场合不同用词不同语气感受是不一样的,双方的感受可能也都不一样,抛回去可能分很多情况,质问,交流,请教都算抛回去,但是肯定是完全不同的反应。我的建议是看看自己是什么样的人,如果是会关注别人情绪或者被人拒绝了会不舒服那种,还想和别人说说,那就多一事不如少一事,相反如果认为双方都是陌生人,自己问了没什么,别人回不回答也没什么,也就是一点小事,过了就忘了,那就随便。
    QingXuJiaZhi
    QingXuJiaZhi
    Dec 15, 2021
    26
    其实相当于一种谈判,多数情况下求职者处于劣势地位,谈崩了面试官大不了继续面试下一个,损失不大,因此可以更硬气,说什么“你回去自己查”之类的话。
    jim9606
    jim9606
    Dec 15, 2021
    27
    400 和 500 是除出了错误又懒得解释具体原因时用的。

    想听历史的话可以跟他介绍 451 的由来,源于 1953 年的反乌托邦小说《华氏 451 度》,纸的燃点 451 华氏度。
    xuecan
    xuecan
    Dec 15, 2021
    28
    @AoEiuV020 有的 比如 429 限流
    aureole999
    aureole999
    Dec 15, 2021
    29
    有意义吗? wiki 上反正没说有
    The first digit of the status code defines the class of response, while the last two digits do not have any classifying or categorization role.
    murmur
    murmur
    Dec 15, 2021❤️2
    30
    你问问面试官 N 、M 、S 、L 每个字母都是啥意思
    crab
    crab
    Dec 15, 2021
    31
    知道个常用 200 404 401 403 301 302 就足够了吧
    Cu635
    Cu635
    Dec 15, 2021
    32
    面试官问得问题没啥毛病,这是基础知识。
    wellsc
    wellsc
    Dec 15, 2021 via iPhone
    33
    这不是基础知识嘛,面试官没啥毛病
    christin
    christin
    Dec 15, 2021 via iPhone
    34
    @Cu635 #31
    @wellsc
    所以每一位是什么意思? 解释一下?
    CallMeReznov
    CallMeReznov
    Dec 15, 2021
    35
    我他妈又不去应聘 IANA!
    经典话术套路了,先整个一般人答不上来的问题,答不上来就贬低你,打压你,让你被动后在谈.
    streamrx
    streamrx
    Dec 15, 2021 via iPhone
    36
    有寄吧用
    cpstar
    cpstar
    Dec 15, 2021
    37
    跟面试官探讨一下 451
    cpstar
    cpstar
    Dec 15, 2021❤️1
    38
    换个思路,面试官可能会用一个假的事例来测试你的反应能力,看你能不能(敢不敢)推翻他的定义
    raycool
    raycool
    Dec 15, 2021
    39
    要我干脆一句话不知道
    xz410236056
    xz410236056
    Dec 15, 2021❤️2
    40
    @Dvel #12 我想知道你这种说法的来源

    rfc7231 压根没这说,就说了第一个数
    https://datatracker.ietf.org/doc/html/rfc7231#page-47

    Response Status Codes

    The status-code element is a three-digit integer code giving the
    result of the attempt to understand and satisfy the request.

    HTTP status codes are extensible. HTTP clients are not required to
    understand the meaning of all registered status codes, though such
    understanding is obviously desirable. However, a client MUST
    understand the class of any status code, as indicated by the first
    digit, and treat an unrecognized status code as being equivalent to
    the x00 status code of that class, with the exception that a
    recipient MUST NOT cache a response with an unrecognized status code.

    For example, if an unrecognized status code of 471 is received by a
    client, the client can assume that there was something wrong with its
    request and treat the response as if it had received a 400 (Bad
    Request) status code. The response message will usually contain a
    representation that explains the status.

    The first digit of the status-code defines the class of response.
    The last two digits do not have any categorization role. There are
    five values for the first digit:

    o 1xx (Informational): The request was received, continuing process

    o 2xx (Successful): The request was successfully received,
    understood, and accepted

    o 3xx (Redirection): Further action needs to be taken in order to
    complete the request

    o 4xx (Client Error): The request contains bad syntax or cannot be
    fulfilled

    o 5xx (Server Error): The server failed to fulfill an apparently
    valid request
    neutrinos
    neutrinos
    Dec 15, 2021 via iPhone
    41
    厉害,这可是奥赛题中的找规律题
    1016
    1016
    Dec 15, 2021
    42
    @Dvel 你这是在哪里看到这种解释的 麻烦大佬发出来一下 让我也看看
    Dvel
    Dvel
    Dec 15, 2021
    43
    @xz410236056 #40
    @1016 #42
    误会了朋友,我 12 楼讲的是笑话,后两位当然没有意义,只是个编号,我也是在吐槽。
    AV1
    AV1
    Dec 15, 2021 via Android
    44
    其实可以靠经验总结出来的,发生 4xx 错误优先打扰前端,发生 5xx 错误优先打扰后端。
    xFrye
    xFrye
    Dec 15, 2021
    46
    你问他为什么 1 + 1 = 2 。

    介绍常用的状态码很正常,解释 1xx ,2xx 这种分类也没问题。但是单个状态码分析每个位的作用这不扯淡?
    rehoni
    rehoni
    Dec 15, 2021 via Android
    47
    @10Buns 后两位不是递增还能是啥...感觉你被面试官忽悠了
    bwangel
    bwangel
    Dec 15, 2021
    48
    @crs0910 #45

    兄弟,你的 rfc 贴错了

    2817 是 Upgrading to TLS Within HTTP/1.1

    7231 是 Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

    7231 才是将 http 协议的
    Jooooooooo
    Jooooooooo
    Dec 15, 2021
    49
    这个想听的答案很可能是, 2 是正确的, 4 是前端的问题, 5 是后端的问题.
    solemelo
    solemelo
    Dec 16, 2021
    50
    你们都错了,面试官是在通过问这种问题委婉地告诉楼主,“不要来这家公司,RUN!”
    catoncat
    catoncat
    Dec 16, 2021 via iPhone❤️1
    51
    @bwangel 没贴错,贴的是关于 HTTP Status Code Registry 的介绍。
    catoncat
    catoncat
    Dec 16, 2021 via iPhone❤️1
    52
    @bwangel 7231 已经有人贴了,这里疑惑的是后两位不是一直递增的,后面会跳。
    Huelse
    Huelse
    Dec 16, 2021
    53
    @xz410236056 #40 兄弟,你没看懂啊
    alanhe421
    alanhe421
    Dec 16, 2021
    54
    这三位确实有含义。也好回答吧。
    gbin
    gbin
    Dec 16, 2021
    55
    面试并不是一个被选择的过程,也是一个自我选择的过程,其实换个思路,能避免和这样的面试官共事又何尝不是一次成功的面试。
    ScotGu
    ScotGu
    Dec 16, 2021
    56
    答案是不是就在底部?
    实用小工具-HTTP 状态码参考

    https://www.v2ex.com/tools/http
    Cu635
    Cu635
    Dec 16, 2021
    57
    @christin
    那就该怎么答就怎么答,第一位是啥意义,后面的两位要连起来看没有特别含义而是如何如何。
    面试官也许要的就是这个答案呢。

    @xz410236056
    回答出来后两位没特别含义,只是个区分是应该的,也许面试官要的就是这个回答。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1368 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 103ms · UTC 20:53 · PVG 04:53 · LAX 12:53 · JFK 15:53
    ♥ Do have faith in what you're doing.