• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
neverlandly
博客园    首页    新随笔    联系   管理    订阅  订阅

随笔分类 -  面经

上一页 1 2 3 4 下一页
G面经prepare: Android Phone Unlock Pattern

摘要:Backtracking: 我的code不光可以知道数目,还可以打印所有Pattern 阅读全文
posted @ 2016-01-19 12:02 neverlandly 阅读(682) 评论(0) 推荐(0)
G面经prepare: Jump Game Return to Original Place

摘要:第二题 算法 给你一个arr 返回 T 或者 Farr的每个数代表从这个点开始跳几部,返回T的情况:从这个arr中任意一个数开始跳,可以在每个元素都跳到且只跳到一次的情况下返回到开始跳的元素比如[1,1,1,1,1,1] => T[0,1,1,1,1,1]=> F[7, 5, 2, 3] => F[... 阅读全文
posted @ 2016-01-19 04:12 neverlandly 阅读(418) 评论(0) 推荐(0)
G面经prepare: Reorder String to make duplicates not consecutive

摘要:字符串重新排列,让里面不能有相同字母在一起。比如aaabbb非法的,要让它变成ababab。给一种即可Greedy:跟FB面经Prepare task Schedule II很像,记录每个char出现次数,然后用最大堆,把剩下char里面出现次数多的优先Poll出来组建新的string如果poll出... 阅读全文
posted @ 2016-01-19 02:35 neverlandly 阅读(360) 评论(0) 推荐(0)
G面经prepare: Sort String Based On Another

摘要:Given a sorting order string, sort the input string based on the given sorting order string. Ex sorting order string -> dfbcae Input string -> abcdeea... 阅读全文
posted @ 2016-01-18 12:41 neverlandly 阅读(336) 评论(0) 推荐(0)
G面经Prepare: Valid Preorder traversal serialized String

摘要:1 求问下各位大神,怎么判断一个按照Preorder traversal serialized的binary tree的序列是否正确呢?不能deserialize成树比如2 A) 9 3 4 # # 1 # # 2 # 6 # #是对的,因为表示3 94 / ... 阅读全文
posted @ 2016-01-18 10:35 neverlandly 阅读(428) 评论(0) 推荐(0)
G面经prepare: Chucked Palindrome

摘要:给定一个字符串,找出最多有多少个chunked palindrome,正常的palindrome是abccba, chunked palindrome的定义是:比如volvo, 可以把vo划分在一起,(vo) (l) (vo),那么它是个palindrome。求实现返回最大的chunk 数量。比如... 阅读全文
posted @ 2016-01-17 11:18 neverlandly 阅读(906) 评论(0) 推荐(0)
G面经prepare: BuyGoods

摘要:给你一部分钱和一些不同价钱的商品,如何在最多买K件商品的情况下尽可能多的花掉手里的钱。举例:口袋里的钱数: 10; K=2 产品价格: [3, 6, 8, 7, 9] 输出 3, 7Backtracking: 1 package BuyGoods; 2 import java.uti... 阅读全文
posted @ 2016-01-17 06:01 neverlandly 阅读(502) 评论(0) 推荐(0)
G面经prepare: X-Straight

摘要:Define “X-Straight” as X cards with consecutive numbers (X >= 3). Determine if the deck can be fully divided into sets of “X-Straight”.Example: 1, 2, ... 阅读全文
posted @ 2016-01-16 04:35 neverlandly 阅读(704) 评论(0) 推荐(0)
G面经prepare: Friends Recommendation

摘要:想想如果你用linkedin或者facebook, 给你一个人和他的朋友关系网,你会怎么给一个人推荐朋友一个例子就是A-B, A-C, B - D, B - E, C - D,这个时候问我应该推荐谁给A,我说D,因为他是BC的共同好友,而E只是B的好友,到这我才明白干啥,就是给一个图和里面的一个节点... 阅读全文
posted @ 2016-01-16 00:52 neverlandly 阅读(971) 评论(0) 推荐(0)
G面经prepare: set difference

