• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 25 páginas
Examen

Software Engineer Interview | Latest Edition

Document preview thumbnail
Vista previa 3 fuera de 25 páginas

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.

Vista previa del contenido

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.

Información del documento

Subido en
23 de abril de 2026
Número de páginas
25
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$11.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
DrMwendwa
2.0
(2)
Vendido
4
Seguidores
0
Artículos
556
Última venta
1 mes hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes