Coding Interviews [electronic resource] : Questions, Analysis & Solutions /
He, Harry.author.
This book is about coding interview questions from software and Internet companies. It covers five key factors which determine performance of candidates: (1) the basics of programming languages, data structures and algorithms, (2) approaches to writing code with high quality, (3) tips to solve difficult problems, (4) methods to optimize code, (5) soft skills required in interviews. The basics of languages, algorithms and data structures are discussed as well as questions that explore how to write robust solutions after breaking down problems into manageable pieces. It also includes examples to focus on modeling and creative problem solving. Interview questions from the most popular companies in the IT industry are taken as examples to illustrate the five factors above. Besides solutions, it contains detailed analysis, how interviewers evaluate solutions, as well as why they like or dislike them. The author makes clever use of the fact that interviewees will have limited time to program meaningful solutions which in turn, limits the options an interviewer has. So the author covers those bases. Readers will improve their interview performance after reading this book. It will be beneficial for them even after they get offers, because its topics, such as approaches to analyzing difficult problems, writing robust code and optimizing, are all essential for high-performing coders.
Title Page; Copyright Page; Contents at a Glance; Table of Contents; About the Author; Acknowledgments; Introduction; Distinguishing Features; Summary of Chapters; Downloading the Code; CHAPTER 1 Interview Process; Types of Interviews; Phone Interviews; Phone-Screen Interviews; On-Site Interviews; Phases of Interviews; Behavior Interview; Project Experience; Technical Skills; "Why Do You Want to Change Your Current Job?"; Technical Interview; Basic Programming Knowledge; Clean, Complete, and Robust Code; Clear Thoughts about Solutions; Time and Space Efficiency; Soft Skills; Q/A Time; Summary
CHAPTER 2 Programming LanguagesC; Palindrome Numbers; Converting a Number into a String; Composing a Reversed Number; C++; C++ Concepts; Analyzing Execution of C++ Code; Implementing a Class or Member Function in C++; Assignment Operator; Classic, but Only Suitable for Newbie Developers; Exception Safety; C#; Singleton; Workable Only in Single-Threading Applications; Works with Multiple Threads but Is Inefficient; Double-Check around Locking; Utilization of Static Constructors; Creating an Instance When Necessary; Solution Comparison; Java; Java Keywords; Data Containers; Thread Scheduler
SummaryCHAPTER 3 Data Structures; Arrays; Duplication in an Array; Search in a 2-D Matrix; Binary Search on a Diagonal; Removing a Row or a Column at Each Step; String; Strings in C/C++; Strings in C#; Strings in Java; Replace Blanks in a String; Replace from Left to Right in O(n2) Time; Replace from Right to Left in O(n) Time; String Matching; Linked Lists; Print Lists from Tail to Head; Sort Lists; Loop in List; Trees; Next Nodes in Binary Trees; Binary Search Tree Verification; Verify Value Range of Each Node; Increasing In-Order Traversal Sequence; Stack and Queue
Build a Queue with Two StacksBuild a Stack with Two Queues; Summary; CHAPTER 4 Algorithms; Recursion and Iteration; Fibonacci Sequence; Recursive and Inefficient; Iterative Solution with O(n) Time Complexity; More Efficient in O(logn) Time; Search and Sort; Binary Search in Partially Sorted Arrays; Majorities in Arrays; Based on the Partition Method; Based on the Definition of Majority; Comparison; Backtracking; String Path in Matrix; Robot Move; Dynamic Programming and Greedy Algorithms; Edit Distance; Minimal Number of Coins for Change; Minimal Times of Presses on Keyboards; Bit Operations
Number of 1s in BinaryCheck the Rightmost Bit with Endless Loop; Left-Shift Operation on 1; Minus One and Then Bitwise AND; Numbers Occurring Only Once; Based on Arithmetic Calculation; Based on Bit Operations; Summary; CHAPTER 5 High-Quality Code; Clearness; Completeness; Test Cases for Completeness; Strategies to Handle Errors; Power of Integers; Incomplete; Complete but Inefficient; Complete and Efficient; Big Numbers as Strings; Underestimating Complexity; Simulating Increment on a String; Simulating Permutation; Delete Nodes from a List; Partition Numbers in Arrays
Workable but Not Scalable
Includes index.
This book is about coding interview questions from software and Internet companies. It covers five key factors which determine performance of candidates: (1) the basics of programming languages, data structures and algorithms, (2) approaches to writing code with high quality, (3) tips to solve difficult problems, (4) methods to optimize code, (5) soft skills required in interviews. The basics of languages, algorithms and data structures are discussed as well as questions that explore how to write robust solutions after breaking down problems into manageable pieces. It also includes examples to focus on modeling and creative problem solving. Interview questions from the most popular companies in the IT industry are taken as examples to illustrate the five factors above. Besides solutions, it contains detailed analysis, how interviewers evaluate solutions, as well as why they like or dislike them. The author makes clever use of the fact that interviewees will have limited time to program meaningful solutions which in turn, limits the options an interviewer has. So the author covers those bases. Readers will improve their interview performance after reading this book. It will be beneficial for them even after they get offers, because its topics, such as approaches to analyzing difficult problems, writing robust code and optimizing, are all essential for high-performing coders.
Programming languages (Electronic computers).
Computers.
Programming Languages, Compilers, Interpreters.
Information Systems and Communication Service.