摘要:给你A{1,2,3,4,4,5}, B{2,4},求A-B={1,3,4,5},很简单. visit 1只用一个HashMap 1 package TwoSets; 2 import java.util.*; 3 4 public class Solution { 5 public Arr... 阅读全文
posted @ 2016-01-15 11:18 neverlandly 阅读(280) 评论(0) 推荐(0)
G面经prepare: Straight Partition of A Deck of Cards

摘要:Define “Straight” as 5 cards with consecutive numbers. Determine if the deck can be fully divided into sets of “Straight”.Example: 1, 2, 3, 4, 4, 5, 5... 阅读全文
posted @ 2016-01-15 08:05 neverlandly 阅读(837) 评论(1) 推荐(0)
Summary: Merge Sort of Array && 求逆序对

摘要:常用算法(后面有inplace版本): 1 package ArrayMergeSort; 2 3 import java.util.Arrays; 4 5 public class Solution { 6 public int[] mergeSort(int[] arr) { 7 if (arr 阅读全文
posted @ 2016-01-14 12:34 neverlandly 阅读(374) 评论(0) 推荐(0)
G面经Prepare: Search word delete sequence in dictionary

摘要:给一个单词一个字典,每次删除单词里任一个字母直到剩下一个字母,形成一个序列,比如office->offce->ofce->ofc->oc->c。问是否字典里存在一个这种序列 1 package checkDictExistSequence; 2 import java.util.*; 3 4 pu... 阅读全文
posted @ 2016-01-13 09:56 neverlandly 阅读(289) 评论(0) 推荐(0)
F面经prepare:strstr变种

摘要:* Given an integer k>=1 and two strings A and B (length ~n each); * Figure out if there is any common substring of length at least k. * (i.e. any str... 阅读全文
posted @ 2016-01-12 10:27 neverlandly 阅读(535) 评论(0) 推荐(0)
FB面经prepare: task schedule II

摘要:followup是tasks是无序的.一开始是有序的,比如说1, 1, 2, 1,一定要先执行第一个task1,然后等task1恢复,再执行第2个task1,再执行task2..... followup是无序的,就是不用按给的顺序执行,也就是可以先执行task1,然后task1还没恢复时,先执行ta... 阅读全文
posted @ 2016-01-11 07:12 neverlandly 阅读(1731) 评论(0) 推荐(0)
FB面经prepare: Task Schedule

摘要:每种task都有冷却时间,比如task1执行后,要经过interval时间后才能再次执行,求总共所需时间。用HashMap保存每一个task的下一次可以开始执行的最早时间 1 package TaskSchedule; 2 import java.util.*; 3 4 public class ... 阅读全文
posted @ 2016-01-11 07:09 neverlandly 阅读(1633) 评论(0) 推荐(0)
FB面经prepare: find k cloest points to a given point in 2D plane

只有注册用户登录后才能阅读该文。
posted @ 2016-01-11 04:40 neverlandly 阅读(11) 评论(0) 推荐(0)
转载:如何在面试中写出好的代码

摘要:一下都是我面试的经验和教训,欢迎各位大牛指正或者补充 1. 写代码之前,大脑里面要有个whole picture,不能想到哪儿写到哪儿。是你的大脑在写代码,而不是白板上你的手在代码。你的手只是一个printer里面的喷头而已,是它把你大脑里面的代码print到白板上,你的大脑才是控制那个喷头的芯片。 阅读全文
posted @ 2015-03-19 03:55 neverlandly 阅读(1769) 评论(0) 推荐(1)
F面经:painting house

摘要:There are a row of houses, each house can be painted with three colors red, blue and green. The cost of painting each house with a certain color is di... 阅读全文
posted @ 2015-03-18 04:49 neverlandly 阅读(1615) 评论(0) 推荐(0)
Climbing Stairs - Print Path

摘要:stair climbing, print out all of possible solutions of the methods to climb a stars, you are allowed climb one or two steps for each time; what is tim... 阅读全文
posted @ 2015-03-15 11:35 neverlandly 阅读(550) 评论(0) 推荐(0)

上一页 1 2 3 4 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3