• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 25 pages
Exam (elaborations)

Software Engineer Interview | Latest Edition

Document preview thumbnail
Preview 3 out of 25 pages

Software Engineer Interview | Latest Edition Arrays - ANSWER The worst case is the average case for arrays. Access in O(1) Search in O(n) Insert in O(n) Delete in O(n) Takes O(n) space. Stack/Queue/Linked List - ANSWER Stacks are FILO lists. Queues are FIFO lists. Linked Lists are lists that keep track of the head and tail, and each element/node has a value as well as a pointer to the next element/node (doubly linked lists also have a pointer to the previous node). The worst case is the average case for these data structures. Access in O(n) Search in O(n) Insert in O(1) Delete in O(1) Takes O(n) space. Skip List - ANSWER Skip lists are composed of multiple lists that act as "layers", where higher level layers have less items than lower level layers, determined by probability of appearance/use. It is navigated starting at the top and checking adjacent values--if the desired value is not found, drop to the current element but on the next layer down and repeat. All actions on average take O(log(n)) time. All actions in the worst case take O(n) time. Takes O(nlog(n)) space. Hash Table - ANSWER [Hash Table definition is covered on another card] On average, each operation takes O(1) time. In the worst case, each operation takes O(n) time. Takes O(n) space. Note: hash tables don't have access-by-location. Binary Search Tree (NOT Binary Tree) - ANSWER Starting from the root, each element of a BST has 2 children, the left of which is less than or equal to its own value, and the right of which is greater than or equal to its own value. Each operation takes, on average, O(logn) time. Each operation takes, at worst, O(n) time. Quicksort - ANSWER Choose a pivot at random and split the list by values greater than the pivot and less than (or equal to) the pivot, then sort the two lists on either side of the pivot recursively. This runs in O(nlog(n)) on average. It runs in O(n^2) at worst. It uses O(log(n)) space. Mergesort - ANSWER Divide the unsorted list into n sublists containing 1 element each, then consider 2 of those lists and merge them together by order of value. Do this for each sublist, then recursively repeat it for the new sublists until they are all merged back into one sorted list. Both average and worst case scenarios take O(nlog(n)) time. It uses O(n) space. Heapsort - ANSWER Build a heap out of the list, then repeatedly extract the max value from the heap. Runs in O(nlog(n)) for both average and worst cases. It uses O(1) space. Note: Heapsort is not safe (it is possible for two equivalent items to end up in swapped positions relative to each other after a heapsort is run). Bubble Sort/Insertion Sort/Selection Sort - ANSWER Bubble Sort: Go through the list and compare each adjacent element, swapping their positions if they are out of order. Repeat until sorted. Insertion Sort: Go through list until you find an element that is less than the element previous to it. Take the element and place it in sorted position in the earlier portion of the list (the "sorted" portion). Repeatedly do this until all sorted. Note: Insertion sort is adaptive (it is very fast for lists that are already mostly sorted). Selection Sort: Repeatedly go through the list and find the smallest element and move it to the front of the list. All of these have average and worst cases of O(n^2). All of these use O(1) space. Bucket Sort - ANSWER Create a number of "buckets" (lists) equal to the number of unique values in the list. Go through the list and put each element in its appropriate bucket, then order the buckets (can use any other sorting method). Note: Bucket Sort is only really practical when dealing with a large volume of data that spans a small amount of unique values. Runs in O(n) time on average. Runs in O(n^2) time in the worst case. Uses O(n) space in the worst case. What is a Map (Data Structure)? - ANSWER Maps model a collection of key value pairs. get(k) put(k, v) remove(k) Ex: Hashmaps are a type of map that uses an encrypted key What is an AVL Tree? - ANSWER A tree where the nodes are going left to right in ascending value, and the height of the tree is always as balanced as possible. What is a Splay Tree? - ANSWER A binary tree where the tree is "splayed" after accessing a node. Splaying uses rotations to move a node to the root while maintaining ordering rules. What is a Trie? - ANSWER A tree, but for strings. Can also be implemented as a directional graph, although that technically isn't a trie.

Content preview

Software Engineer Interview | Latest
Edition


Arrays - ANSWER ✅ The worst case is the average case for arrays.
Access in O(1)
Search in O(n)
Insert in O(n)
Delete in O(n)
Takes O(n) space.


Stack/Queue/Linked List - ANSWER ✅ Stacks are FILO lists.
Queues are FIFO lists.
Linked Lists are lists that keep track of the head and tail, and each element/node
has a value as well as a pointer to the next element/node (doubly linked lists also
have a pointer to the previous node).
The worst case is the average case for these data structures.
Access in O(n)
Search in O(n)
Insert in O(1)
Delete in O(1)
Takes O(n) space.


Skip List - ANSWER ✅ Skip lists are composed of multiple lists that act as
"layers", where higher level layers have less items than lower level layers,

,determined by probability of appearance/use. It is navigated starting at the top and
checking adjacent values--if the desired value is not found, drop to the current
element but on the next layer down and repeat.
All actions on average take O(log(n)) time.
All actions in the worst case take O(n) time.
Takes O(nlog(n)) space.


Hash Table - ANSWER ✅ [Hash Table definition is covered on another card]
On average, each operation takes O(1) time.
In the worst case, each operation takes O(n) time.
Takes O(n) space.
Note: hash tables don't have access-by-location.


Binary Search Tree (NOT Binary Tree) - ANSWER ✅ Starting from the root,
each element of a BST has 2 children, the left of which is less than or equal to its
own value, and the right of which is greater than or equal to its own value.
Each operation takes, on average, O(logn) time.
Each operation takes, at worst, O(n) time.


Quicksort - ANSWER ✅ Choose a pivot at random and split the list by values
greater than the pivot and less than (or equal to) the pivot, then sort the two lists on
either side of the pivot recursively.
This runs in O(nlog(n)) on average.
It runs in O(n^2) at worst.
It uses O(log(n)) space.

, Mergesort - ANSWER ✅ Divide the unsorted list into n sublists containing 1
element each, then consider 2 of those lists and merge them together by order of
value. Do this for each sublist, then recursively repeat it for the new sublists until
they are all merged back into one sorted list.
Both average and worst case scenarios take O(nlog(n)) time.
It uses O(n) space.


Heapsort - ANSWER ✅ Build a heap out of the list, then repeatedly extract the
max value from the heap.
Runs in O(nlog(n)) for both average and worst cases.
It uses O(1) space.
Note: Heapsort is not safe (it is possible for two equivalent items to end up in
swapped positions relative to each other after a heapsort is run).


Bubble Sort/Insertion Sort/Selection Sort - ANSWER ✅ Bubble Sort: Go through
the list and compare each adjacent element, swapping their positions if they are out
of order. Repeat until sorted.
Insertion Sort: Go through list until you find an element that is less than the
element previous to it. Take the element and place it in sorted position in the
earlier portion of the list (the "sorted" portion). Repeatedly do this until all sorted.
Note: Insertion sort is adaptive (it is very fast for lists that are already mostly
sorted).
Selection Sort: Repeatedly go through the list and find the smallest element and
move it to the front of the list.
All of these have average and worst cases of O(n^2).
All of these use O(1) space.

Document information

Uploaded on
April 23, 2026
Number of pages
25
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$11.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
DrMwendwa
2.0
(2)
Sold
4
Followers
0
Items
556
Last sold
1 month ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions