Drawing Data Structures

Part two of a series on technical whiteboarding.

Visual communication is a valuable but often overlooked skill in software development. This guide provides a set of useful ways to draw common data structures and values. These can be used in any number of settings. They are especially useful when creating test cases, developing how an algorithm could solve a problem, and when stepping through code that relies heavily on data structures.

Primitives

Drawing numbers, booleans, & strings

Several numbers, strings, and boolean values.

Lists

Drawing lists

An array of prime numbers. A list of famous book opening lines. A linked list with 4 nodes.

Trees

Drawing trees

A binary tree with depth 3 and 6 nodes. An N-ary tree with depth 3 and 7 nodes. A DOM structure with body, header, nav, main, and footer.

Objects

Drawing objects

A Person object with information about the author. Several Room objects, with the connections from the hallway to its adjacent rooms.

Summary

While there is no single “correct” way to draw any data structure, drawing it consistently is important for clear communication. These recommendations are a set that have worked well in a variety of educational and professional settings.