Search
⌘K

Leetcode 244. Shortest Word Distance II

Given a list of words, design a class that can answer repeated queries returning the minimum index distance between two given words; optimize for many queries by preprocessing each word’s positions and computing the smallest gap between their index lists efficiently.

Asked at:

LinkedIn

LinkedIn


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Mid January, 2026

LinkedIn

LinkedIn

Senior

Mid January, 2026

LinkedIn

LinkedIn

Senior

2nd technical phone screen question

Mid January, 2026

LinkedIn

LinkedIn

Senior

The Question was worded as JobDesDistanceFinder which is very the same as Leetcode 244. Shortest Word Distance II.

Comments

Your account is free and you can post anonymously if you choose.