1. 给两个类A和B
class A {
public void foo (A a) {
...
}
}
class B extends A {
public void foo (B b) {
...
}
}
问这么写会不会有问题

如果是c++,在B类里面foo(A*a)这个函数是不可见的。也就是说 B b; A a; b.foo(&A);会报错。

2. 关于Database的题,假如你执行
select * from employee
employee是一个table

但是返回错误说,这个table不存在什么的,但是现在已知存在这个table,问你可能是
什么原因。

权限问题。不同用户创建的。通过grant usage可以限制某个表对该用户可见。

 mysql> GRANT USAGE ON `sharewe`.wp_users TO 'xxj'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

3. 一种字母游戏这样的
给定四个位置 _,_,_,_
然后每个位置可以选5个candidates,然后问这些candidates最多可以组成多少个有效
的词,字典是给定的。

比如,
如果字典是 [cake, bike, fake]
我们可以这样选candidates
第一个位置可以选 b,c,f,e,d
第二个位置 i,a,o,p,e
第三个位置 k,m,w,q,a
第四个位置 e,g,h,k,l
那这些可以组成3个有效的词 cake, bike, fake.

但是如果,这样选每个位置的candidates
第一个位置可以选 z,c,v,b,y
第二个位置 i,a,o,p,e
第三个位置 k,m,w,q,a
第四个位置 e,g,h,k,l

只能组成一个有效的词就是bike.
这样就是第一种选candidates的方法比较好。

然后问你怎么选每个位置的candidates,最终可以让能组成的词最多。

http://www.mitbbs.com/article_t/JobHunting/32739945.html

facebook面试题【转】的更多相关文章

  1. [LeetCode][Facebook面试题] 通配符匹配和正则表达式匹配,题 Wildcard Matching

    开篇 通常的匹配分为两类,一种是正则表达式匹配,pattern包含一些关键字,比如'*'的用法是紧跟在pattern的某个字符后,表示这个字符可以出现任意多次(包括0次). 另一种是通配符匹配,我们在 ...

  2. Careercup - Facebook面试题 - 6026101998485504

    2014-05-02 10:47 题目链接 原题: Given an unordered array of positive integers, create an algorithm that ma ...

  3. Careercup - Facebook面试题 - 5344154741637120

    2014-05-02 10:40 题目链接 原题: Sink Zero in Binary Tree. Swap zero value of a node with non-zero value of ...

  4. Careercup - Facebook面试题 - 5765850736885760

    2014-05-02 10:07 题目链接 原题: Mapping ' = 'A','B','C' ' = 'D','E','F' ... ' = input: output :ouput = [AA ...

  5. Careercup - Facebook面试题 - 5733320654585856

    2014-05-02 09:59 题目链接 原题: Group Anagrams input = ["star, astr, car, rac, st"] output = [[& ...

  6. Careercup - Facebook面试题 - 4892713614835712

    2014-05-02 09:54 题目链接 原题: You have two numbers decomposed in binary representation, write a function ...

  7. Careercup - Facebook面试题 - 6321181669982208

    2014-05-02 09:40 题目链接 原题: Given a number N, write a program that returns all possible combinations o ...

  8. Careercup - Facebook面试题 - 5177378863054848

    2014-05-02 08:29 题目链接 原题: Write a function for retrieving the total number of substring palindromes. ...

  9. Careercup - Facebook面试题 - 4907555595747328

    2014-05-02 07:49 题目链接 原题: Given a set of n points (coordinate in 2d plane) within a rectangular spac ...

  10. Careercup - Facebook面试题 - 5435439490007040

    2014-05-02 07:37 题目链接 原题: // merge sorted arrays 'a' and 'b', each with 'length' elements, // in-pla ...

随机推荐

  1. Gym - 101775L SOS 博弈 找规律

    题目:https://cn.vjudge.net/problem/Gym-101775L PS:训练赛中被这道题折磨的不轻,和队友反复推必胜态与必败态试图推导出公式或者规律,然后推的心态逐渐失控,,, ...

  2. CodeForce:16C-Monitor

    传送门:http://codeforces.com/problemset/problem/16/C Monitor time limit per test0.5 second memory limit ...

  3. poj 2251 三维地图最短路径问题 bfs算法

    题意:给你一个三维地图,然后让你走出去,找到最短路径. 思路:bfs 每个坐标的表示为 x,y,z并且每个点都需要加上时间 t struct node{ int x, y, z; int t;}; b ...

  4. BZOJ 2217: [Poi2011]Lollipop

    若sum可行 sum-2一定可行 序列和为ans 找出和ans奇偶性不同的最大的ans,即最靠左或最靠右的1的位置 更新答案 有spj #include<cstdio> using nam ...

  5. BZOJ 5336: [TJOI2018]party

    状压最长公共子序列的DP数组,一维最多K(15)个数,且相邻两个数的差不超过1,2^15种状态,预处理转移 #include<cstdio> #include<algorithm&g ...

  6. luogu3193 [HNOI2008]GT考试

    there #include <iostream> #include <cstdio> using namespace std; int n, m, mod, nxt[25], ...

  7. socketcluster 客户端请求

    <html> <head> <title>test</title> <script src="https://cdn.bootcss.c ...

  8. 十分钟了解HTTP协议

    概念 HTTP(Hypertext Transfer Protocol,超文本传输协议)是TCP/IP协议的应用(封装). HTTP协议是单向通讯,无状态,主要应用于B/S模型的网络软件,客户端一(多 ...

  9. python学习--学习时间属性的应用(time / datetime )

    #!/usr/bin/python # -*- coding:utf-8 -*- # import time # myd={1:'a',2:'b'}# for key,value in dict.it ...

  10. 如何让ie8/ie7/ie6支持html5的<footer></footer><nav></nav>等标签

    使用他们能让代码语义化更直观,而且更方便SEO优化.但是此HTML5新标签在IE6/IE7/IE8上并不能识别,需要进行JavaScript处理.以下就介绍几种方式. 方式一:Coding JavaS ...