📝
knowledge
  • links
  • 14-Pure-Education
    • My Knowledge Wiki 🌿
      • .github
        • ISSUE_TEMPLATE
          • Question 🤔
          • bug_report
          • Feature ✨
        • Summary
      • design
        • Animation
        • Fonts
        • Framer
        • Color
        • figma
          • Figma
          • Figma plugins
        • Inkscape
        • Blender
        • Design
        • Interior Design
        • Icons
        • Design inspiration
        • 3D modeling
        • Design systems
        • Industrial Design
        • User Experience
        • Logos
      • databases
        • Neo4j
        • Fauna
        • sql
          • SQL
        • blockchain
          • Cardano
          • Arweave
          • Tezos
          • Polkadot
          • Uniswap
          • Ethereum
          • Blockchain
        • Kdb+
        • Cassandra DB
        • PostgreSQL
        • FoundationDB
        • SQLite
        • Prometheus
        • Dgraph
        • Redis
        • DynamoDB
        • Databases
        • Memcached
        • MariaDB
        • Prisma
        • MongoDB
      • augmented-reality
        • Augmented Reality
        • ARKit
      • art
        • Art
        • Pen plotting
        • Drawing
        • Photography
        • Generative art
        • Sketching
        • Comics
        • Anime
        • Furniture
        • Dancing
        • Architecture
        • Clothes
        • Tattoos
      • computer-graphics
        • computer-vision
          • Optical character recognition
          • Computer vision
        • Procedural generation
        • Metal
        • SVG
        • WebGPU
        • [Ray tracing](https://en.wikipedia.org/wiki/Ray_tracing_(graphics))
        • Computer graphics
        • WebGL
        • CUDA
        • OpenGL
        • Vulkan API
        • Bézier curves
        • Shaders
        • Image processing
        • [Rendering](https://en.wikipedia.org/wiki/Rendering_(computer_graphics))
      • computer-science
        • Parsing
        • algorithms
          • Algorithms
          • Compression
        • Computer Science
        • Computer architecture
        • formal-verification
          • Formal verification
          • TLA+
        • Automata theory
        • data-structures
          • Data structures
      • business
        • startups
          • Marketplaces
          • Funding
          • Values
          • Onboarding
          • Venture capital
          • Startups
          • Payroll
        • Products
        • Business
        • Restaurants
        • Landing pages
        • Pricing
      • compilers
        • LLVM
        • Linters
        • build-systems
          • Build systems
          • Bazel
        • Compilers
      • books
        • Mind for numbers - Review
        • Thinking, fast and slow
        • Brave new world
        • Elements of programming interviews
        • Rich dad poor dad
        • Programming in Haskell
        • Code: hidden language of software
        • Surely you are joking Mr Feynman
        • Books
        • Mindstorms
        • Eloquent ruby
        • go-in-action
        • Crafting interpreters
        • Cracking the coding interview
        • Artificial Intelligence: A Modern Approach
      • devops
        • Observability
        • DevOps
        • Site Reliability Engineering
        • Terraform
      • cryptocurrencies
        • Nano
        • Cryptocurrencies
        • Bitcoin
        • Stellar
        • Libra
        • TON
      • backups
        • Backups
      • 3d-printing
        • 3D Printing
      • distributed-systems
        • message-queue
          • Message queue
          • ZeroMQ
          • MQTT
        • [Load balancing](https://en.wikipedia.org/wiki/Load_balancing_(computing))
        • rpcs
          • gRPC
          • Remote Procedure Calls
        • Distributed systems
        • Conflict-free replicated data type
      • cli
        • Command Line Tools
        • Tmux
        • Ngrok
        • Sed
      • automation
        • Home automation
        • Automation
      • biology
        • Computational biology
        • Biology
        • Evolution
        • genomics
          • DNA
          • Genomics
        • immunology
          • Immunotherapy
          • Immunology
        • Bionics
        • bioinformatics
          • Bioinformatics
        • Viruses
      • cloud-computing
        • serverless-computing
          • AWS Lambda
          • Serverless computing
          • Cloudflare workers
        • Cloud computing
        • gcp
          • Google Cloud
        • aws
          • AWS Amplify
          • AWS
        • azure
          • Azure
      • articles
        • Articles
      • anki
        • Anki
      • data-science
        • Data Science
        • Data Visualization
        • Data processing
        • Apache Kafka
      • consciousness
        • Consciousness
        • Ego
      • documentaries
        • Documentaries
      • Summary
      • api
        • API
      • animals
        • Birds
        • Animals
      • courses
        • Courses
      • analytics
        • Analytics
      • chemistry
        • Chemistry
Powered by GitBook
On this page

Was this helpful?

  1. 14-Pure-Education
  2. My Knowledge Wiki 🌿
  3. books

Elements of programming interviews

Chapter 1 - strategies for a great interview

  • Once you have an algorithm, it is important to present it in a clear manner. Your solution will be much simpler if you take advantage of libraries such as Java Collections or C++ Boost.

  • Important that you use the language you are most comfortable with.

  • Master the libraries, especially the data structures.

    • Do not waste time and lose credibility trying to remember how to pass an explicit comparator to a BST constructor.

    • Remember that a hash function should use exactly those fields which are used in the equality check. A comparison function should be transitive.

  • Focus on the top-level algorithm:

    • It's OK to use functions that you will implement later. This will let you focus on the main part of the algorithm, will penalize you less if you don't complete the algorithm. (Hash, equals, and compare functions are good candidates for deferred implementation.) Specify that you will handle main algorithm first, then comer cases. Add TODO comments for portions that you want to come back to.

  • Manage the whiteboard:

    • You will likely use more of the board than you expect, so start at the top-left comer.

    • Make use of functions skip implementing anything that's trivial (e.g., finding the maximum of an array) or standard (e.g., a thread pool).

    • Have a convention for identifiers, e.g., i , j , k for array indices, A , B , C for arrays, u , v , w for vectors, s for a String, sb for a StringBuilder, etc.

  • Assume valid inputs.

  • Test for comer cases.

    • For many problems, your general idea may work for most valid inputs but there may be pathological valid inputs where your algorithm (or your implementation of it) fails.

      • For example, your binary search code may crash if the input is an empty array; or you may do arithmetic without considering the possibility of overflow.

    • It is important to systematically consider these possibilities. If there is time, write unit tests.

    • Small, extreme, or random inputs make for good stimuli. Don't forget to add code for checking the result. Occasionally, the code to handle obscure corner cases may be too complicated to implement in an interview setting. If so, you should mention to the interviewer that you are aware of these problems, and could address them if required.

  • Syntax

    • Interviewers rarely penalize you for small syntax errors since modern IDE excel at handling these details.

      • However, lots of bad syntax may result in the impression that you have limited coding experience. Once you are done writing your program, make a pass through it to fix any obvious syntax errors before claiming you are done.

  • Know your interviewers & the company.

    -

PreviousBrave new worldNextRich dad poor dad

Last updated 4 years ago

Was this helpful?