Design a highly consistent and is network partition tolerant DB

Link to original IntervieBit article Q: What is the amount of data that we need to store?  Anwer: Let's assume a few 100 TB. Q: Do we need to support updates?  A: Yes. Q: Can the size of the value for a key increase with updates?  A: Yes. In other words, its possible a sequence of keys could co-exist on one server previously,… Continue reading Design a highly consistent and is network partition tolerant DB

Advertisements

CTCI: Given an input file with four billion integers, provide an algorithm to generate an integer which is not contained in the file.

Given an input file with four billion integers, provide an algorithm to generate an integer which is not contained in the file. Assume you have 1 GB of memory FOLLOW UP What if you have only 10 MB of memory? Solution There are a total of 2^32, or 4 billion, distinct integers possible. We have… Continue reading CTCI: Given an input file with four billion integers, provide an algorithm to generate an integer which is not contained in the file.

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