SWE Fundamentals Part 1 Flashcards

1
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Big-O notation used for?

A

To describe the time and space complexity of an algorithm in terms of input size.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the time complexity of accessing an array element?

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the time complexity of searching in a hash table?

A

Average O(1), Worst O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the time complexity of binary search?

A

O(log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What data structure is best for LIFO operations?

A

Stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What data structure is best for FIFO operations?

A

Queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the difference between a linked list and an array?

A

Linked lists are dynamic in size and better at insertions/deletions; arrays are faster for random access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When would you use a hash map?

A

When you need fast key-value lookups.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is recursion?

A

A function that calls itself to solve a smaller version of the problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a base case in recursion?

A

The condition under which the recursive calls stop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between DFS and BFS?

A

DFS explores depth before backtracking, BFS explores neighbors level by level.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When should you use BFS over DFS?

A

When looking for the shortest path in an unweighted graph.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is dynamic programming?

A

An optimization technique for solving problems by storing and reusing subproblem results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the two main techniques in dynamic programming?

A

Memoization (top-down) and tabulation (bottom-up)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a greedy algorithm?

A

An algorithm that chooses the best option at each step hoping to find a global optimum.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is a heap used for?

A

Efficiently getting the min or max element, often in priority queues.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is a graph?

A

A set of nodes (vertices) connected by edges.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How is a graph represented in code?

A

Adjacency list or adjacency matrix

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is selection sort’s time complexity?

A

O(n²) for all cases

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Why is bubble sort inefficient?

A

It makes many unnecessary swaps, leading to O(n²) performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is merge sort’s time complexity?

A

O(n log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is quicksort’s average and worst-case time complexity?

A

Average O(n log n), Worst O(n²)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the stack used for in recursion?

A

To store function calls and local variables.

25
What is the heap in memory?
A region for dynamically allocated memory (e.g., objects).
26
What is garbage collection?
Automatic memory management that reclaims unused memory.
27
What is reference counting in garbage collection?
Each object has a count of references; it's freed when the count is zero.
28
What is mark-and-sweep garbage collection?
Live objects are marked, and unreachable ones are collected.
29
What is generational garbage collection?
Objects are grouped by age; young ones are collected more frequently.
30
What is the difference between stack and heap memory?
Stack is for static memory (function calls), heap is for dynamic memory (objects).
31
What does “pass by value” mean?
The function gets a copy of the data, not the original.
32
What is encapsulation in OOP?
Hiding internal state and requiring all access through methods.
33
What is inheritance in OOP?
One class can inherit attributes and behavior from another.
34
What is polymorphism in OOP?
Functions or methods behaving differently based on context or data types.
35
What is a REST API?
An interface for communication between systems using HTTP methods like GET, POST, PUT, DELETE.
36
What does HTTP status 200 mean?
Request was successful.
37
What does HTTP status 404 mean?
Resource not found.
38
What is Git used for?
Version control – tracking code changes over time.
39
What is a Git branch?
A separate line of development in your codebase.
40
How do you resolve a merge conflict?
Manually edit conflicting files and commit the resolution.
41
What is unit testing?
Testing individual units of code (like functions or classes) for correctness.
42
What is the call stack?
A data structure that stores information about active function calls.
43
What is a “memory leak”?
When memory is allocated but never freed, causing usage to grow over time.
44
What is the STAR method for behavioral questions?
Situation, Task, Action, Result – structure for clear answers.
45
How should you answer “Tell me about yourself”?
Brief summary of your background, skills, and what you're looking for.
46
How should you prepare for technical interviews?
Practice DSA problems, understand time/space complexity, and write code by hand.
47
What should you talk about in a project interview question?
Problem, your role, technologies used, challenges faced, and what you learned.
48
What is SQL?
A language used to query and manage relational databases.
49
What does SELECT do in SQL?
Retrieves data from one or more tables.
50
What is a primary key in a database?
A unique identifier for each row in a table.
51
What is the difference between frontend and backend development?
Frontend is the user interface; backend is the logic and database interaction.
52
What is the software development lifecycle (SDLC)?
The process of planning, building, testing, and deploying software.
53
What is Agile?
A software development methodology focused on iterative progress and flexibility.
54
What is CI/CD?
Continuous Integration and Continuous Deployment – automating build, test, and deployment workflows.
55
What is a deployment pipeline?
A set of automated steps that deliver code changes from development to production.
56
What is the difference between a bug and a feature request?
A bug is unintended broken behavior; a feature request is a new or improved functionality.
57
What is a pull request (PR)?
A request to merge changes into the main codebase, usually reviewed by peers.
58
What is code review?
Peer feedback on a pull request to ensure code quality and correctness.
59
What is API rate limiting?
Controlling how often someone can make requests to an API within a time period.