回复: 10
跳转到指定楼层
上一主题 下一主题
收起左侧

丢盒子 实习电面 新题

全局:

2018(1-3月) 码农类General 硕士 实习@dropbox - 校园招聘会 - 技术电面  | | Other | 应届毕业生

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
timeliness:
01.02 海投
01.24 收到OA,OA还是Folders and Cows
02.02 收到on campus interview邀请,没时间改成电面
02.20 电面

题目疑似新题 Space Panoram
大意就是实现一个class用来存放image,同时支持update image和fetc
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
e to do another round for more signal. 一脸懵逼。。。

废话不多说,下面是面试官给的api和要实现的class。
  1. import java.io.*;
  2. import java.util.*;

  3. /**
  4. * NASA selects Dropbox as its official partner, and we’re tasked with managing
  5. * a panorama for the universe. The Hubble telescope (or some other voyager we
  6. * have out there) will occasionally snap a photo of a sector of the universe,
  7. * and transmit it to us. You are to help write a data structure to manage this.
  8. * For the purpose of this problem, assume that the observable universe has been
  9. * divided into 2D sectors. Sectors are indexed by x- and y-coordinates.
  10. */
  11. public File {
  12.     public File(String path) {}
  13.     public Boolean exists() {}
  14.     public byte[] read() {}
  15.     public void write(bytes[] bytes) {}
  16. }

  17. public Image {
  18.     public Image(byte[] bytes) {}
  19.     byte[] getBytes() {} // no more than 1MB in size
  20. }

  21. public Sector {
  22.     public Sector(int x, int y) {}
  23.     int getX() {}
  24.     int getY() {}
  25. }

  26. /**
  27. * row-major indexing to be consistent.
  28. */
  29. public class SpacePanorama {
  30.     /**
  31.      * initializes the data structure. rows x cols is the sector layout.
  32.      * width, height can be as large as 1K each.
  33.      */
  34.     public SpacePanorama(int rows, int cols) {}

  35.     /**
  36.      * The Hubble will occasionally call this (via some radio wave communication)
  37.      * to report new imagery for the sector at (y, x)
  38.      * Images can be up to 1MB in size.
  39.      */
  40.     public void update(int y, int x, Image image) {}

  41.     /**
  42.      * NASA will occasionally call this to check the view of a particular sector.
  43.      */
  44.     public Image fetch(int y, int x) {}

  45.     /**
  46.      * return the 2D index of the sector that has the stalest data.
  47.      * the idea is that this may help the telescope decide where to aim next.
  48.      */
  49.     public Sector getStalestSector() {}
  50. }
复制代码

评分

参与人数 12大米 +48 收起 理由
这一站幸福 + 1 很有用的信息!
xzv666 + 1 很有用的信息!
bonniezhou0515 + 1 给你点个赞!
liz14 + 3 给你点个赞!
whosays + 3 很有用的信息!

查看全部评分


上一篇:果子Onsite面经
下一篇:狗家 1.9 实习两轮背靠背

本帖被以下淘专辑推荐:

🔗
wtcupup 2018-2-23 01:36:28 | 只看该作者
全局:
请问update function 思路是不是这样: 比较两个image, which are two byte arrays, 如果两个byte array 不一样了则更新old image?
回复

使用道具 举报

🔗
 楼主| ywhust 2018-2-23 04:21:48 | 只看该作者
全局:
wtcupup 发表于 2018-2-23 01:36
请问update function 思路是不是这样: 比较两个image, which are two byte arrays, 如果两个byte array 不 ...

我问面试官,他说你就直接replace就好了
回复

使用道具 举报

🔗
twjeric 2018-2-23 13:52:06 | 只看该作者
全局:
没看出来这题的考点是什么
回复

使用道具 举报

🔗
 楼主| ywhust 2018-2-23 23:34:39 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
a_stretch 2018-2-25 10:52:16 | 只看该作者
全局:
楼主,sector这个class是followup 才给的吗?还是说这个题就是map一下sector和image?
回复

使用道具 举报

🔗
 楼主| ywhust 2018-2-25 23:36:05 | 只看该作者
全局:
a_stretch 发表于 2018-2-25 10:52
楼主,sector这个class是followup 才给的吗?还是说这个题就是map一下sector和image?

是followup才给的
回复

使用道具 举报

🔗
mitchellhe 2018-3-4 00:33:31 | 只看该作者
全局:
我觉着就是HashMap, follow up是将HashMap转成LRU
回复

使用道具 举报

🔗
marlonli 2018-3-11 12:04:39 | 只看该作者
全局:
请问楼主 public SpacePanorama(int rows, int cols) {} 中的rows cols是什么意思
回复

使用道具 举报

🔗
pangxiong 2019-2-11 12:27:33 | 只看该作者
全局:
想问楼主,既然是覆盖图片,那么原始的文件路径在哪里?还是需要自己写创建文件?这个题目最后跑测试了吗?还是主要看过程
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表