Run-Length Encode a Numeric Vector and Compute Dot Product of Two Compressed Vectors
Given a vector containing groups of repeating numbers, implement a run-length encoding scheme to compress the vector using minimum memory. Then write a method to compute the dot product of two compressed vectors without fully decompressing them.
Asked at:
Meta
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early November, 2026
Meta
Staff
Given a vector containing groups of repeating numbers (ie <1,1,1,2,2,5,5,5,5,...>) express the vector using the minimum memory and then write a method to compute the dot product of two compressed vectors.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.