青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

A Za, A Za, Fighting...

堅(jiān)信:勤能補(bǔ)拙

Google面試題

來(lái)源:
http://coolshell.cn/articles/3345.html

Software Engineer
  • Why are manhole covers round? (陳皓:為什么下水井蓋是圓的?這是有N種答案的,上Wiki看看吧)
  • What is the difference between a mutex and a semaphore? Which one would you use to protect access to an increment operation?
  • A man pushed his car to a hotel and lost his fortune. What happened? (陳皓:腦筋急轉(zhuǎn)彎?他在玩大富翁游戲?!!)
  • Explain the significance of “dead beef”.(陳皓:要是你看到的是16進(jìn)制 DEAD BEEF,你會(huì)覺(jué)得這是什么?IPv6的地址?)
  • Write a C program which measures the the speed of a context switch on a UNIX/Linux system.
  • Given a function which produces a random integer in the range 1 to 5, write a function which produces a random integer in the range 1 to 7.(陳皓:上StackOverflow看看吧,經(jīng)典的問(wèn)題)
  • Describe the algorithm for a depth-first graph traversal.
  • Design a class library for writing card games. (陳皓:用一系列的類來(lái)設(shè)計(jì)一個(gè)撲克游戲,設(shè)計(jì)題)
  • You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write a the question on a card which and give it to Eve who will take the card to Bob and return the answer to you. What must you write on the card, besides the question, to ensure Bob can encode the message so that Eve cannot read your phone number?(陳皓:協(xié)議+數(shù)字加密,我試想了一個(gè),紙條上可以這樣寫(xiě),“Bob,請(qǐng)把我的手機(jī)號(hào)以MD5算法加密后的字符串,比對(duì)下面的字符串——XXXXXX,它們是一樣的嗎?”)
  • How are cookies passed in the HTTP protocol?
  • Design the SQL database tables for a car rental database.
  • Write a regular expression which matches a email address. (陳皓:上StackOverflow查相當(dāng)?shù)膯?wèn)題吧。)
  • Write a function f(a, b) which takes two character string arguments and returns a string containing only the characters found in both strings in the order of a. Write a version which is order N-squared and one which is order N.(陳皓:算法題,不難,不說(shuō)了。一個(gè)O(n^2)和一個(gè)O(n)的算法復(fù)雜度)
  • You are given a the source to a application which is crashing when run. After running it 10 times in a debugger, you find it never crashes in the same place. The application is single threaded, and uses only the C standard library. What programming errors could be causing this crash? How would you test each one? (陳皓:和隨機(jī)數(shù)有關(guān)系?或是時(shí)間?)
  • Explain how congestion control works in the TCP protocol.
  • In Java, what is the difference between final, finally, and finalize?
  • What is multithreaded programming? What is a deadlock?
  • Write a function (with helper functions if needed) called to Excel that takes an excel column value (A,B,C,D…AA,AB,AC,… AAA..) and returns a corresponding integer value (A=1,B=2,… AA=26..).
  • You have a stream of infinite queries (ie: real time Google search queries that people are entering). Describe how you would go about finding a good estimate of 1000 samples from this never ending set of data and then write code for it.
  • Tree search algorithms. Write BFS and DFS code, explain run time and space requirements. Modify the code to handle trees with weighted edges and loops with BFS and DFS, make the code print out path to goal state.
  • You are given a list of numbers. When you reach the end of the list you will come back to the beginning of the list (a circular list). Write the most efficient algorithm to find the minimum # in this list. Find any given # in the list. The numbers in the list are always increasing but you don’t know where the circular list begins, ie: 38, 40, 55, 89, 6, 13, 20, 23, 36. (陳皓:循環(huán)排序數(shù)組的二分查找問(wèn)題)
  • Describe the data structure that is used to manage memory. (stack)
  • What’s the difference between local and global variables?
  • If you have 1 million integers, how would you sort them efficiently? (modify a specific sorting algorithm to solve this)
  • In Java, what is the difference between static, final, and const. (if you don’t know Java they will ask something similar for C or C++).
  • Talk about your class projects or work projects (pick something easy)… then describe how you could make them more efficient (in terms of algorithms).
  • Suppose you have an NxN matrix of positive and negative integers. Write some code that finds the sub-matrix with the maximum sum of its elements.(陳皓:以前見(jiàn)過(guò)一維數(shù)組的這個(gè)問(wèn)題,現(xiàn)在是二維的。感覺(jué)應(yīng)該是把二維的第一行的最大和的區(qū)間算出來(lái),然后再在這個(gè)基礎(chǔ)之上進(jìn)行二維的分析。思路應(yīng)該是這個(gè),不過(guò)具體的算法還需要想一想)
  • Write some code to reverse a string.
  • Implement division (without using the divide operator, obviously).(陳皓:想一想手算除法的過(guò)程。)
  • Write some code to find all permutations of the letters in a particular string.
  • What method would you use to look up a word in a dictionary? (陳皓:使用排序,哈希,樹(shù)等算法和數(shù)據(jù)結(jié)構(gòu))
  • Imagine you have a closet full of shirts. It’s very hard to find a shirt. So what can you do to organize your shirts for easy retrieval?
  • You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more. How can you fine the ball that is heavier by using a balance and only two weighings?
  • What is the C-language command for opening a connection with a foreign host over the internet?
  • Design and describe a system/application that will most efficiently produce a report of the top 1 million Google search requests. These are the particulars: 1) You are given 12 servers to work with. They are all dual-processor machines with 4Gb of RAM, 4x400GB hard drives and networked together.(Basically, nothing more than high-end PC’s) 2) The log data has already been cleaned for you. It consists of 100 Billion log lines, broken down into 12 320 GB files of 40-byte search terms per line. 3) You can use only custom written applications or available free open-source software.
  • There is an array A[N] of N numbers. You have to compose an array Output[N] such that Output[i] will be equal to multiplication of all the elements of A[N] except A[i]. For example Output[0] will be multiplication of A[1] to A[N-1] and Output[1] will be multiplication of A[0] and from A[2] to A[N-1]. Solve it without division operator and in O(n).(陳皓:注意其不能使用除法。算法思路是這樣的,把output[i]=a[i]左邊的乘積 x a[i]右邊的乘積,所以,我們可以分兩個(gè)循環(huán),第一次先把A[i]左邊的乘積放在Output[i]中,第二次把A[i]右邊的乘積算出來(lái)。我們先看第一次的循環(huán),使用迭代累積的方式,代碼如下:for(r=1; i=0; i<n-1; i++){ Output[i]=r; r*=a[i]; },看明白了吧。第二次的循環(huán)我就不說(shuō)了,方法一樣的。)
  • There is a linked list of numbers of length N. N is very large and you don’t know N. You have to write a function that will return k random numbers from the list. Numbers should be completely random. Hint: 1. Use random function rand() (returns a number between 0 and 1) and irand() (return either 0 or 1) 2. It should be done in O(n).(陳皓:本題其實(shí)不難。在遍歷鏈表的同時(shí)一邊生成隨機(jī)數(shù),一邊記錄最大的K個(gè)隨機(jī)數(shù)和其鏈接地址。)
  • Find or determine non existence of a number in a sorted list of N numbers where the numbers range over M, M>> N and N large enough to span multiple disks. Algorithm to beat O(log n) bonus points for constant time algorithm.(陳皓:使用bitmap,如果一個(gè)長(zhǎng)整形有64位,那么我們可以使用M/64個(gè)bitmap)
  • You are given a game of Tic Tac Toe. You have to write a function in which you pass the whole game and name of a player. The function will return whether the player has won the game or not. First you to decide which data structure you will use for the game. You need to tell the algorithm first and then need to write the code. Note: Some position may be blank in the game? So your data structure should consider this condition also.
  • You are given an array [a1 To an] and we have to construct another array [b1 To bn] where bi = a1*a2*…*an/ai. you are allowed to use only constant space and the time complexity is O(n). No divisions are allowed.(陳皓:前面說(shuō)過(guò)了)
  • How do you put a Binary Search Tree in an array in a efficient manner. Hint :: If the node is stored at the ith position and its children are at 2i and 2i+1(I mean level order wise)Its not the most efficient way.(陳皓:按順序遍歷樹(shù))
  • How do you find out the fifth maximum element in an Binary Search Tree in efficient manner. Note: You should not use use any extra space. i.e sorting Binary Search Tree and storing the results in an array and listing out the fifth element.
  • Given a Data Structure having first n integers and next n chars. A = i1 i2 i3 … iN c1 c2 c3 … cN.Write an in-place algorithm to rearrange the elements of the array ass A = i1 c1 i2 c2 … in cn(陳皓:這個(gè)算法其實(shí)就是從中間開(kāi)始交換元素,代碼:for(i=n-1; i>1; i++) {  for(j=i; j<2*n-i; j+=2) { swap(a[j], a[j+1]); } },不好意思寫(xiě)在同一行上了。)
  • Given two sequences of items, find the items whose absolute number increases or decreases the most when comparing one sequence with the other by reading the sequence only once.
  • Given That One of the strings is very very long , and the other one could be of various sizes. Windowing will result in O(N+M) solution but could it be better? May be NlogM or even better?
  • How many lines can be drawn in a 2D plane such that they are equidistant from 3 non-collinear points?
  • Let’s say you have to construct Google maps from scratch and guide a person standing on Gateway of India (Mumbai) to India Gate(Delhi). How do you do the same?
  • Given that you have one string of length N and M small strings of length L. How do you efficiently find the occurrence of each small string in the larger one?
  • Given a binary tree, programmatically you need to prove it is a binary search tree.
  • You are given a small sorted list of numbers, and a very very long sorted list of numbers – so long that it had to be put on a disk in different blocks. How would you find those short list numbers in the bigger one?
  • Suppose you have given N companies, and we want to eventually merge them into one big company. How many ways are theres to merge?
  • Given a file of 4 billion 32-bit integers, how to find one that appears at least twice? (陳皓:我能想到的是拆分成若干個(gè)小數(shù)組,排序,然后一點(diǎn)點(diǎn)歸并起來(lái))
  • Write a program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.(陳皓:你可能需要看看這篇文章Finding Frequent Items in Data Streams
  • Design a stack. We want to push, pop, and also, retrieve the minimum element in constant time.
  • Given a set of coin denominators, find the minimum number of coins to give a certain amount of change.(陳皓:你應(yīng)該查看一下這篇文章:Coin Change Problem
  • Given an array, i) find the longest continuous increasing subsequence. ii) find the longest increasing subsequence.(陳皓:這個(gè)題不難,O(n)算法是邊遍歷邊記錄當(dāng)前最大的連續(xù)的長(zhǎng)度。)
  • Suppose we have N companies, and we want to eventually merge them into one big company. How many ways are there to merge?
  • Write a function to find the middle node of a single link list. (陳皓:我能想到的算法是——設(shè)置兩個(gè)指針p1和p2,每一次,p1走兩步,p2走一步,這樣,當(dāng)p1走到最后時(shí),p2就在中間)
  • Given two binary trees, write a compare function to check if they are equal or not. Being equal means that they have the same value and same structure.(陳皓:這個(gè)很簡(jiǎn)單,使用遞歸算法。)
  • Implement put/get methods of a fixed size cache with LRU replacement algorithm.
  • You are given with three sorted arrays ( in ascending order), you are required to find a triplet ( one element from each array) such that distance is minimum. Distance is defined like this : If a[i], b[j] and c[k] are three elements then distance=max(abs(a[i]-b[j]),abs(a[i]-c[k]),abs(b[j]-c[k]))” Please give a solution in O(n) time complexity(陳皓:三個(gè)指針,a, b, c分別指向三個(gè)數(shù)組頭,假設(shè):a[0]<b[0]<c[0],推進(jìn)a直到a[i]>b[0],計(jì)算 abs(a[i-1] – c[0]),把結(jié)果保存在min中。現(xiàn)在情況變成找 a[i], b[0],c[0],重復(fù)上述過(guò)程,如果有一個(gè)新的值比min要小,那就取代現(xiàn)有的min。)
  • How does C++ deal with constructors and deconstructors of a class and its child class?
  • Write a function that flips the bits inside a byte (either in C++ or Java). Write an algorithm that take a list of n words, and an integer m, and retrieves the mth most frequent word in that list.
  • What’s 2 to the power of 64?
  • Given that you have one string of length N and M small strings of length L. How do you efficiently find the occurrence of each small string in the larger one? (陳皓:我能想到的是——把那M個(gè)小字串排個(gè)序,然后遍歷大字串,并在那M個(gè)字串中以二分取中的方式查找。)
  • How do you find out the fifth maximum element in an Binary Search Tree in efficient manner.
  • Suppose we have N companies, and we want to eventually merge them into one big company. How many ways are there to merge?
  • There is linked list of millions of node and you do not know the length of it. Write a function which will return a random number from the list.
  • You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write a the question on a card which and give it to Eve who will take the card to Bob and return the answer to you. What must you write on the card, besides the question, to ensure Bob can encode the message so that Eve cannot read your phone number?
  • How long it would take to sort 1 trillion numbers? Come up with a good estimate.
  • Order the functions in order of their asymptotic performance: 1) 2^n 2) n^100 3) n! 4) n^n
  • There are some data represented by(x,y,z). Now we want to find the Kth least data. We say (x1, y1, z1) > (x2, y2, z2) when value(x1, y1, z1) > value(x2, y2, z2) where value(x,y,z) = (2^x)*(3^y)*(5^z). Now we can not get it by calculating value(x,y,z) or through other indirect calculations as lg(value(x,y,z)). How to solve it?
  • How many degrees are there in the angle between the hour and minute hands of a clock when the time is a quarter past three?
  • Given an array whose elements are sorted, return the index of a the first occurrence of a specific integer. Do this in sub-linear time. I.e. do not just go through each element searching for that element.
  • Given two linked lists, return the intersection of the two lists: i.e. return a list containing only the elements that occur in both of the input lists. (陳皓:把第一個(gè)鏈表存入hash表,然后遍歷第二個(gè)鏈表。不知道還沒(méi)有更好的方法。)
  • What’s the difference between a hashtable and a hashmap?
  • If a person dials a sequence of numbers on the telephone, what possible words/strings can be formed from the letters associated with those numbers?(陳皓:這個(gè)問(wèn)題和美國(guó)的電話有關(guān)系,大家可以試著想一下我們發(fā)短信的手機(jī),按數(shù)字鍵出字母,一個(gè)組合的數(shù)學(xué)問(wèn)題。)
  • How would you reverse the image on an n by n matrix where each pixel is represented by a bit?
  • Create a fast cached storage mechanism that, given a limitation on the amount of cache memory, will ensure that only the least recently used items are discarded when the cache memory is reached when inserting a new item. It supports 2 functions: String get(T t) and void put(String k, T t).
  • Create a cost model that allows Google to make purchasing decisions on to compare the cost of purchasing more RAM memory for their servers vs. buying more disk space.
  • Design an algorithm to play a game of Frogger and then code the solution. The object of the game is to direct a frog to avoid cars while crossing a busy road. You may represent a road lane via an array. Generalize the solution for an N-lane road.
  • What sort would you use if you had a large data set on disk and a small amount of ram to work with?
  • What sort would you use if you required tight max time bounds and wanted highly regular performance.
  • How would you store 1 million phone numbers?(陳皓:試想電話是有區(qū)段的,可以把區(qū)段統(tǒng)一保存,F(xiàn)lyweight設(shè)計(jì)模式)
  • Design a 2D dungeon crawling game. It must allow for various items in the maze – walls, objects, and computer-controlled characters. (The focus was on the class structures, and how to optimize the experience for the user as s/he travels through the dungeon.)
  • What is the size of the C structure below on a 32-bit system? On a 64-bit? (陳皓:注意編譯器的對(duì)齊)

struct foo {

char a;
char* b;
};

posted on 2011-07-14 10:13 simplyzhao 閱讀(571) 評(píng)論(0)  編輯 收藏 引用 所屬分類: M_面試題集錦

導(dǎo)航

<2011年7月>
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456

統(tǒng)計(jì)

常用鏈接

留言簿(1)

隨筆分類

隨筆檔案

搜索

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产女人精品视频| 亚洲国产第一页| 欧美日韩中文在线观看| 亚洲激情电影中文字幕| 久久亚洲综合色| 久久欧美肥婆一二区| 亚洲欧美成人精品| 亚洲一区在线观看视频| 亚洲校园激情| 亚洲欧美一区二区视频| 亚洲欧美日韩视频二区| 欧美一区二区三区在线观看| 欧美一级专区| 麻豆成人av| 亚洲精品国产精品久久清纯直播 | 一本久道久久综合狠狠爱| 老司机午夜精品| 久久精品99国产精品日本| 久久爱www| 亚洲国产激情| 午夜综合激情| 欧美国产精品一区| 国产精品视频导航| 狠狠色噜噜狠狠色综合久| 亚洲第一伊人| 久久精品国产欧美激情| 亚洲欧洲一区二区天堂久久| 亚洲综合日韩| 女同性一区二区三区人了人一| 欧美日韩国产在线看| 伊人狠狠色j香婷婷综合| 亚洲欧美久久久久一区二区三区| 久久影院午夜论| 亚洲欧美日韩国产成人精品影院| 久久婷婷一区| 国产一区二区三区自拍| 亚洲一区二区三区欧美| 欧美激情片在线观看| 久久亚洲综合| 国产亚洲欧美在线| 一区二区激情| 欧美freesex交免费视频| 亚洲美女网站| 欧美电影免费观看高清完整版| 国内成人精品2018免费看| 亚洲欧美综合v| 亚洲一区二区高清| 国产日韩欧美综合| 久久国产日韩| 久久国产精品99国产精| 亚洲天堂成人| 免费看av成人| 一区二区电影免费在线观看| 最新日韩av| 欧美香蕉大胸在线视频观看| 欧美一区二区免费观在线| 亚洲欧洲日韩在线| 国产亚洲欧洲| 亚洲另类一区二区| 伊人一区二区三区久久精品| 亚洲精品乱码久久久久久| 欧美日韩一区二区在线| 久久这里只有精品视频首页| 美女日韩在线中文字幕| 一本色道久久88综合亚洲精品ⅰ | 国内揄拍国内精品久久 | 欧美一区二区三区婷婷月色 | 久久午夜影视| 欧美一区二区三区四区夜夜大片| 国产一区二区三区免费在线观看| 欧美激情精品久久久久久大尺度| 欧美另类综合| 久久天天躁狠狠躁夜夜爽蜜月| 欧美激情亚洲综合一区| 久久一区中文字幕| 国产精品私房写真福利视频| 亚洲人成亚洲人成在线观看| 久久精品国产91精品亚洲| 99精品视频免费全部在线| 男人天堂欧美日韩| 性欧美1819性猛交| 国产精品久久夜| 99av国产精品欲麻豆| 一本久久综合亚洲鲁鲁五月天| 久久久亚洲综合| 久久激情视频久久| 国产日产高清欧美一区二区三区| 亚洲国产欧美国产综合一区| 黄色在线一区| 农村妇女精品| 91久久久久久久久久久久久| 黑人巨大精品欧美黑白配亚洲| 日韩一本二本av| 欧美一区二区大片| 国产精品久久久久久久久久三级| 欧美成人国产va精品日本一级| 国产日韩欧美综合精品| 亚洲自拍偷拍色片视频| 免费在线日韩av| 亚洲最新色图| 欧美日韩中文字幕| 亚洲欧美视频在线| 欧美激情精品久久久久久变态| 亚洲第一网站免费视频| 国产日韩亚洲欧美精品| 欧美96在线丨欧| 亚洲少妇自拍| 亚洲女同同性videoxma| 国产免费观看久久| 欧美大胆a视频| 久久综合色天天久久综合图片| 亚洲精品一区二区三区婷婷月| 一区二区三区国产在线| 一区二区三区久久网| 1769国产精品| 在线观看的日韩av| 精品不卡一区| 久久最新视频| 亚洲国产一区视频| 欧美国产欧美亚洲国产日韩mv天天看完整 | 欧美午夜视频网站| 欧美精品在线观看91| 欧美成人小视频| 久久久久久久久久久成人| 欧美一区二区在线观看| 久久gogo国模啪啪人体图| 亚洲永久精品大片| 亚洲欧美日产图| 欧美在线影院在线视频| 免费看的黄色欧美网站| 欧美精品videossex性护士| 欧美日本不卡高清| 国产欧美日韩伦理| 亚洲电影免费观看高清完整版在线| 国产亚洲欧美日韩日本| 伊人蜜桃色噜噜激情综合| 亚洲伊人伊色伊影伊综合网| 欧美福利电影在线观看| 亚洲精品美女在线观看| 久久日韩粉嫩一区二区三区| 欧美电影电视剧在线观看| 亚洲精品一区久久久久久| 夜夜嗨av一区二区三区四季av| 欧美一区二区三区在线播放| 黄色一区二区在线观看| 亚洲性视频h| 欧美国产日本在线| 亚洲一区二区三区四区五区黄| 亚洲福利小视频| 9l国产精品久久久久麻豆| 亚洲在线观看免费| 麻豆精品91| 亚洲综合清纯丝袜自拍| 欧美精品免费视频| 国产精品一区免费视频| 99综合在线| 日韩五码在线| 欧美色中文字幕| 一二三区精品福利视频| 亚洲伦理中文字幕| 欧美成年人视频| 亚洲精品一区二区在线| 欧美高清视频一区二区| 免费欧美电影| 91久久国产自产拍夜夜嗨| 蜜桃av综合| 欧美精品一区二区三区视频 | 欧美在线综合| 国内成+人亚洲| 欧美福利在线| 国产精品视频yy9299一区| 亚洲少妇诱惑| 有坂深雪在线一区| 99在线精品观看| 国产一区二区三区四区| 欧美成人免费播放| 欧美三级特黄| 麻豆九一精品爱看视频在线观看免费| 久久嫩草精品久久久精品一| 亚洲精品一区二区网址| 久久国产精品第一页 | 久久久成人网| 亚洲欧美另类国产| 美女诱惑黄网站一区| 午夜精品久久久久久久99水蜜桃| 亚洲欧美日韩在线高清直播| 日韩视频在线免费观看| 麻豆九一精品爱看视频在线观看免费| 一区二区三区久久网| 久久亚洲精品视频| 久久精品国产久精国产爱| 日韩午夜电影av| 黄色亚洲大片免费在线观看| 亚洲欧美国内爽妇网| 欧美一级日韩一级| 国产精品美女久久久久aⅴ国产馆| 久久综合九九| 亚洲国产成人在线| 午夜精品久久久久久99热| 久久精品国产精品|