Gopher Academy
3.34K subscribers
920 photos
40 videos
280 files
2K links
🕸 Gopher Academy

🔷interview golang
https://github.com/mrbardia72/Go-Interview-Questions-And-Answers

حمایت مالی:
https://www.coffeete.ir/mrbardia72

ادمین:
@mrbardia72
Download Telegram
آیا DuckDB رقیب جدی SQLite  است؟
دیتابیس DuckDB :
طراحی شده برای استفاده از تمام هسته های CPU
بهینه سازی شده برای complex queries
مدعی سرعت بالاتر از SQLite
تعداد functionality built-in بیشتر بدون وابستگی
فرمت های Parquet و  Apache Arrow را میخونه

#DevTwitter | <MehrdadLinux/>

🕊 @gopher_academy | @GolangEngineers
👍9🍾2🔥1
نوشته ای برای توسعه دهندگان نرم افزار که تجربیات و شرح کار یک برنامه نویس است که شما را بیشتر با چالش های این حوزه آشنا می کند.

https://thenewstack.io/writing-for-software-engineers-read-me-first/

#DevTwitter | <amir atar/>

🕊 @gopher_academy | @GolangEngineers
👍3🍾3🔥1
This media is not supported in your browser
VIEW IN TELEGRAM
هر روز دارم ساعت ها با Git کار میکنم. در واقع کارمه ولی هنوز یه چیزاییش هست که برام گنگه...

این انیمیشن خیلی خوووب به نظرم نشون داده که Git چطوری کار میکنه! برای من یه سری داستاناش حل شد.. مخصوصا اون Staging area یا Head که توی کامندا گاهی استفاده میکردم ولی دقیقا متوجه نمیشدم!

#DevTwitter | <Sam98/>

🕊 @gopher_academy | @GolangEngineers
👍13🍾32
استخدام نیروی جدید مثل هندونهی دربستهس


آخه کدوم مدیره که دوس داشته باشه افراد نامناسب و نالایق و ضعیف رو استخدام کنه.

ولی خوب، پروسه‌ی جذب نیرو، خیلی پیچیده و پرچالشه و آزمون و خطا زیاد داره. پس گاهی وقتا که میای مصاحبه‌ی روز اولش رو با شخصیت واقعیش که در روزهای بعد به‌هرحال لو میره توی ذهنت مقایسه میکنی، با خودت میگی جلال‌خالق عجب هنرپیشه‌ی قهاری بود😳

جدی گرفتن پروسه‌ی مصاحبه،از سمت مدیر منابع انسانی سازمان خیلی مهمه و توی این فرآیند نهایت دقت و تلاش برای شناسایی، جذب و نگهداشت بهترین نیروهای انسانی باید درنظر گرفته بشه.

اینا رو گفتم... ولی بازم توی ذهنم مرور میشه که واقعا مثل هندونهی دربستهس..

✍️ Maryam Safari

#فرهنگ_سازمانی

🕊 @gopher_academy | @GolangEngineers
👍10🍾3🔥2🕊1
🔵نمای از ساختار داخلی یک اینترفیس


🕊 @gopher_academy | @GolangEngineers
6🍾4👍2
🔴 توی تصویر بالا این قضیه itab یا همون itable چیه اینم توضیحش 👇
🟢 In Golang, the itable (also known as itab) is a crucial concept related to method dispatch and interfaces. The itable contains metadata about concrete types that implement interfaces. It is dynamically constructed by Golang during runtime to facilitate method calls on interface values.

🔴یه سری نکات هم در مورد همین itabها👇
🟢The itable is generated by Golang at runtime and contains information about the methods of concrete types that satisfy interfaces

🟢t is a data structure that maps interface methods to concrete type methods, enabling efficient method dispatch for interface values

🟢The itable is created by matching the methods of interface types with the methods of concrete types, allowing Golang to determine how to call methods on interface values

🟢Golang's dynamic type conversions make it impractical for the compiler to precompute all possible itables, so they are generated dynamically when needed

🟢 The itable is a fundamental mechanism that allows Golang to achieve polymorphism and dynamic dispatch efficiently

💋 Understanding the itable in Golang is essential for grasping how method dispatch works with interfaces and how Golang handles method calls on interface values efficiently.

🕊 @gopher_academy | @GolangEngineers
🍾6👍1🔥1
🔵 برخی از کاربرد های struct{}

🔴Semaphore or Lock:
Empty structs are used to implement concurrency control mechanisms like mutex locks and read-write locks by using chan struct{} as an unbuffered channel for controlling access concurrently

