Apr 24, 2017

Basic Coding Vocabulary

Coding has an extensive vocabulary that to laymen can seem like impenetrable techno-babble. Whether you’re reading coding-related article online or speaking to a developer at work, you may hear words that you __have not heard before or that __have a different meaning in a coding context. Here are some common vocabulary words to know:

  • General web development terms:
    • Server: A computer that hosts website code, and that “serves” website code when requested by a “client” computer. Servers usually sit in large warehouses with thousands of other servers, and are similar in size and power to your home computer.
    • Client: A device used to access a website, including desktop or laptop computers, tablets, or mobile phones.
    • Designer: An artistic professional who decides how a website will look and feel, along with the ways users will interact with the website — such as, for example, clicking, swiping, scrolling, and so on.
    • Wireframe: An illustration created by designers that show in detail a website’s layouts, images, and color schemes.
    • Developer: An engineering professional who writes code to turn wireframes into useable websites. Based on the type of code written, developers are referred to as front-end, back-end, or full stack.
    • Front-end: Everything you can see and click in a browser. Front-end developers write code in front-end languages like HTML, CSS, and JavaScript to create the website appearance.
    • Back-end: Everything that happens behind-the-scenes to make the front-end perform as intended. Back-end developers write code in back-end languages like Ruby or Python to create functionality like logging in users, storing user preferences, and retrieving data like comments on a photo.
  • Terms related to front-end languages:
    • HTML (Hypertext Markup Language): A language used to place text, images, and other content on a webpage.
    • HTML tag: HTML instructions, usually appearing in pairs. Browsers apply special effects to text between an opening <element>; and closing </element>; HTML tag. For instance, the <h1>; tag renders in a browser as a large bolded headline and can be used like this: <h1>Dewey beats Truman</h1>.
    • HTML attribute: Attributes or parameters for HTML tags that modify the tag’s behavior. Attributes are always placed in the opening HTML tag. For example, href is the attribute in the following anchor tag (used to create hyperlinks):
      <a href="http://www.google.com">Search engine</a>
    • CSS (Cascading Style Sheets): Code that modifies HTML on webpages and that controls the appearance of content by changing text size, image size, and other attributes.
    • JavaScript: Code that adds interactivity and animation to webpages. JavaScript also detects browser events such as mouse clicks, validates user input such as text entries, and retrieves data from external websites.
    • Variable: A storage location that’s given a name and that contains numerical data or text (referred to as strings) for later use.
    • If statement (conditional): A code instruction that tests a condition that usually includes variables, such as x < 18, and executes code you write when the condition is true.
    • Function: A name given to a group of programming statements for easy reference and use.
  • Terms related to back-end languages:
    • Ruby: An open-source programming language best known for use in web programming.
    • Rails: A framework designed to make creating webpages with Ruby easy.
    • Python: An open-source programming language used on the web, in scientific applications, and for data analysis.

References and Resources for the Beginning Programmer

HTML, CSS, and JavaScript are the most common front-end coding languages. Following is a list of some online resources, references, and tutorials to help you continue practicing all three languages.

  • W3Schools: Reference guides for HTML, CSS, and JavaScript
  • HTML cheat sheet: Most commonly used HTML commands
  • CSS cheat sheet: Most commonly used CSS commands
  • HTML tutorials: Tutorials and articles for the web maintained by Google
  • CSS tutorials: Tutorials and articles for web programming, with a focus on CSS
  • JavaScript tutorials: Tutorials and reference guides for JavaScript

Performing in a Coding Job Interview

