P-7.5 Timed Practice: Linked Structures and Trees
You can write the standard linked-node and tree operations from memory under a clock, and say what each one costs.
The second question area, and the one where candidates most often know the theory and still cannot write it in ten minutes. What a screening round asks for here is narrow and predictable: walking a linked structure, reversing one, finding a middle, walking a tree in each of the three orders, and finding a height or a depth. A product interview adds balancing and less common traversals, which are in the data structures module rather than here. Write them by hand before you write them in an editor, because that is the format a live round uses.
Work through these
Walk a linked structure and reverse one, on paper, from memory
Reversing links is the single most asked question in this area and it turns on holding three references at once. Drawing the nodes and the arrows before writing is what stops the classic lost-tail mistake.
NPTEL: Programming in Java · CourseFind the middle in one pass, and say why two moving indexes are enough
One index moving twice as fast as the other lands on the middle when the fast one reaches the end. It is the clearest small example of the two-index shape from the previous topic.
Write the three tree walks in order, and say what each is used for
In-order, pre-order and post-order differ only in where the node is handled relative to its children. Knowing which one produces sorted output from a search tree is a common follow-up question.
NPTEL: Programming in Java · CourseCompute a height and check whether a tree is a search tree, both recursively
Both are small recursions over the same shape, and both are asked as warm-up questions in live rounds. The second one catches candidates who check only parents and children rather than ranges.
Take a timed set on these structures and record which ones you could not finish
Finishing matters more than elegance in a screening round, so the unfinished ones are the list that decides the next practice session.
IndiaBIX: Online Data Structures Test · Tutorial
Sign in to keep your progress.
Free resources
We haven't checked most of these for screen reader use yet.
Links last checked 2 Sept 2026.
Stuck here?
Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.
Checking your session…
Topics shown in module order.