Parquet-Like Columnar Format Operations
Updated
Problem statement
Commands use WRITE|v0,v1,... or READ|start|end|c0,c1,.... A successful write returns WRITE: followed by column encodings separated by |, with runs written as value*count. A read returns READ: followed by rows separated by ;. A nonrectangular write returns ERROR and changes nothing.
Function
runColumnarFormat(operations: String[]) → String[]Examples
Example 1
operations = ["WRITE|1,5","WRITE|1,7","READ|0|2|1,0"]return = ["WRITE:1*1|5*1","WRITE:1*2|5*1,7*1","READ:5,1;7,1"]Columnar operation sequence 1 covers writes, reads, RLE boundaries, or rectangularity.
Example 2
operations = ["WRITE|3,3","READ|0|1|0"]return = ["WRITE:3*1|3*1","READ:3"]Columnar operation sequence 2 covers writes, reads, RLE boundaries, or rectangularity.
Constraints
1 <= operations.length <= 2000- The first write has at least one column.
- Read ranges satisfy
0 <= start <= end <= rowsWritten. - Read column indices are valid and nonempty.
More Jump Trading interview questions
Similar questions at other companies
- Segmented Durable Key-Value StoreOpenAI · PHONE SCREEN · ONSITE INTERVIEWOpenAI interview questions
- Nested Transaction Key-Value Store with Value CountsLyft · ONSITE INTERVIEWLyft interview questions
- Layered ASCII Canvas Command ProcessorAsana · ONSITE INTERVIEW
- In-Memory SQL with CSV InitializationMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
- In-Memory Database Historical LookupAnthropic · OAAnthropic interview questions
- Payment Ledger with Refunds and Date QueriesStripe · ONSITE INTERVIEWStripe interview questions
- Out-of-Order Loan LedgerValon · PHONE SCREEN
- Design In-Memory File SystemSnowflake · PHONE SCREENSnowflake interview questions
- Delivery Cost Tracker with Effective-Dated RatesRippling · PHONE SCREENRippling interview questions
- Dynamic Least-Loaded Job DispatcherCresta · PHONE SCREENCresta interview questions