Writing test cases in stripe interviews

Amazon / Eng
日出菊花

Go to company page Amazon Eng

日出菊花
Mar 10 16 Comments

I know that we need to write tests during interviews in stripe. Do they expect the tests written in JUnit? Or can it be verified by printing out the result?

Tc 200
Yoe 5

comments

Want to comment? LOG IN or SIGN UP
TOP 16 Comments
  • Stripe
    uxCj37

    Go to company page Stripe

    uxCj37
    I'd suggest using JUnit or the equivalent in your language because it gives a helpful message with the expected and actual results if your test fails. In coderpad you can click the info button and copy/paste their sample to save time. If you're using your own IDE, set up a single test beforehand and use that.

    Printing the result and inspecting it is ok for the first test but I always ask candidates to add an == <expected value> check so it prints true/false instead of inspecting output for subsequent tests. Doing it that way is fine too - I only care about the test cases, not your improvised test framework.
    Mar 10 0
  • Stripe
    shyama

    Go to company page Stripe

    shyama
    In my interviews, I wrote junit tests. And added more tests with subsequent parts of the question. Made it very easy to run all the tests with every small code update. Just like how you would test your change in real world before sending out the code review. Highly recommend setting up your ide with a project and required dependencies. Also please use the language you use day in day out and not the one which you think will let you write code faster. Saying I don’t use this language often is not going to work out in your favor.
    Mar 10 4
  • Stripe / Eng
    guanaco

    Go to company page Stripe Eng

    guanaco
    I used a test framework in my interview and had a simple test case set up beforehand. Time is limited so you want to spend those minutes working on the problem rather than looking up docs for assertions.

    You aren’t judged on your choice of framework/diy assertions, but it sends a positive signal that you are comfortable with the tooling in your chosen language.

    Simple equality or true/false assertions should be sufficient for the interview.
    Mar 10 2
  • Should be fine just writing functions
    Mar 10 1
  • Amazon / Eng
    日出菊花

    Go to company page Amazon Eng

    日出菊花
    OP
    Nice. Thanks all. I will set up my IDE beforehand and use JUnit.
    Mar 10 0