일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- Preparing for the Google Cloud Professional Data Engineer Exam
- exam
- Data Engineer
- Computer Science
- Data Structure
- Study
- 화장실 지도
- Restroom
- 뉴욕 화장실
- Linked List
- BST
- dataStructure
- Algorithms
- Data Analyst
- data
- Newyork
- priority queue
- 빅데이터 지식
- 빅데이터
- 데이터 엔지니어
- Computer Organization
- HEAPS
- binary search tree
- 빅데이터 커리어 가이드북
- hash
- Binary Tree
- 데이터 분석가
- Heap
- data scientist
- algorithm
- Today
- Total
Jaegool_'s log
Coding Interview prep: Fundamental 본문
What is immutable & mutable?
An immutable object is an object whose state cannot be modified after it is created.
Java
Immutable Objects: String, Wrapper Classes(Integer, Double, Float, etc.)
Mutable Objects: StringBuilder and StringBuffer, Arrays, Custom Classes
C++
Immutable Objects: Const Objects
Mutable Objects: Standard Library Containers(std::vector, std::map, etc.), Strings, Custom Classes
Python
Immutable Objects: tuples, strings
Mutable Objects: Lists, dictionaries
How does the memory allocation work?
Memory allocation for objects involves assigning a specific memory space to an object so that it can store its value or state. When an object is created, the programming language's runtime environment allocates a portion of memory for that object.
- For immutable objects, if you try to modify the object, a new object is often created in a different memory location with the new value, leaving the original object unchanged.
- For mutable objects, changes are made directly in the same memory space where the object resides.
Explain calling by reference & value.
In call by value, a copy of the actual argument's value is passed to the function. Therefore, changes made to the parameter inside the function have no effect on the original argument. This is common in languages like C where the function creates its own copy of the arguments.
In call by reference, a reference to the actual argument (rather than a copy) is passed to the function. This means that changes made to the parameter inside the function are reflected in the original argument. This is the default behavior in languages like Python and JavaScript, where objects are often passed by reference, meaning the function can modify the original object.
'Job' 카테고리의 다른 글
언론에 나온 참여한 행사 (0) | 2024.08.19 |
---|---|
Rivian Engineering Intern - Factory Systems (2023 Co-Op Program) (0) | 2023.03.17 |
State Farm Software Engineer Requirements (0) | 2023.02.08 |
Rivian Engineering Intern - Manufacturing(qualifications) (0) | 2023.02.08 |