This problem set evaluates practical coding competencies including string parsing and sign handling, positional and frequency-based matching for feedback scoring, grid pathfinding via backtracking traversal, and binary-tree vertical ordering using column indices and level-order traversal, testing data structure knowledge (arrays, hash maps, trees) and algorithmic techniques (search, traversal, and counting). It is commonly asked in the Coding & Algorithms domain to measure correctness on edge cases, handling of duplicates and positional constraints, and implementation efficiency; the tasks are primarily practical implementation problems that also require conceptual understanding of algorithmic trade-offs and traversal strategies.
Implement a function:
parseInt(s: string) -> int
Given a string s representing a base-10 integer, return its integer value.
Assumptions (make explicit during interview):
s
may contain an optional leading
+
or
-
.
s
contains only digits after the optional sign (no decimals).
0
or throw/return an error value (state your choice).
Examples
"123" -> 123
"-45" -> -45
Implement a function:
scoreWordle(guess: string, target: string) -> string
Both strings have the same length n.
Return a result string of length n where each position indicates:
G
(green):
guess[i] == target[i]
Y
(yellow):
guess[i]
occurs in
target
but
not
at position
i
, and the occurrence is not already “used up” by other matches (i.e., handle duplicates correctly)
B
(black/gray): the letter does not occur in the remaining unused letters of
target
Example
guess = "allee", target = "apple" -> "GYBYB"
Given an m x n grid of characters board and a string word, determine if word can be formed by a path in the grid.
Rules:
Return true if the word exists, else false.
Given the root of a binary tree, return its vertical order traversal:
0
, left child
-1
, right child
+1
).
Return a list of columns, e.g. [[col-2 nodes], [col-1 nodes], ..., [col+2 nodes]].