You’ve filtered coding job postings, networked with dozens of people, created a great portfolio site, and finally landed one or more interviews. Use these tips to maximize the chances of turning the interview into an offer for employment:

  • Prepare diligently: Review the company’s website, blog posts, news releases, tweets, and any other social media to learn more about the company’s culture, technologies, and past clients. For public companies, browse annual reports to get a sense for past performance and future strategic goals.
  • Advocate for yourself: You know what you want and why, so make sure you communicate that to your future potential employer. Think about why you want to work at the company, which product you’d be most excited to work on, and what you want to spend the next few months and years learning technically. If you don’t __have any preferences or thoughts, it can be hard for an employer to believe that you’re excited about the company and that you’ll __have the motivation to keep learning on the job.
  • Sharpen technical skills: Assessment of technical skills are the big part of any coding interview, so review code for programs you’ve already built and make sure you understand why you made certain decisions and used certain technologies. A big part of your job will be deciding what tools to use and when, and employers want to see as soon as possible your thought process on how you choose your tools.
  • Show your fit: Many candidates are technically competent but fail the fit interview. Make sure you understand before the interview the company’s culture and values so you’ll have time to see whether you’ll fit in.
  • Ask questions: Demonstrate your passion by asking questions that are not answered on the company website. Your interviewer has likely just spent thirty minutes asking you personal questions, so feel free to ask some personal questions of your own about the role, the work, or the company.
  • Follow up: After the interview is over, your interviewers will categorize you as a definite hire, possible hire, or rejected candidate. Many people fall into the possible hire category, and following up with your interviewers can increase your chances of receiving an offer. After your interview, send a short email thanking your interviewers, reinforcing your key skills, and addressing any weak areas that came up during the interview. Additionally, include a brief reference to any personal interests you shared with your interviewers to help them remember you.

Locating the Algorithm You Need

The following table describes algorithms and algorithm types that you might find useful for various types of data analysis. (You can find discussions of all these algorithms in Algorithms For Dummies.)

Algorithm Description Helpful Link
A * Search The algorithm tracks the cost of nodes as it explores them using the equation: f(n) = g(n) + h(n), where:

n is the node identifier

g(n) is the cost of reaching the node so far

h(n) is the estimated cost to reach the goal from the node

f(n) is the estimated cost of the path from n to the goal

The idea is to search the most promising paths first and avoid expensive paths.

Standford.edu
Balanced Tree A kind of tree that maintains a balanced structure through reorganization so that it can provide reduced access times. The number of elements on the left side differs from the number on the right side by one at most. Webdocs
Bidirectional Search This technique searches simultaneously from the root node and the goal node until the two search paths meet in the middle. An advantage of this approach is that it’s time efficient because it finds the solution faster than many other brute-force solutions. In addition, it uses memory more efficiently than other approaches and always finds a solution. The main disadvantage is complexity of implementation. Planning.cs
Binary Tree This is a type of tree containing nodes that connect to zero (leaf nodes), one, or two (branch nodes) other nodes. Each node defines the three elements that it must include to provide connectivity and store data: data storage, left connection, and right connection. cs.cmu.edu
Breadth-First Search This technique begins at the root node, explores each of the child nodes first, and only then moves down to the next level. It progresses level by level until it finds a solution. The disadvantage of this algorithm is that it must store every node in memory, which means that it uses a considerable amount of memory for a large number of nodes. This technique can check for duplicate nodes, which saves time, and it always comes up with a solution. Khan Academcy
Brute Force This is a technique of problem solving in which someone tries every possible solution, looking for the best problem solution. Brute-force techniques do guarantee a best-fit solution when one exists but are so time consuming to implement that most people avoid them. Igm.univ
Depth-First Search This technique begins at the root node and explores a set of connected child nodes until it reaches a leaf node. It progresses branch by branch until it finds a solution. The disadvantage of this algorithm is that it can’t check for duplicate nodes, which means that it could traverse the same node paths more than once. In fact, this algorithm may not find a solution at all, which means that you must define a cutoff point to keep the algorithm from searching infinitely. An advantage of this approach is that it’s memory efficient. Hacker Earth
Divide and Conquer This is a technique of problem solving in which the problem is broken into the smallest possible pieces and solved using the simplest approach possible. This technique saves considerable time and resources when compared to other approaches, such as brute force. However, it doesn’t always guarantee a best-fit result. Khan Academy
Dijikstra This is an algorithm used for finding the shortest path in a directed, weighted (having positive weights) graph. Geeks for Geeks
Graph A graph is a sort of a tree extension. As with trees, you __have nodes that connect to each other to create relationships. However, unlike binary trees, a graph can __have more than one or two connections. In fact, graph nodes often have a multitude of connections. You see graphs used in places like maps for GPS and all sorts of other places for which the top-down approach of a tree won’t work. Tutorials
Greedy Algorithms Thistechnique of one of problem solving in which the solution relies on the best answer for every step of the problem-solving process. Greedy algorithms generally make two assumptions:

Making a single optimal choice at a given step is possible.

By choosing the optimal selection at each step, finding an optimal solution for the overall problem is possible.

