Pergunta de entrevista da empresa Algotec

OO structure question of building a post system that can create notes on a screen. describe how you would do UNDO function. give 2 answers, one should be fast, the other low memory.

Resposta da entrevista

Sigiloso

7 de jul. de 2016

1. fast solution - keep the screen state at each iteration (high memory), but then after doing UNDO just return to the last screen (no need to re-draw all the notes). 2. memory solution - keep the drawing of screen and notes in a stack, each UNDO just pop the stack and re-draw the stack.

1