Fork this repo for this test. When you are done submit a PR against this repo.
Given the sample data provided, convert to csv in the format specified:
name, billing_code, avg_rate where avg_rate is the average of all negotiated_rate values for each record. Exclude records with an avg_rate greater than 30.
- Feel free to use any tools or libraries of your choice.
- The program should be as fast as possible.
- The program should accept inputs of unbounded size.
- The program should accept input from a file or STDIN.
- Output should be written to a file or STDOUT.
- Rust 1.70 or higher
- Cargo (Rust's package manager)
The program can be run in several ways:
- Process a file and output to a file:
cargo run --release -- -i sample.jsonl -o output.csv- Process from STDIN and output to STDOUT:
cargo run --release- Process a file and output to STDOUT:
cargo run --release -- -i sample.jsonl- Process from STDIN and output to a file:
cargo run --release -- -o output.csv- Streaming Processing: Processes data line by line
- Buffered I/O: Uses buffered readers and writers
- Memory Management: Minimal memory footprint through streaming
- Gracefully handles JSON parsing errors
- Provides detailed error reporting
- Continues processing despite individual record errors
serde: For JSON deserializationcsv: For CSV outputclap: For command-line argument parsingtokio: For async runtime support