Scrivio Interview library

Excel, PDF and CSV libraries

17 questions in 4 subtopics.

Excel with Apache POI

CodingFoundations7 min read
Use Apache POI to create an .xlsx file with a header row (Order, Customer, Amount) and data rows, format Amount as currency, and auto-size the columns.
DebuggingFoundations6 min read
Reading an uploaded Excel file with POI, cell.getStringCellValue() throws IllegalStateException: Cannot get a STRING value from a NUMERIC cell for an id column. Why, and how do you read cells robustly?
ScenarioIntermediate7 min read
Users upload Excel files to your service. What security and resource risks does this bring and how do you mitigate them?
DesignAdvanced7 min read
Finance wants self-service Excel exports of any report, some with 2 million rows. Design the export capability for the platform.
LeadershipPrincipal6 min read
Business processes in your company depend on hundreds of Excel files generated and consumed by systems, effectively making spreadsheets part of the architecture. How do you address this?

Streaming large Excel files

CodingFoundations6 min read
Writing 500,000 rows with XSSFWorkbook runs out of memory. Rewrite it with SXSSFWorkbook and explain the settings and cleanup needed.
InternalsIntermediate7 min read
How do you read a very large .xlsx file without loading it into memory? Compare POI's event API (XSSFReader with a SAX handler) with libraries such as excel-streaming-reader or FastExcel.
ScenarioAdvanced7 min read
A reporting service generating large Excel files causes repeated OOM kills in Kubernetes despite using SXSSF. What else could be using memory and disk, and how do you fix it?
DesignPrincipal6 min read
Large Excel exports cost significant compute and are often opened only to filter a few rows. How would you rethink reporting delivery for the company?

PDF generation

ConceptFoundations7 min read
Compare approaches to generating PDF invoices in Java: Apache PDFBox, OpenPDF, iText, and HTML-to-PDF with OpenHTMLtoPDF. What does licensing mean here?
DesignIntermediate7 min read
Your service must generate 100,000 PDF statements every month-end within two hours. Design the generation pipeline.
ScenarioAdvanced7 min read
Generated PDFs show missing characters for customers with Chinese and Arabic names, and accessibility audits fail. How do you fix this across your PDF generation?
LeadershipPrincipal6 min read
Your company produces millions of customer documents (statements, contracts, invoices) with five different in-house generators. Do you build a central document platform or buy one?

CSV with OpenCSV and Commons CSV

CodingFoundations6 min read
Parse a CSV file with header customer_id,name,amount using Apache Commons CSV, handling quoted fields with commas, and map rows to a record.
ScenarioIntermediate7 min read
Users download CSV exports and open them in Excel. A security review flags CSV injection. Explain the risk and how to mitigate it when writing CSV with OpenCSV or Commons CSV.
DesignAdvanced7 min read
Partners send daily CSV files with 10 million rows and often change columns. Design a robust ingestion process.
LeadershipPrincipal6 min read
Much of your company's partner data exchange still runs on CSV files over SFTP. Should you invest in moving partners to APIs or event streams?