Ziphq Interview Questions
Practice the exact questions companies are asking right now.
Maximize non-adjacent sum on an N-ary tree
You are given an N-ary tree (each node may have 0..k children). Each node contains an integer value (can be 0 or positive). You want to select a set o...
Find flush and straight groups in cards
You are given an array of strings cards, where each string represents a distinct playing card. Each card string has the format <rank><suit>: - rank is...
Design in-memory DB with TTL and history
In-Memory Database: Progressive Design in 4 Levels You are designing a simplified in-memory database to be implemented in four progressive levels. Eac...
Compute maximum sum in a tree without adjacency
Given a tree where each node has an integer value, select a subset of nodes to maximize the sum under the constraint that if you choose a node, you ca...
Find root IDs and paths
You are given a collection of string blocks, each represented as a JSON object with fields {"id": string, "parentId": string | null}. A block is a roo...