Arrays practice problems
The workhorse. Walk a list, index into it, rearrange it in place. A concept: the material itself — what it is, and what it costs you to use. 102 problems in the bank train it, each with a worked example, a hint and a reference solution.
- Math
- Strings
- Arrays
- Hash maps
- Sorting
- Parsing
- Two pointers
- Sliding window
- Prefix sums
- Stacks
- Binary search
- Intervals
- Grids
- Greedy
- Recursion
- Simulation
- Bit manipulation
102 problems
- What the shelf is wortheasy
- Total a basket that came off a queueeasy
- Running balance down a statementeasy
- How many days in this montheasy
- Which trucks are overloadedeasy
- Cost of a planned routeeasy
- How many parcels missed the vaneasy
- Total minutes scheduledeasy
- How many slots are understaffedeasy
- Sum the invoice line itemseasy
- How much is still owedeasy
- Find a card after drawingeasy
- Drop the repeatseasy
- The second highest numbereasy
- The highest so fareasy
- Interleave two listseasy
- Read a grid by columnseasy
- How many of eacheasy
- How much room is lefteasy
- Single-byte checksum of a payloadeasy
- Reverse a list end to endeasy
- Push the empty slots to the endeasy
- Collapse repeats in a sorted feedeasy
- The day the account went undereasy
- The average so far, after every readingeasy
- Turn the rows into columnseasy
- Compare two version stringshard
- Decide each call against a rate limithard
- Split a total into installmentshard
- Who won the tic-tac-toe gamehard
- Score dice pairshard
- Distribute candies by ratinghard
- The peak in each windowhard
- The order that sortshard
- How many event pairs overlaphard
- How much work is still queuedhard
- Which station has the least workhard
- The quickest way to fill the orderhard
- How many stretches add up to the figurehard
- The next one taller than thishard
- How long this price has held uphard
- The smallest reading in a wrapped loghard
- Read the floor plan in a spiralhard
- Can any of these add up to ithard
- Price an order across volume tiersmedium
- Which pack size is the best valuemedium
- Replay a day of stock movementsmedium
- Which parts need attention firstmedium
- Pick an order off the shelvesmedium
- Group stock by how soon it expiresmedium
- Split an order across warehousesmedium
- Pick the coupon worth mostmedium
- Charge each request only oncemedium
- Split a bill without losing a kuruşmedium
- The best selling products this weekmedium
- Average spend per categorymedium
- The middle of a set of readingsmedium
- Bucket some readingsmedium
- Which month grew the mostmedium
- Find the bottleneckmedium
- How long to clear the order bookmedium
- The longest silence between heartbeatsmedium
- The p95 of a batch of latenciesmedium
- Should the alarm go offmedium
- Which required fields are missingmedium
- The middle of the listmedium
- Where a value slots inmedium
- Merge two sorted queuesmedium
- Find a value in a sorted listmedium
- Break a list into fixed-size piecesmedium
- Rotate a listmedium
- Find the two that add upmedium
- Which depot is closestmedium
- Parcel discount bandmedium
- Labour cost for the rostermedium
- Apply credits to an invoicemedium
- Average monthly figures for a yearmedium
- Count neighbouring live cellsmedium
- Look up a player levelmedium
- Find the longest winning streakmedium
- Totals per categorymedium
- The first repeatmedium
- Count the oversized gapsmedium
- The imbalance across a splitmedium
- How many openings in the coming weeksmedium
- How many active weekdays in a spanmedium
- Total minutes the line was downmedium
- Average downtime per stopmedium
- Total hours a machine ranmedium
- How many machines are past calibrationmedium
- Peak request burst in a sliding windowmedium
- The first missing sequence numbermedium
- The two readings that add upmedium
- The busiest stretch of the daymedium
- How often the load crossed the linemedium
- Answer a stack of range totalsmedium
- Where the ledger balancesmedium
- How many readings fall in the bandmedium
- Where the climb turns into a descentmedium
- Which commit broke the buildmedium
- Turn the floor plan a quarter turnmedium
- The reading that only came oncemedium