Skip to content

Neutrin/java_8_streams

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

java_8_streams

This repo contains practice problems for java 8 streams

Return a list containing the two smallest and two largest orders by amount, in that combined order, without duplicates.

Using indices, return the IDs of every 3rd order starting from index 0, within bounds.

Return the earliest and the latest order by creation time (each as an optional).

Return orders whose delivery date is after “now” and before “now + 48h”.

Produce a distinct, sorted list of normalized user emails (trim + lowercase) for PAID orders.

Compute the exact total amount across all orders (assume a single currency).

Return the top N orders by amount (descending).

Compute the difference between the maximum and minimum order amounts.

Given a timestamp t, return the first PAID order created after t (optional).

Return orders whose updatedAt is within 24h of createdAt; clearly define inclusivity.

After sorting by creation time (newest first), return page p with page size k.

Join all order IDs into a single comma-separated string with deterministic ordering.

From order attributes, produce a sorted list of unique promo codes (ignore missing).

From all attributes maps, produce a flat list of key–value pairs, preserving encounter order.

Produce a list of delivery instants converted to a specified time zone, ignoring missing ones.

For each order, create two strings (prefix + id, id + suffix) and merge them into a single list.

Return whether all orders have strictly positive amounts.

Return whether any order’s amount exceeds a large threshold.

After sorting by amount (ascending), skip j orders and take m orders.

After sorting by creation time (ascending), return the list of differences between consecutive order amounts (length n-1, signs kept).

Approximate the 90th percentile amount by sorting ascending and selecting the element at your defined index; document your rounding rule.

Return all orders that are PAID and have amount > threshold.

From itemCount, compute min, max, sum, and average as a single summary result.

On an empty input list, return a default message instead of an order while keeping the same API shape.

Return a slice of IDs that results from applying prefix/suffix generation across orders (combined into one sequence).

About

This repo contains pratice problems for java 8 streams

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages