楼主: 牛尾巴
34491 193

【学科前沿】Cracking the Coding Interview, 6th Edition   [推广有奖]

已卖:10459份资源

泰斗

38%

还不是VIP/贵宾

-

TA的文库  其他...

最新e书

2018新书

2017新书

威望
8
论坛币
630079 个
通用积分
57024.7551
学术水平
12700 点
热心指数
12976 点
信用等级
12465 点
经验
569184 点
帖子
9169
精华
66
在线时间
13174 小时
注册时间
2008-2-13
最后登录
2025-9-22

特级学术勋章 特级热心勋章 特级信用勋章 高级学术勋章 高级热心勋章 高级信用勋章

楼主
牛尾巴 发表于 2016-6-11 19:30:01 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
图书名称:Cracking the Coding Interview, 6th Edition: 189 Programming Questions and Solutions
作者:
Gayle Laakmann McDowell
出版社:
CareerCup
页数:687
出版时间:July
2015                           
语言:English

格式:pdf
内容简介:
I am not a recruiter. I am a software engineer. And as such, I know what it's like to be asked to whip up brilliant algorithms on the spot and then write flawless code on a whiteboard. I've been through this as a candidate and as an interviewer.

  Cracking the Coding Interview, 6th Edition is here to help you through this process, teaching you what you need to know and enabling you to perform at your very best. I've coached and interviewed hundreds of software engineers. The result is this book.

  Learn how to uncover the hints and hidden details in a question, discover how to break down a problem into manageable chunks, develop techniques to unstick yourself when stuck, learn (or re-learn) core computer science concepts, and practice on 189 interview questions and solutions.

  These interview questions are real; they are not pulled out of computer science textbooks. They reflect what's truly being asked at the top companies, so that you can be as prepared as possible.  WHAT'S INSIDE?
  • 189 programming interview questions, ranging from the basics to the trickiest algorithm problems.
  • A walk-through of how to derive each solution, so that you can learn how to get there yourself.
  • Hints on how to solve each of the 189 questions, just like what you would get in a real interview.
  • Five proven strategies to tackle algorithm questions, so that you can solve questions you haven't seen.
  • Extensive coverage of essential topics, such as big O time, data structures, and core algorithms.
  • A behind the scenes look at how top companies like Google and Facebook hire developers.
  • Techniques to prepare for and ace the soft side of the interview: behavioral questions.
  • For interviewers and companies: details on what makes a good interview question and hiring process

回复免费:

本帖隐藏的内容

Cracking the Coding Interview, 6th Edition 189 Programming Questions and Solutions.pdf (53.81 MB)





二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Interview Cracking Edition Coding editio software English through 出版社 write

回帖推荐

Nicolle 发表于5楼  查看完整内容

【学科前沿】Cracking the Coding Interview, 6th Edition 3 个回复 - 53 次查看图书名称:Cracking the Coding Interview, 6th Edition: 189 Programming Questions and Solutions[/backcolor] 作者:[/backcolor]Gayle Laakmann McDowell 出版社:CareerCup 页数:687 出版时间:July 2015 ...2016-6-11 19:30 - 牛尾巴 - winbugs专版 【2015新书】Cracking the Coding Interview: 60 Java Programming Questions 45 个回复 - ...
已有 7 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
狂热的爱好者 + 100 精彩帖子
np84 + 100 精彩帖子
Captain-CUI + 100 奖励积极上传好的资料
kychan + 100 + 5 + 5 + 5 精彩帖子
wwqqer + 100 + 3 奖励积极上传好的资料
Nicolle + 100 + 100 精彩帖子
kongqingbao280 + 100 + 40 + 1 奖励积极上传好的资料

总评分: 经验 + 700  论坛币 + 140  学术水平 + 5  热心指数 + 9  信用等级 + 5   查看全部评分

本帖被以下文库推荐

沙发
fumingxu 发表于 2016-6-11 19:34:03
1.3 URLify: Write a method to replace all spaces in a string with '%20'. You may assume that the string
has sufficient space at the end to hold the additional characters, and that you are given the "true"
length of the string. (Note: if implementing in Java, please use a character array so that you can
perform this operation in place.)
EXAMPLE
Input: "Mr John Smith ", 13
Output: "Mr%20John%20Smith"
  1. package Q1_03_URLify;

  2. import CtCILibrary.AssortedMethods;

  3. public class Question {
  4.         // Assume string has sufficient free space at the end
  5.         public static void replaceSpaces(char[] str, int trueLength) {
  6.                 int spaceCount = 0, index, i = 0;
  7.                 for (i = 0; i < trueLength; i++) {
  8.                         if (str[i] == ' ') {
  9.                                 spaceCount++;
  10.                         }
  11.                 }
  12.                 index = trueLength + spaceCount * 2;
  13.                 if (trueLength < str.length) str[trueLength] = '\0';
  14.                 for (i = trueLength - 1; i >= 0; i--) {
  15.                         if (str[i] == ' ') {
  16.                                 str[index - 1] = '0';
  17.                                 str[index - 2] = '2';
  18.                                 str[index - 3] = '%';
  19.                                 index = index - 3;
  20.                         } else {
  21.                                 str[index - 1] = str[i];
  22.                                 index--;
  23.                         }
  24.                 }
  25.         }
  26.        
  27.         public static int findLastCharacter(char[] str) {
  28.                 for (int i = str.length - 1; i >= 0; i--) {
  29.                         if (str[i] != ' ') {
  30.                                 return i;
  31.                         }
  32.                 }
  33.                 return -1;
  34.         }
  35.        
  36.         public static void main(String[] args) {
  37.                 String str = "Mr John Smith    ";
  38.                 char[] arr = str.toCharArray();
  39.                 int trueLength = findLastCharacter(arr) + 1;
  40.                 replaceSpaces(arr, trueLength);       
  41.                 System.out.println("\"" + AssortedMethods.charArrayToString(arr) + "\"");
  42.         }
  43. }
复制代码


已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

