Google·Software Engineer·Technical Phone Screen
- Given a customers table, an orders table, and a returns table, write a SQL query that returns one row per customer with total order count, total amount, latest order date, and the amount of that latest order. Customers with no orders should still appear.
- How would you modify the query to exclude returned orders from the totals?
- Given the heads of two sorted singly linked lists, merge them into one sorted linked list by reusing the existing nodes rather than creating new ones.
- How would you extend the linked list merge to handle k sorted lists instead of two?
“This one took longer than I expected.”