Tutorials
Greedy Best-First Search (BFS) The algorithm always chooses the path that is closest to the goal using the equation: f(n) = h(n). This particular algorithm can find solutions quite quickly, but it can also get stuck in loops, so many people don’t consider it an optimal approach to finding a solution. Centurion2
Hashing This is a method of predicting the location of a particular data item in the data structure (whatever that structure might be) before actually looking for it. This approach relies on the use of keys placed into an index. A hash function turns the key into a numeric value that the algorithm places into a hash table. A hash table provides the means to create an index that points to elements in a data structure so that an algorithm can easily predict the location of the data. Tutorials
Heap This is a sophisticated tree that allows data insertions into the tree structure. The use of data insertion makes sorting faster. You can further classify these trees as max heaps and min heaps, depending on the tree’s capability to immediately provide the maximum or minimum value present in the tree. Tutorials
Heuristics This is a technique of problem solving that relies on self-discovery and produces sufficiently useful results (not necessarily optimal, but good enough) to address a problem well enough that a better solution isn’t necessary. Self-discovery is the process of allowing the algorithm to show you a potentially useful path to a solution (but you must still count on human intuition and understanding to know whether the solution is the right one). Northwest.edu
MapReduce This is a framework for making algorithms work using computations in parallel (using multiple computers connected together in a network), allowing algorithms to complete their solutions faster. Hadoop Apache
Mergesort Mergesort is a general-purpose, comparison based method of sorting data. It depends on a divide-and-conquer approach to performing its task. Geeks for Geeks
Nash Equilibrium This is a game theory in which the other players know the equilibrium strategy for the other players, so no one has anything to gain by changing his or her personal strategy. This theory sees use in any hostile situation in which the player must account for the decisions made by all of the other players in order to win the game. Khan Academy
PageRank PageRank is an algorithm for measuring the importance of a node in a graph. This algorithm is at the root of the Google’s core algorithms for powering relevant searches to users. Princeton.edu
Pure Heuristic Search This algorithm expands nodes in order of their cost. It maintains two lists. The closed list contains the nodes that it has already explored, and the open list contains the nodes it must yet explore. In each iteration, the algorithm expands the node with the lowest possible cost. All its child nodes are placed in the closed list and the individual child node costs are calculated. The algorithm sends the child nodes with a low cost back to the open list and deletes the child nodes with a high cost. Consequently, the algorithm performs an intelligent, cost-based search for the solution. World of Computing
Quicksort This is a general-purpose sorting strategy based on partitioning arrays of data into smaller arrays. It depends on a divide-and-conquer approach to performing its task. Tutorials
Unbalanced Tree This is a tree that places new data items wherever necessary in the tree without regard to balance. This method of adding items makes building the tree faster but reduces access speed when searching or sorting. Quora

Dealing with Algorithm Complexity

You already know that algorithms are complex. However, you need to know how complex an algorithm is because the more complex one is, the longer it takes to run. The following table helps you understand the various levels of complexity presented in order of running time (from fastest to slowest).

Complexity Description
Constant complexity O(1) Provides an unvarying execution time, no matter how much input you provide. Each input requires a single unit of execution time.
Logarithmic complexity O(log n) The number of operations grows at a slower rate than the input, making the algorithm less efficient with small inputs and more efficient with larger ones. A typical algorithm of this class is the binary search.
Linear complexity O(n) Operations grow with the input in a 1:1 ratio. A typical algorithm is iteration, when you scan input once and apply an operation to each element of it.
Linearithmic complexity O(n log n) Complexity is a mix between logarithmic and linear complexity. It is typical of some smart algorithms used to order data, such as Mergesortsort, Heapsort, and Quicksort.
Quadratic complexity O(n2) Operations grow as a square of the number of inputs. When you __have one iteration inside another iteration (called nested iterations in computer science), you __have quadratic complexity. For instance, you have a list of names and, in order to find the most similar ones, you compare each name against all the other names. Some less efficient ordering algorithms present such complexity: bubble sort, selection sort, and insertion sort. This level of complexity means that your algorithms may run for hours or even days before reaching a solution.
Cubic complexity O(n3) Operations grow even faster than quadratic complexity because now you have multiple nested iterations. When an algorithm has this order of complexity and you need to process a modest amount of data (100,000 elements), your algorithm may run for years. When you have a number of operations that is a power of the input, it is common to refer to the algorithm as running in polynomial time.
Exponential complexity O(2n) The algorithm takes twice the number of previous operations for every new element added. When an algorithm has this complexity, even small problems may take forever. Many algorithms doing exhaustive searches have exponential complexity. However, the classic example for this level of complexity is the calculation of Fibonacci numbers.
Factorial complexity O(n!) This algorithm presents a real nightmare of complexity because of the large number of possible combinations between the elements. Just imagine: If your input is 100 objects, and an operation on your computer takes 10-6 seconds (a reasonable speed for every computer nowadays), you will need about 10140 years to complete the task successfully (an impossible amount of time because the age of the universe is estimated as being 1014 years). A famous factorial complexity problem is the traveling salesman problem, in which a salesman has to find the shortest route for visiting many cities and coming back to the starting city.

