分享2个电面题目# JobHunting - 待字闺中
p*u
1 楼
电面imo.im被问到的2个题目,45分钟,都需要写代码出来,结果是挂了。
问题二略微有点变态!
问题一
Subsequences
------------
You're given a large string T. And a stream of smaller string S1, S2, S3 ...
Determine whether Si is a subsequence of T.
|T| < 10 000 000
|Si| < 100
alphabet is 'a' - 'z'
T = abcdefg
S1 = abc yes
S2 = ag yes
S3 = ga no
S4 = aa no
--------------
问题二
Rectangles
----------
their is a window of size WxH contains Number of existing rectangles with
given (xi, yi, wi, hi).
Where to place a new rectangle with dimensions w, h such that the sum of the
overlapping area with existing rectangles is minimized.
* all current rectangles fit fully in the window
* place new window fully inside
* no existing windows overlap (but the new one may ovelap when you place it)
W,H < 10 000
N -- number of windows < 100
xi, yi, wi, hi, w, h -- no limitations other than fitting in the screen.
-----------
另外推荐一个微信公众号:待字闺中
每天会推荐一个不错的面试题,质量很高。
问题二略微有点变态!
问题一
Subsequences
------------
You're given a large string T. And a stream of smaller string S1, S2, S3 ...
Determine whether Si is a subsequence of T.
|T| < 10 000 000
|Si| < 100
alphabet is 'a' - 'z'
T = abcdefg
S1 = abc yes
S2 = ag yes
S3 = ga no
S4 = aa no
--------------
问题二
Rectangles
----------
their is a window of size WxH contains Number of existing rectangles with
given (xi, yi, wi, hi).
Where to place a new rectangle with dimensions w, h such that the sum of the
overlapping area with existing rectangles is minimized.
* all current rectangles fit fully in the window
* place new window fully inside
* no existing windows overlap (but the new one may ovelap when you place it)
W,H < 10 000
N -- number of windows < 100
xi, yi, wi, hi, w, h -- no limitations other than fitting in the screen.
-----------
另外推荐一个微信公众号:待字闺中
每天会推荐一个不错的面试题,质量很高。