Software Engineer Interview Cheat Sheet: Tips, Tricks and Advice

Even if you have years of software engineering experience under your belt, the technical interview can be daunting! Luckily, we've put together a coding interview cheat sheet of all the major principles you can expect to see in your technical interviews.

Even if you have years of software engineering experience under your belt, the technical interview can be daunting!

For junior developers, you may be afraid that you haven't prepared enough—that you might call the wrong variable in a time crunch.

For senior software developers, the fear may be related to not being as familiar with programming language or concepts.

You've been managing teams for so long that your database skills aren't quite as sharp. Or maybe you're going out for a job that uses an object oriented language you've never used before.

Luckily, we've put together a coding interview cheat sheet of all the major principles you can expect to see in your technical interviews.

In this guide, you will learn about:

Along with this cheat sheet, be sure to check out Exponent's Software Engineering Interview Course.

Arrays

When it comes to data structures, nothing is simpler than an array. But arrays are far from insignificant!

What is an Array?

An array is an ordered list of data that is accessible with a numerical index.

In many cases, software engineers will allocate arrays upfront as a single block of memory according to the amount of elements and kinds of data that must be stored in the array.

Because of this, arrays allow engineers to read and write elements more efficiently. Arrays tell your program exactly where every element is stored within memory.

Things to Know About Arrays for a Technical Interview

Things to keep in mind for your technical interviews regarding arrays:

  • Arrays are optimal for indexing but not for searching, inserting, and deleting.
  • Linear arrays are the simplest types of arrays.
  • Dynamic arrays are similar to one-dimensional arrays. However, they use reserved space to store extra elements.

Most Common Array Interview Questions

Additional Array Technical Interview Cheat Sheets

Linked Lists

The next most fundamental data structure in software development is the linked list.

What is a Linked List?

Linked lists allow engineers to insert/remove elements from a list without the need to re-allocate or move the elements.

In doing so, linked lists can thwart what would otherwise be the worst-case performance scenario of arrays.

Linked lists are also frequently used as a building block for anoother, more complex data structure.

Linked lists operate a little differently than arrays. Rather than storing data in blocks of memory, a linked list uses nodes connected to pointers.

Things to Know About Linked Lists for Technical Interviews

During technical interviews, remember to use linked lists when you need to insert/delete items from a list.

This is especially important if the size of the list must be flexible.

Keep in mind arrays are better for indexing and hash tables are better for searching.

Most Common Linked List Interview Questions

Hash Tables

What are Hash Tables and How Do They Work?

Hash tables are effective for searching.

Hash tables are key-value data structures that contain three parts:

  • Arrays,
  • Linked lists,
  • Hashing functions

The hashing function component of a hash table transforms the key. The key is a piece of data that is transformed into an array index by the hashing function.

The reason for this is the array index is used for efficient lookup.

Ultimately, this array index then becomes the hash table.

When Should You Use a Hash Table?

You should use a hash table if you need constant-time lookup, insertion, or deletion functions.

Remember that hash tables are not the best choice for storing sorted data.

  • Hash tables are designed for optimized searching, insertion, and deletion.
  • A hash collision refers to a hash function returning the same output for two separate inputs. This is a problem inherent in every hash.
  • Hashes are critical for symbol tables and indexing databases.

How to Calculate Memory with a Hash Table

Many coding languages have things like sets, objects, and dictionaries that utilize hash tables.

In Python, there are dictionaries and sets. JavaScript also has objects and sets.

Depending on the language, the memory usage of a hash table may vary wildly.

In most cases, you should use a fixed-size array when creating a hash table. You should use linked lists for storing the data.

Hash Table Operations

  • Inserting key-value pairs
  • Finding a key's value
  • Updating a key's value
  • Seeing if a key is already used
  • Looping over key-value pairs
  • Deleting key-value pairs
  • Searching for values

Most Common Hash Table Interview Questions

Additional Hash Table Technical Interview Resources

Graphs & Trees

Another group of important data structures is graphs and trees.

What are Graphs in Programming?

A graph is a data structure composed of two elements: vertices linked together by "edges."

These edges can be directed or undirected, depending on how they are used.

There are many practical uses for graphs.

For example, in a GPS application, roads could be the edges, while intersections would be the vertices.

When it comes to technical interviews, it will usually be clear when to use graphs.

Your interviewer will likely tell you to use one outright, or the data set in question will consist of vertices and edges.

What are Trees in Programming?

Trees are a data structure similar to graphs. They are also widely used on a day-to-day basis by software engineers.