🔴Placeholder:
They serve as placeholders when declaring variables or parameters that are not actively used, helping to avoid memory wastage. For instance, map[string]struct{} can represent key-value pairs where only keys are needed

🔴Interface Implementation:
When a struct needs to implement an interface without requiring any methods, an empty struct can be used as a placeholder to indicate that the struct satisfies the interface

🔴Efficient Data Structures:
Empty structs are utilized to create efficient data structures like sets by using map[keyType]struct{} where only keys are stored without values

🔴Memory Efficiency:
Due to their zero size, empty structs are memory-efficient and can be used in scenarios where signaling between goroutines is needed without passing any data, enhancing performance and reducing memory overhead


🕊 @gopher_academy | @GolangEngineers
🍾6👍3
🔵 برخی از کاربرد های map

🔴Storing Configuration Data:
Maps are often used to store configuration settings where keys represent configuration names and values hold corresponding settings. This allows for easy retrieval and modification of configuration parameters.

🔴Counting Occurrences:
Maps are useful for counting occurrences of elements in a collection. For example, you can use a map to count the frequency of words in a text or the occurrence of specific items in a dataset.

🔴Implementing Caches:
Maps can be employed to create in-memory caches for quick access to frequently accessed data. By using keys as identifiers and values as cached data, maps facilitate fast retrieval without the need for repeated expensive computations.

🔴Grouping Data:
Maps enable grouping related data together based on a common key. This is beneficial when organizing information that shares a common attribute or category.

🔴Error Handling:
Maps can be utilized to store error codes or messages associated with specific error scenarios, allowing for efficient error handling and reporting within an application.

🔴Implementing Lookup Tables:
Maps serve as efficient lookup tables where keys correspond to specific values or actions. This is commonly used in scenarios where quick access to associated data based on a key is required.

🔴Implementing State Machines:
Maps can represent states and transitions in state machines by mapping states to possible transitions or actions, providing a structured way to manage state-based logic.

🔴Data Validation:
Maps can be used for data validation by storing validation rules or constraints associated with different data fields, enabling easy validation checks during input processing.


🕊 @gopher_academy | @GolangEngineers
👍10🍾3🔥1
🔵 برخی از کاربرد های slice

🔴 Storing Data: Slices are extensively used to store and manage data in various scenarios, such as storing configuration settings, tracking collections of problems, or working with data from databases like MongoDB

🔴Dynamic Data Structures: Slices provide a dynamic nature that allows them to expand or shrink as needed, making them ideal for scenarios where the size of the data collection is unknown or needs to change dynamically


🔴Iterating Over Data: Slices are commonly used for iterating over elements in a collection, enabling efficient traversal and manipulation of data stored in the slice

🔴Appending Elements: The append function in Go is frequently used with slices to add elements to the end of a slice, facilitating dynamic growth and modification of the data stored in the slice

🔴Passing Data: Slices are often passed by reference, allowing modifications made to a slice within a function to reflect in the original slice outside the function, making them efficient for managing data across different parts of a program

🔴Grouping Similar Data: Slices are used to group similar data together, providing a convenient way to work with related elements in a collection

🔴Filtering Data: Slices can be used to filter data based on specific criteria, creating new slices that hold only the elements that satisfy certain conditions, enhancing data processing capabilities

🔴Efficient Memory Management: Slices offer efficient memory management by dynamically adjusting their size and capacity as elements are added or removed, optimizing memory usage in Go programs


🕊 @gopher_academy | @GolangEngineers
👍6🍾5🔥1
🔵 یه سری نکات در مورد GC ها

🔴 Mark-Sweep Technique: Go's GC uses the mark-sweep technique, where it marks values it encounters as live to keep track of its progress during garbage collection

🔴GOGC Configuration: The GOGC environment variable or the SetGCPercent API in the runtime/debug package can be used to configure the garbage collection behavior in Go. GOGC determines the trade-off between GC CPU and memory, setting the target heap size after each GC cycle

🔴GC Performance: The GC in Go is known for its speed, with garbage collection times measuring less than 1ms on an 18GB heap in Go 1.8. Subsequent releases have further improved GC performance, making it efficient for most workloads

🔴Latency vs. Throughput: The Go GC is tuned for latency, making it suitable for scenarios where GC pauses are tolerable. However, for use cases where throughput is crucial, such as offline CPU-bound batch processing, other options may be more optimal