Differentiating Algorithms from Other Math Structures

If you’re like most people, you often find yourself scratching your head when it comes to math structures because no one seems to know how to use the terms correctly. It’s as though people are purposely trying to make things hard! After all, what is an equation and why is it different from an algorithm? Well, fear no more: The following table provides the definitive guide to math structures that you might encounter but __have been afraid to ask about.

Structure Description
Equation Numbers and symbols that, when taken as a whole, equate to a specific value. An equation always contains an equals sign so that you know that the numbers and symbols represent the specific value on the other side of the equals sign. Equations generally contain variable information presented as a symbol, but they aren’t required to use variables.
Formula A combination of numbers and symbols used to express information or ideas. A formula normally presents mathematical or logical concepts, such as to define the Greatest Common Divisor (GCD) of two integers (the video at Khan Academy tells how this works). Generally, a formula shows the relationship between two or more variables. Most people see a formula as a special kind of equation.
Algorithm A sequence of steps used to solve a problem. The sequence presents a unique method of addressing an issue by providing a particular solution. An algorithm need not represent mathematical or logical concepts, even though the presentations in this book often do fall into that category because people most commonly use algorithms in this manner. Some special formulas are also algorithms, such as the quadratic formula. For a process to represent an algorithm, it must be the following:

Finite: The algorithm must eventually solve the problem.

Well-defined: The series of steps must be precise and present steps that are understandable, especially by computers, which must be able to to create a usable algorithm.

Effective: An algorithm must solve all cases of the problem for which someone defined it. An algorithm should always solve the problem it has to solve. Even though you should anticipate some failures, the incidence of failure is rare and occurs only in situations that are acceptable for the intended algorithm use.

First Look: Samsung Galaxy S8

We first saw Samsung’s new 5.8-inch Galaxy S8 and 6.2-inch Galaxy S8+ at its Unpacked event a few weeks ago. During the event, we saw demos of its new virtual assistant, Bixby, and its DeX docking station, which allows the Galaxy S8 to provide a desktop-like experience by connecting to an external monitor and peripherals, but we didn’t __have much time with the phones to do much more than take some pictures and try a couple of the new features. After receiving a Galaxy S8 earlier this week, we wanted to give you some feedback about its design and biometric features, as well as, an initial performance and battery life assessment before we dive into our usual in-depth testing.

My biggest complaint about the design is the location of the fingerprint sensor, which I discuss in the video above. It has been relocated to the back next to the camera, making it difficult to reach and use. The new face unlock feature, the second of the S8’s three biometric authentication options, is flawed too. Despite my best efforts, I was not able to get face unlock to work, not even once. The feature, which relies solely on the front-facing camera for identification, also is not very secure, assuming it works at all. It has already been shown that simply holding a picture in front of the camera is enough to fool it into unlocking the phone. The camera really needs to be augmented with an infrared camera to detect a face’s heat signature as a liveness test, or a second, depth-sensing camera to at least detect a face in three dimensions. So far the iris scanner, which I also demo in the video above, has proven to be the easiest and most reliable biometric option. 

Samsung Galaxy S8 Series
  Samsung Galaxy S8 Samsung Galaxy S8+
SoC Qualcomm Snapdragon 835 (US, China, Japan)
4x Kryo 280 Performance @ 2.35GHz
4x Kryo 280 Efficiency @ 1.90GHz
Adreno 540