They usually appear during the technical interview in search and traversal questions.

A tree is a collection of nodes in which every node includes references to zero or more child trees.

As you can probably already tell, trees are defined recursively.

This suggests that recursive algorithms are pertinent when faced with this kind of data structure.

The nodes in a tree are comparable to the nodes of linked lists.

However, the nodes of linked lists only contain one memory pointer to another node.

The nodes in trees, though, can contain any number of memory pointers to child nodes.

As such, trees are technically a kind of graph. They are sometimes referred to as directed acyclic graphs.

This means that basic algorithms such as breadth-first search and depth-first search are used alongside graphs and trees.

Things to remember about trees during your software engineering interview:

  • Leaf node: This is a node without any child nodes.
  • Root node: The topmost node in a tree. This will usually be the node interviewers will give you in your coding problem.
  • Height The distance between the root node and the lowest leaf node.
  • Subtree: The node under the root node and all of its children.

Most Common Graphs and Trees Technical Interview Questions

Stacks & Queues

What are Stacks and Queues?

Stacks and queues are two high-level data structures used for storing a list of elements.

Queues operate along the lines of “first-in, first-out” (FIFO) behavior.

This means that elements are enqueued and dequeued in the same way they arrive, as the name suggests. The first element in is the first one out.

Stacks, on the other hand, operate oppositely. They use a “last-in, first-out” (LIFO) procedure.

This allows elements to be recovered in the reverse order they arrived.

Imagine stacks like stacks of pancakes. The top-most pancake, the first one to be retrieved, was the last to arrive.

Stacks and queues are typically executed alongside a linked list or array.

Stacks and queues are critical components of many basic algorithms in software engineering.

Stacks and Queues in Your Technical Interview?

During your interview, it's best to use a queue when your problem requires you to process items according to the order received.

Stacks are used when items need to be received in reverse order.

Stacks and queues are often used in graph search algorithms, web crawlers, and storing application history.

Common Stack and Queue Interview Questions

Your interviewer may ask you to perform these general functions in your interview. Use the language you're most comfortable with.

Concepts

  • Enqueuing
  • Dequeuing
  • Pushing items to a stack
  • Popping items from a stack
  • Looping over queues and stacks
  • Peeking the top of a stack
  • Stack reversal
  • Getting a stack's size
  • Getting a queue's size

Questions

Click here to learn more about Stacks & Queues from Exponent.

Sorting

Sorting is an essential concept in software engineering and, by extension, engineering interviews.

There's a very good chance you will be asked a sorting question in your interview.

Sorting in a Technical Interview

  • The interviewer may give you a set of data that has already been sorted. They will then ask you to sort the data more efficiently.
  • The interviewer will ask you to solve a coding problem that requires sorting to solve efficiently.
  • A sorting algorithm is necessary to manage a particular set of data in the coding problem.

Types of Sorting Algorithms

  • Insertion sort - Best for short lists, stable, and in-place.
  • Quicksort - Often fastest in practice, can be in-place but not stable.
  • Mergesort - Stable but not in-place.
  • Heap sort - In-place and better worst-case runtime than quicksort

Click here to learn more about Sorting.

System Design

System Design Technical Interview Basics

  • Scalability: First and foremost, a well-designed system must be scalable. This means it can handle increased traffic while still operating with efficiency.
  • Reliability: Ultimately, scalability means nothing if a system is not designed reliably. Reliability in system design means the system can continue to perform its necessary functions, even in the event of user mistakes, while also preventing unauthorized abuse or exploits.
  • Availability: A well-designed system must necessarily be an available one. This means it can perform its necessary functions over time. In other words, the uptime/total time.
  • Efficiency: As you can imagine, it's difficult to say a system is well-designed if it's not efficient. If your system can function quickly, then it is an efficient one.
  • Maintainability: Last but not least, maintainability. A system must be maintainable: making it operate must be straightforward so that other engineers can modify and maintain it over time.

System Design Technical Interview Questions

Exponent published a full guide to the system design interview. It's a technical interview cheat sheet in its own regard with

What are Load Balancers?

Load balancers help distribute incoming traffic so the system can maximize its total capacity while decreasing queuing time. They're an integral part of successful software development.

These become even more important as a system scales and handles larger amounts of traffic.

It is best to use load balancers during your interviews if you believe your system requires more capacity, especially as it scales.

In many cases, are positioned in between the external traffic and the servers of the application.

Click here to learn more about System Design.

Time and Space Complexity

What is Time and Space Complexity?

There are usually many ways to solve coding problems. But not every solution is created equally.

