Arize Interview Experience - Worst interviewer ever

arize logo
arize
August 24, 2026 · 0 reads

Summary

I interviewed at Arize and was asked to implement a multithreaded program that prints numbers from 0 to n using separate Zero, Odd, and Even threads.

Full Experience

The guy stayed quiet like a robot without uttering a word, smells toxicity. Anyway, here you go.

Posting the question here:

Problem Statement You need to print numbers in a sequence starting from 0 up to n. The sequence should look like: 0, 1, 2, 3, 4, ... , n The input will be a number n, and the program should print all numbers from 0 to n in order. Thread Requirements There will be three threads responsible for printing the numbers: Zero Thread Responsible for printing 0. The number 0 should be printed only once. Odd Thread Responsible for printing odd numbers: 1, 3, 5, 7, ... Even Thread Responsible for printing even numbers: 2, 4, 6, 8, ... Output Requirement Along with each number, the output must also indicate which thread printed the number. Example output format: 0 printed by ZeroThread 1 printed by OddThread 2 printed by EvenThread 3 printed by OddThread 4 printed by EvenThread ... n printed by respective thread Design Constraints There are some mandatory design considerations: You must implement three separate thread classes: ZeroThread OddThread EvenThread The business logic for printing numbers must remain inside the respective thread classes: Logic for printing 0 should be inside the ZeroThread class. Logic for printing odd numbers should be inside the OddThread class. Logic for printing even numbers should be inside the EvenThread class. The numbers must be printed strictly in sequence. The number 0 should appear exactly once in the output. Final Expected Behavior Given an input n, the output should be: 0 printed by ZeroThread 1 printed by OddThread 2 printed by EvenThread 3 printed by OddThread 4 printed by EvenThread ... n printed by the appropriate thread based on whether the number is odd or even.

Interview Questions (1)

1.

Multithreaded Number Printing

Data Structures & Algorithms

You need to print numbers in a sequence starting from 0 up to n. The sequence should look like: 0, 1, 2, 3, 4, ... , n. The input will be a number n, and the program should print all numbers from 0 to n in order.

There will be three threads responsible for printing the numbers:

  • Zero Thread: Responsible for printing 0. The number 0 should be printed only once.
  • Odd Thread: Responsible for printing odd numbers: 1, 3, 5, 7, ...
  • Even Thread: Responsible for printing even numbers: 2, 4, 6, 8, ...

The output must include which thread printed each number, e.g., 0 printed by ZeroThread, 1 printed by OddThread, etc.

Design constraints: implement three separate thread classes (ZeroThread, OddThread, EvenThread) with the printing logic inside each class, ensure numbers are printed strictly in sequence, and zero appears exactly once.

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!