По порядку Junior спрашивают часто
Порядок шагов при решении задачи вслух
Вопрос
Расставь шаги лайв-кодинга в правильном порядке.
Попробуйте сами
Расставьте шаги по порядку стрелками.
- 1The brute-force approach would be O(n squared), but I think we can do better.
- 2OK, I'll start coding.
- 3Let me walk through a small example.
- 4Here's my plan. Does that sound reasonable?
- 5Let me trace through the example and check edge cases.
- 6Let me make sure I understand the problem.
Показать ответ и разбор
Ответ
Правильный порядок
- 1Let me make sure I understand the problem.
- 2Let me walk through a small example.
- 3The brute-force approach would be O(n squared), but I think we can do better.
- 4Here's my plan. Does that sound reasonable?
- 5OK, I'll start coding.
- 6Let me trace through the example and check edge cases.
Разбор
Уточнить → пример → наивное решение и идея → план и согласование → код → проверка.
Обновлено