🔴Dynamic Data Structures: When dynamic data structures are needed in Go, developers can choose between hand-rolled linked structures, slices, maps, or compose them to meet the requirements of the solution


🕊 @gopher_academy | @GolangEngineers
🍾4👍2🔥2
Forwarded from Gopher Academy (𓄂👑𓆃)
اگر‌ پرمیوم هستید در تلگرام می توانید با زدن Boost از کانال گوفر آکادمی و گروه مهندسین گولنگ حمایت کنید.

https://t.me/gopher_academy?boost


🕊 @gopher_academy
🍾7👍2🔥1🕊1
Since Go 1.23, the idiomatic use of time.Timer will be changed to be much more clean.


🕊 @gopher_academy | @GolangEngineers
👍10
🔵 هرانچه که باید در مورد Process vs Thread بدونید

🔴Definition:
🟢Process: A process is an active program under execution, containing its own memory space and resources.
🟢Thread: A thread is a lightweight process that can be managed independently by a scheduler, sharing memory and resources with other threads within the same process.

🔴Context Switching:
🟢Process: Processes require more time for context switching due to their heavier nature.
🟢Thread: Threads require less time for context switching as they are lighter than processes.

🔴Memory Sharing:
🟢Process: Processes are independent and do not share memory with other processes.
🟢Thread: Threads may share memory with their peer threads within the same process.

🔴Communication:
🟢Process: Communication between processes takes more time compared to communication between threads.
🟢Thread: Communication between threads is faster than between processes.

🔴Blocked:
🟢Process: If a process gets blocked, other processes can continue execution independently.
🟢Thread: If a user-level thread gets blocked, all peer threads within the same process are also blocked.

🔴Resource Consumption:
🟢Process: Processes generally require more resources than threads.
🟢Thread: Threads need fewer resources compared to processes.

🔴Dependency:
🟢Process: Individual processes are independent of each other.
🟢Thread: Threads are parts of a process and are interdependent.

🔴Data and Code Sharing:
🟢Process: Processes have independent data and code segments.
🟢Thread: Threads share data and code segments with their peer threads.

🔴Creation and Termination:
🟢Process: Processes take more time for creation and termination.
🟢Thread: Threads require less time for creation and termination.


🕊 @gopher_academy | @GolangEngineers
🍾7
12 Factor App

🕊 @gopher_academy | @GolangEngineers
👍6🔥1🍾1
🔵A Crash Course in IPv4 Addressing

🔴https://blog.bytebytego.com/p/a-crash-course-in-ipv4-addressing


🕊 @gopher_academy | @GolangEngineers
👍31🍾1
🎯یه مقاله خوب در مورد مدل M-P-G گولنگ که توسط سینا نوشته شده
🎯 مقاله ای هست با کلی نکته برای درک بهتر اینکه چطور الگوریتم زمانبند رانتایم کار می کند

👇به یه سری سوالت جواب میده این مقاله سوالاتی همچون

🔻مفهوم ترد یا نخ یا thread چیه؟
🔻اما thread با پروسه چه فرقی میکنه؟
🔻اصطلاح execution contextچیه؟
🔻سی پی یو dispatch کار چیه؟
🔻زمان بند چیه؟
🔻تفاوت نخ های هسته و نخ های سطح کاربر یا همون goroutine ها توی go چیه؟
🔻حالت های گوروتین ها از نظر اجرا
🔻دلایل مختلف بلاک شدن یک گوروتین
🔻استراتژی hands off
🔻قتی syscall زده میشه نخ یا M جدید از کجا پیداش میشه؟
🔻چه زمانی thread ها در حالت spinning هستن؟
🔻اصطلاح hand off و spinning و netpoller چیه؟

👑 https://blog.snix.ir/posts/golang-scheduler-MPG-model


🕊 @gopher_academy | @GolangEngineers
👍5🔥4🕊1🍾1
این سایت توضیح شغلی به AI اش میدید و ازتون با توجه به همون توضیحات مصاحبه میکنه.

#pythony

https://interviewsby.ai


🕊 @gopher_academy | @GolangEngineers
7👍4🕊1
🔵 A Crash Course in CI/CD

🔴 https://blog.bytebytego.com/p/a-crash-course-in-cicd


🕊 @gopher_academy | @GolangEngineers
2🕊2👍1🍾1
🔵Benefits of continuous integration

🕊 @gopher_academy | @GolangEngineers
👍2🔥1🕊1
🔵Continuous deployment vs. continuous delivery

🕊 @gopher_academy | @GolangEngineers
👍21🍾1