藤椅
hjtoh 发表于 2016-6-11 19:55:31 来自手机
牛尾巴 发表于 2016-6-11 19:30
图书名称:Cracking the Coding Interview, 6th Edition: 189 Programming Questions and Solutions[/backc ...
贴石好书
已有 1 人评分论坛币 收起 理由
Nicolle + 20 精彩帖子

总评分: 论坛币 + 20   查看全部评分

板凳
liydxjtu 发表于 2016-6-11 20:07:39
1.4 Palindrome Permutation: Given a string, write a function to check if it is a permutation of
a palindrome. A palindrome is a word or phrase that is the same forwards and backwards. A
permutation is a rearrangement of letters. The palindrome does not need to be limited to just
dictionary words.
EXAMPLE
Input: Tact Coa
Output: True (permutations: "taco cat'; "atc o eta·; etc.)

  1. Instead of checking the number of odd counts at the end, we can check as we go along. Then, as soon as
  2. we get to the end, we have our answer.
  3. boolean isPermutationOfPalindrome(String phrase) {
  4. int countOdd = 0;
  5. int[] table new int[Character.getNumericValue('z') -
  6. Character.getNumericValue('a') + 1];
  7. for (char c phrase.toCharArray()) {
  8. int x = getCharNumber(c);
  9. if (x != -1) {
  10. table[x]++;
  11. if (table[x] % 2 1) {
  12. countOdd++;
  13. } else {
  14. countOdd--;
  15. }
  16. }
  17. }
  18. return countOdd <= 1;
  19. }
复制代码


已有 1 人评分论坛币 收起 理由
Nicolle + 20 鼓励积极发帖讨论

总评分: 论坛币 + 20   查看全部评分

报纸
Nicolle 学生认证  发表于 2016-6-11 20:41:45
提示: 作者被禁止或删除 内容自动屏蔽

地板
duoduoduo 在职认证  发表于 2016-6-11 20:56:41
1.5 One Away: There are three types of edits that can be performed on strings: insert a character,
remove a character, or replace a character. Given two strings, write a function to check if they are
one edit (or zero edits) away.
EXAMPLE
pale, ple -> true
pales, pale -> true
pale, bale -> true
pale, bae -> false

  1. package Q1_05_One_Away;

  2. public class QuestionA {

  3.         public static boolean oneEditReplace(String s1, String s2) {
  4.                 boolean foundDifference = false;
  5.                 for (int i = 0; i < s1.length(); i++) {
  6.                         if (s1.charAt(i) != s2.charAt(i)) {
  7.                                 if (foundDifference) {
  8.                                         return false;
  9.                                 }
  10.                                
  11.                                 foundDifference = true;
  12.                         }
  13.                 }
  14.                 return true;
  15.         }
  16.        
  17.         /* Check if you can insert a character into s1 to make s2. */
  18.         public static boolean oneEditInsert(String s1, String s2) {
  19.                 int index1 = 0;
  20.                 int index2 = 0;
  21.                 while (index2 < s2.length() && index1 < s1.length()) {
  22.                         if (s1.charAt(index1) != s2.charAt(index2)) {
  23.                                 if (index1 != index2) {
  24.                                         return false;
  25.                                 }               
  26.                                 index2++;
  27.                         } else {
  28.                                 index1++;
  29.                                 index2++;
  30.                         }
  31.                 }
  32.                 return true;
  33.         }       
  34.        
  35.         public static boolean oneEditAway(String first, String second) {
  36.                 if (first.length() == second.length()) {
  37.                         return oneEditReplace(first, second);
  38.                 } else if (first.length() + 1 == second.length()) {
  39.                         return oneEditInsert(first, second);
  40.                 } else if (first.length() - 1 == second.length()) {
  41.                         return oneEditInsert(second, first);
  42.                 }
  43.                 return false;
  44.         }
  45.        
  46.         public static void main(String[] args) {
  47.                 String a = "pse";
  48.                 String b = "pale";
  49.                 boolean isOneEdit = oneEditAway(a, b);
  50.                 System.out.println(a + ", " + b + ": " + isOneEdit);
  51.         }

  52. }
复制代码


7
hyq2003 发表于 2016-6-11 21:32:53
1.6 String Compression: Implement a method to perform basic string compression using the counts
of repeated characters. For example, the string aabcccccaaa would become a2blc5a3. If the
"compressed" string would not become smaller than the original string, your method should return
the original string. You can assume the string has only uppercase and lowercase letters (a - z).
  1. package Q1_06_String_Compression;

  2. public class QuestionA {       
  3.         public static String compressBad(String str) {
  4.                 String compressedString = "";
  5.                 int countConsecutive = 0;
  6.                 for (int i = 0; i < str.length(); i++) {
  7.                         countConsecutive++;
  8.                        
  9.                         /* If next character is different than current, append this char to result.*/
  10.                         if (i + 1 >= str.length() || str.charAt(i) != str.charAt(i + 1)) {
  11.                                 compressedString += "" + str.charAt(i) + countConsecutive;
  12.                                 countConsecutive = 0;
  13.                         }
  14.                 }
  15.                 return compressedString.length() < str.length() ? compressedString : str;
  16.         }
  17.        
  18.         public static void main(String[] args) {
  19.                 String str = "aa";
  20.                 System.out.println(str);
  21.                 System.out.println(compressBad(str));
  22.         }
  23. }
复制代码


8
mengyong 发表于 2016-6-11 21:34:40
1.7 Rotate Matrix: Given an image represented by an NxN matrix, where each pixel in the image is 4
bytes, write a method to rotate the image by 90 degrees. Can you do this in place?

  1. package Q1_07_Rotate_Matrix;

  2. import CtCILibrary.*;

  3. public class Question {

  4.         public static boolean rotate(int[][] matrix) {
  5.                 if (matrix.length == 0 || matrix.length != matrix[0].length) return false; // Not a square
  6.                 int n = matrix.length;
  7.                
  8.                 for (int layer = 0; layer < n / 2; layer++) {
  9.                         int first = layer;
  10.                         int last = n - 1 - layer;
  11.                         for(int i = first; i < last; i++) {
  12.                                 int offset = i - first;
  13.                                 int top = matrix[first][i]; // save top

  14.                                 // left -> top
  15.                                 matrix[first][i] = matrix[last-offset][first];                        

  16.                                 // bottom -> left
  17.                                 matrix[last-offset][first] = matrix[last][last - offset];

  18.                                 // right -> bottom
  19.                                 matrix[last][last - offset] = matrix[i][last];

  20.                                 // top -> right
  21.                                 matrix[i][last] = top; // right <- saved top
  22.                         }
  23.                 }
  24.                 return true;
  25.         }
  26.        
  27.         public static void main(String[] args) {
  28.                 int[][] matrix = AssortedMethods.randomMatrix(3, 3, 0, 9);
  29.                 AssortedMethods.printMatrix(matrix);
  30.                 rotate(matrix);
  31.                 System.out.println();
  32.                 AssortedMethods.printMatrix(matrix);
  33.         }

  34. }
复制代码


9
auirzxp 学生认证  发表于 2016-6-11 21:40:46
提示: 作者被禁止或删除 内容自动屏蔽

10
karst 发表于 2016-6-11 21:58:11

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-30 05:08