Good software development is defined by algorithms that are both efficient and practical. So, comparing the performance of different solutions will be a fundamental part of your coding interviews.

The time complexity of a program refers to how long an algorithm takes to run based on the input length.

Time complexity of an algorithm quantifies the amount of time taken by an algorithm to run as a function of the length of the input.

The space complexity refers to how much memory an algorithm needs to process that same input.

How to Learn More About Time and Space Complexity Algorithms

What Programming Language to Use in a Technical Interview?

It doesn't matter what language you use in a coding interview. You should use whatever programming language you know in and out.

That said, it's best to use a dynamic language if you can. JavaScript, Ruby, and Python are common in coding interviews because of how adaptable they are.

A dynamic language boasts compact syntax, makes it easier to type code, and features hash and list literals.

Whatever language you decide to work in, be sure to mention other languages you're fluent in to your interviewer. Tech company engineering managers want team members who are flexible and dynamic.

Expressing fluency in lower-level languages like C, C++, Rust, or even Go can help you stand out among other software engineers applying.

We recommend avoiding Java, C#, and PHP in your interview though. Interestingly, Triplebyte discovered that candidates who used these languages advanced in the interview process at lower rates.

Top tech company culture emphasizes adaptability and technical knowledge. Showcase the programming languages you know well and mention the ones you've built other projects with.

Successful software developers are often tinkering on side projects in languages they don't yet know to keep their skills sharp.  

What you SHOULD DO in a Technical Interview

  • Use clean code: Your variable names should all be easily identifiable, etc.
  • Don't type too quickly: Going too fast may confuse your interviewer on what you're building.
  • Save time: Ask your interviewer if you can use trivial functions. This will save you some time.
  • Clarify: Technical interview questions may or may not be designed to trick you! Ask your interviewer to clarify anything you don't completely understand.
  • Whiteboard management: Whiteboard space management skills are a must! Keep your thoughts clear and easy to understand. Tech companies want to know that you've thought through multiple scenarios before blurting out an answer!

What NOT to Do in Your Coding Interview

  • Don't copy and paste code without discussing it with your interviewer. You may miss variables that need to be renamed, etc.
  • Don't ignore tips your interviewer might give you. If they stop your coding, they may have valuable insights to help you in the interview process.
  • Don't keep your lips sealed! Talk through your thought process out loud so it's clear you understand what you're doing.
  • Don't use strange or obscure variable names. Your variables should be easy to understand and follow.
  • Don't have our cheat sheet open in another tab!

What Should You do After the Coding Interview Is Over?

All software engineers get nervous during a coding interview. It's natural, and to be expected.

In fact, we'd be surprised if you WEREN'T curious about how your coding skills looked in the technical interview.

After your interview is over, here's what you should do:

  1. Thank the interviewer for their time.
  2. Ask if they have any other questions about the project you worked on, or why you made certain technical decisions while coding.
  3. Ask them what to expect next in the interview process. Or you can use our company interview guides to get the inside-scoop before you even start.
  4. Send a follow-up email thanking them again for their time.
  5. If you don't get the job, ask if there any objective feedback they could share. You can use this to help you in your next technical interview!

(Even More) Coding Interview Practice Questions

  • Design a fire alarm for the deaf.
  • Write a pair of functions to serialize and deserialize a list of strings.
  • Store a list of numbers as a single number.
  • Given an nxn grid of 1 and 0s, return the number of islands in the input.
  • Merge K sorted linked lists.
  • Find Triplet with given sum in an array (3-sum)
  • How does an HTTP request work?
  • Sort a binary array in linear time.

Click here for more Software Engineering Interview Questions.

Software Engineering Interview Resources

As you can imagine, you'll need more than this cheat sheet to set yourself up for the best success in your upcoming interview.

But don't fret. Here at Exponent, we have numerous different interview resources that will help put you in the best possible position to ace your software engineer interview:

💬 Practice with sample Software Engineer interview questions

📖 Read through our Software Engineering interview guides

👯‍♂️ Rehearse your behavioral and interpersonal skills with our interview practice tool.

👨‍🎓 Take our complete Software Engineering interview course.

You've successfully subscribed to Exponent
Great! Next, complete checkout to get full access to all premium content.
Error! Could not sign up. invalid link.
Welcome back! You've successfully signed in.
Error! Could not sign in. Please try again.
Success! Your account is fully activated, you now have access to all content.
Error! Stripe checkout failed.
Success! Your billing info is updated.
Error! Billing info update failed.
Product Management Today