Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Language Atlas (mini-courses for more languages) Module 14

Capstone: one specification, twelve languages interview questions

Interview questions on “Capstone: one specification, twelve languages”: warm-ups, then what each harder question tests and how a good answer starts.

5 questions: 3 warm-ups and 2 with model answers · Levels: Fresher to staff

Warm-up questions

Short questions with short answers, each answered in full.

  1. Mid to senior

    Why does the specification round half up with integers instead of calling the language's round?

    Answered in the lesson Capstone: one spec in twelve languages

  2. Fresher to mid

    What is a test vector, and what can twenty public vectors prove?

    Answered in the lesson Capstone: one spec in twelve languages

  3. Fresher to mid

    What is floor division, and when does it differ from truncating division?

    Answered in the lesson Capstone: one spec in twelve languages

Questions with model answers

What each question tests, the first step of a good answer and the follow-ups to expect.

  1. Fresher to senior

    A teammate's implementation of the bill-splitting specification passes most vectors, but on some bills one diner is one paisa off and the totals no longer add up to the bill. Where do you look, in what order, and how do you prove the fix?

    What it tests
    Tracing an off-by-one-paisa failure to division, rounding or ordering rules, using the shared vectors as evidence, and the invariant that the shares add up to the bill.
    First step
    Run check.sh and list the vectors that differ, then compare the rules they pin. Totals that stop adding up point at the shares and the leftover paise: truncating division of a negative line, such as the coupon of vector 07, gives shares that add up to more than the line and a leftover of -1.
    Follow-ups

    From the lesson Capstone: one spec in twelve languages

    Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.

    Opening the model answers with your pass…

    Model answers open with any MySmartCoPilot pass.

    • Pro pass · 1 week₹79$2.99
    • 30 days₹179$5.99
    • 1 year₹1,699$45

    One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.

    It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes
  2. Mid to staff

    You are asked to implement the bill-splitting specification in an atlas language you have never used. How do you go from zero to twenty of twenty vectors with the fewest wrong turns, and what do you check before you trust the result?

    What it tests
    Working from a concept map and recorded probes instead of assumptions, ordering the work by risk, and knowing what public vectors can and cannot prove.
    First step
    Before writing the program, answer the rows the specification depends on for that language, with a probe run on its pinned toolchain: integer division of -1051 by 2, a half rounded, 1,000,000,000 × 1,800 in the integer type you plan to use, and the order of asha, Zoya and Bilal. The atlas mini-course of that language has recorded most of them already.
    Follow-ups

    From the lesson Capstone: one spec in twelve languages

    Model answer, Pro.

    In the answer:

    • Model answer
    • Follow-up answers
    • Common mistakes
    • Rubric
    • Variants
    • about 3 minutes

All Language Atlas (mini-courses for more languages) interview questions · The Language Atlas (mini-courses for more languages) track

Quick answers and tool search

Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.