[Leetcode]Binary Tree Right Side View
·
SW개발/코딩테스트
https://leetcode.com/problems/binary-tree-right-side-view/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 이진 트리가 주어졌을때 오른쪽에서 본 순서대로 출력합니다. 처음 시도한 답안 - 실패 # Definition for a binary tree node. # class TreeN..
[LeetCode]Product of Array Except Self
·
SW개발/코딩테스트
https://leetcode.com/problems/product-of-array-except-self/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 nums 배열이 주어지면 자신을 제외한 숫자들의 곱을 구하는 문제입니다. 단, 나눗셈 연산은 금지되어 있습니다. 처음 시도한 답안 class Solution: def prod..
[LeetCode]Find the Duplicate Number
·
SW개발/코딩테스트
https://leetcode.com/problems/find-the-duplicate-number/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 주어진 숫자 배열에서 두번 이상 반복되는 숫자를 찾는 문제입니다. 나머지 숫자는 정확히 딱 1번만 등장합니다. 처음 시도한 답안 - 실패 class Solution: def fin..
[LeetCode]Search a 2D Matrix II
·
SW개발/코딩테스트
https://leetcode.com/problems/search-a-2d-matrix-ii/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 주어진 m*n 2D Matrix에서 원하는 target 값이 있는지 찾는 문제입니다. 처음 시도한 답안 class Solution: def searchMatrix(self, matrix:..
[LeetCode]Kth Smallest Element in BST
·
SW개발/코딩테스트
https://leetcode.com/problems/kth-smallest-element-in-a-bst/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 주어진 Binary Search Tree에서 K번째로 작은 숫자를 찾는 문제입니다. 처음 시도한 답안 # Definition for a binary tree node. # ..
[Leetcode]Kth Largest Element in an Array
·
SW개발/코딩테스트
https://leetcode.com/problems/kth-largest-element-in-an-array/description/ LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제 분석 주어진 배열에서 k번째로 큰 숫자를 구하는 문제입니다. 처음 시도한 답안 - 실패 class Solution: def findKthLargest(self, nums: L..
2023년 회고 (feat. 짙은 회색)
·
회고
블로그를 운영하고 나서 벌써 3번째의 연간 회고가 다가왔네요. 특히 2023년도에는 21, 22년도와 달리 짙은 색감을 가지는 한해였던 것 같은데요, 어떤 일들이 있었는지 한번 이야기해보도록 하겠습니다. 면접 & 좌절 & 공부의 반복23년도에 개인적으로 이직 준비를 하면서 짙은 회색에 가까운 상태가 계속 유지되었던 것 같습니다. 지난 시기까지의 저는 무엇이든 해낼 수 있다는 자신감과, 그래도 나름 개발자로서 잘 성장해오고 있다고 생각을 하고 있었습니다. 하지만, 실제로 제가 생각한 것과는 달리 면접을 진행하다 보니 부족한 부분이 너무나도 많았음을 느낄 수 있었습니다.기술적인 부분, CS 지식, 진행한 업무들에 대한 디테일, WHY, 나라는 사람을 표현하고 어필하는 부분 등 다양한 방면에서 부족함이 있었습..
[Python]파이썬 비동기 프로그래밍 동작 원리에 대해서 (feat. 이벤트 루프)
·
SW개발/Python
안녕하세요, 오늘은 파이썬 비동기 프로그래밍 동작 원리에 대해서 알아보려고 합니다. 파이썬의 비동기는 이벤트 루프를 통해 동작하고 있다는 정도의 이해만 한 채로 개발을 하다 보니 문득 내부 동작은 어떻게 이루어지는지가 궁금하여 공부해보게 되었습니다. 또한 애초에 파이썬은 동기 방식으로 동작하도록 설계되었기 때문에 어떻게 비동기 프로그래밍을 지원하는지도 궁금했습니다. (Python은 3.4부터 asyncio가 표준 비동기 라이브러리로채택되었습니다.) 코루틴이란? (coroutine) 파이썬의 비동기 프로그래밍을 이해하기 위해서는, 먼저 코루틴에 대한 이해가 수반되어야 합니다. 이 글에서는 간단하게 설명하고 넘어가도록 하고, 추후 다른 포스팅에서 코루틴에대해 상세히 다뤄보도록 하겠습니다. 간단하게 설명하자..
인스타그램의 샤딩 방법과 ID에 관하여 (feat. 분산 환경에서의 고유한 ID)
·
SW개발/개발이야기
안녕하세요, 오늘은 정말 1초에 정말 수많은 사진들이 업로드되는 인스타그램의 샤딩과 ID에 관한 내용에 대해서 다뤄볼까 합니다. 인스타그램의 공식 엔지니어링 블로그에 소개된 글을 번역합니다. 자세한 내용은 아래의 원문을 참고해주세요. https://instagram-engineering.com/sharding-ids-at-instagram-1cf5a71e5a5c Sharding & IDs at Instagram With more than 25 photos and 90 likes every second, we store a lot of data here at Instagram. To make sure all of our important data fits… instagram-engineering.com S..
[캐시]캐싱 전략에 대해서 (feat. Redis)
·
SW개발/개발이야기
안녕하세요, 오늘은 Redis에서 캐싱을 위한 여러가지 전략들에 대해서 알아보려고 합니다. 이전까지는 캐싱에 대해서 단순하게 잘 바뀌지 않는 데이터를 캐싱하면 좋을거야, DB 엑세스보다 메모리 엑세스가 빠르니 캐싱이 좋을거야와 같은 1차원적인 생각만을 가지고 있었는데요. Redis에서 캐시를 읽고 쓰기 위한 여러가지 전략들에 대해 알게되어, 공부하는 차원에서 캐싱 전략에 대한 내용들을 정리해보려고 합니다. Redis 캐시 읽기 전략 Look Aside (Cache Aside) 전략 기본적으로 캐시에 데이터가 있는지 확인합니다. 데이터가 없다면 DB에서 데이터를 찾아봅니다. DB에서 가져온 데이터를 캐시에 저장합니다. 데이터를 사용자에게 전달합니다. 이처럼 Look Aside 전략은 데이터가 캐시에 있는지..