Excel, PDF and CSV libraries
17 questions in 4 subtopics.
Excel with Apache POI
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.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?Users upload Excel files to your service. What security and resource risks does this bring and how do you mitigate them?Finance wants self-service Excel exports of any report, some with 2 million rows. Design the export capability for the platform.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
Writing 500,000 rows with XSSFWorkbook runs out of memory. Rewrite it with SXSSFWorkbook and explain the settings and cleanup needed.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 orFastExcel.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?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
Compare approaches to generating PDF invoices in Java: Apache PDFBox, OpenPDF, iText, and HTML-to-PDF with OpenHTMLtoPDF. What does licensing mean here?Your service must generate 100,000 PDF statements every month-end within two hours. Design the generation pipeline.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?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
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.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.Partners send daily CSV files with 10 million rows and often change columns. Design a robust ingestion process.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?No question matches these choices.