Samsung Exynos 8895 (rest of world)
4x Exynos M2 @ 2.30GHz
4x Cortex-A53 @ 1.70GHz
ARM Mali-G71
Display 5.8-inch 2960x1440 (18.5:9)
SAMOLED (curved edges)
6.2-inch 2960x1440 (18.5:9)
SAMOLED (curved edges)
Dimensions 148.9 x 68.1 x 8.0 mm
155 grams
159.5 x 73.4 x 8.1 mm
173 grams
RAM 4GB LPDDR4 (US)
NAND 64GB (UFS 2.1)
+ microSD
Battery 3000 mAh (11.55 Wh)
non-replaceable
3500 mAh (13.48 Wh)
non-replaceable
Front Camera 8MP, f/1.7, Contrast AF
Rear Camera 12MP, 1.4µm pixels, f/1.7, dual-pixel PDAF, OIS, auto HDR, LED flash
Modem Snapdragon X16 LTE (Integrated)
2G / 3G / 4G LTE (Category 16/13)

Samsung LTE (Integrated)
2G / 3G / 4G LTE (Category 16/13)
SIM Size NanoSIM
Wireless 802.11a/b/g/n/ac 2x2 MU-MIMO, BT 5.0 LE, NFC, GPS/Glonass/Galileo/BDS
Connectivity USB Type-C, 3.5mm headset
Features fingerprint sensor, heart-rate sensor, iris scanner, face unlock, fast charging (Qualcomm QC 2.0 or Adaptive Fast Charging), wireless charging (WPC & PMA), IP68, Mobile HDR Premium
Launch OS Android 7.0 with TouchWiz

Inside the redesigned Galaxy S8 and S8+ is either a Qualcomm Snapdragon 835 or Samsung Exynos 8895 SoC. The US and other regions that require CDMA capability will get the Snapdragon 835, while the rest of the world will get Samsung’s SoC. The new 10nm SoCs are paired with 4GB of LPDDR4 RAM and 64GB of UFS 2.1 NAND. The Galaxy S8 comes with a 3000mAh battery, the same size as the Galaxy S7, while the S8+ comes with a 3500mAh battery, slightly less than the S7 edge’s 3600mAh capacity.

PCMark - Work 2.0 Performance Overall

PCMark - Web Browsing 2.0

PCMark - Writing 2.0

PCMark - Data Manipulation 2.0

PCMark - Video Editing 2.0

PCMark - Photo Editing 2.0

In PCMark, which is our best indicator of general system performance, the Galaxy S8 with Snapdragon 835 performs quite well, besting even the Mate 9 overall. Because this is the first S835 retail device we’ve tested, I’ve also included Qualcomm’s Snapdragon 835 MDP/S, which the company uses internally for hardware testing and software development, as a reference point. In most of these tests, the Galaxy S8 performs about the same as the Snapdragon 835 MDP/S, which is certainly a good sign.

The Galaxy S8 does particularly well in the Writing test, outscoring the Mate 9 by 13% and the Galaxy S7 (Snapdragon 820) by 85%. The Writing test, which previous Galaxy phones struggle with, uses a fairly bursty workload, frequently migrating threads between the little and big cores. Perhaps this is an indication that Samsung is utilizing the big cores more aggressively than in the past. The Galaxy S8 is also 9% faster than the Mate 9 in the Web Browsing test and 37% faster than the S7 (S820).

PCMark - Work 2.0 Battery Life

The Galaxy S8 achieves over 8 hours of screen-on-time while continuously crunching through the PCMark workloads, 46% longer than the Galaxy S7 that has the same 3000mAh battery, which suggests some nice efficiency gains from the new SoC, display, or other components. While the Galaxy S7 can struggle to last a full day on a single charge depending on how it’s used, these initial results suggest the Galaxy S8 will encounter fewer scenarios where it will need to use its fast charging or wireless charging abilities to stretch battery life till the end of the day.

While we’ve only had the Galaxy S8 for a couple of days, our first impression is generally positive. It’s packed with features, TouchWiz is more refined, and it performed well in our first performance and battery life tests. A few issues are already apparent, however. Your face probably will not be smiling if you try to rely on it to unlock the phone, and the fingerprint sensor is located in just about the worst possible place. Samsung’s Bixby assistant also is not yet fully functional; fortunately, you can still use Google Assistant while you’re waiting for Bixby to mature.