CTCI: Implement a jigsaw puzzle Design the data structures and explain an algorithm to solve the puzzle

First you need a "Piece" class to represent one piece of a puzzle. Each piece has four sides, each one with a unique outline which will only connect to one other piece. Edge sides have an "edge" outline. Each side also has a piece id attribute called "adjacent" to store the value of the piece… Continue reading CTCI: Implement a jigsaw puzzle Design the data structures and explain an algorithm to solve the puzzle

CTCI: Design the data structures for an online book reader system

The main entities will be - User Book Library Each user can have multiple book and each book can be subscribed to multiple user. Library maintains a list of all books. User - Each User will have few functions - addMemberShip(), renewMemberShip(), cancelMemberShip(), accessSubscribedBook(), readBook() Book - This can actually be split into two parts… Continue reading CTCI: Design the data structures for an online book reader system