Gabriel
Henrique Gobi (Comp 23):
Acabei de passar por alguns processos seletivos para trocar de
empresa. Em alguns deles me foi cobrada uma etapa de
Live
Coding Interview seguindo um modelo proposto
pelas
big techs.
Envio abaixo os problemas do
LeetCode que me recordo
de terem aparecido e que envolvem estruturas de dados e
análise de algoritmos das entrevistas que fiz:
https://leetcode.com/problems/target-sum
(
DP,
backtracking)
https://leetcode.com/problems/longest-substring-without-repeating-characters
(
string, hash table, sliding window)
Teve ainda outro problema relacionado a estrutura de dados em
árvore que me foi passado ao vivo por um engenheiro do time
para que eu resolvesse para o processo. Transcrevo aqui o
enunciado:
Given list of folders, print the path of a given folder
from root. If there is no path to the root folder then
return an empty string. Root level folders will have 0 as
id. The structure of Folder is like this:
type Folder = [number, Array<number>, string] //
[id, subfolders_ids, folder_name]
Ex: const list = [[0, [7, 3], "abc"], [0, [], "xyz"],
[3, [], "pqr"], [11, [8], "pqr"], [8, [], "def"], [7, [9],
"ijk"], [9, [], "lmn"]]
Example responses for the given list above
printPath(9) = "abc -> ijk -> lmn"
printPath(8) = ""%
No meu novo emprego, estou tendo que me aprofundar um pouco
mais sobre LLMs e comecei a ler mais artigos e blog posts.
Encontrei esse que achei interessante no contexto da matéria
de algoritmos:
https://www.claudecodecamp.com/p/claude-code-1m-context-window
Destaco o seguinte texto:
In 2022, a Stanford researcher published a paper called
FlashAttention. The insight wasn't new math — the result is
identical to standard attention. The insight was that
attention is slow not because of the computation itself, but
because of how much data gets shuttled between fast on-chip
memory and slow off-chip memory.
If you've ever optimized a tight loop by improving
cache locality, the idea is the same. FlashAttention tiles
the computation so it stays in fast memory longer. Memory
usage drops from O(n²) to O(n). Training long sequences
becomes tractable.
This is the single biggest reason 100K, 200K, and 1M
contexts became possible. The hardware didn't change much.
The algorithm did.