Coding interview preparation
5.82K subscribers
477 photos
1 video
97 files
168 links
Coding interview preparation for software engineers

Daily interview questions, algorithms, data structures & clean solutions.

Real interview tasks and problems.
Join πŸ‘‰ https://rebrand.ly/bigdatachannels

DMCA: @disclosure_bds
Contact: @mldatascientist
Download Telegram
πŸ’» Coding Interview Questions

1️⃣ What is an object?
Answer: An instance of a class containing data and methods.

2️⃣ What is a class?
Answer: A blueprint used to create objects.

3️⃣ What is OOP?
Answer: Object-Oriented Programming; it organizes code using objects and classes.

4️⃣ Name the four pillars of OOP.
Answer: Encapsulation, Inheritance, Polymorphism, Abstraction.

5️⃣ What is encapsulation?
Answer: Binding data and methods together and restricting direct access.

6️⃣ What is inheritance?
Answer: When a class derives properties and methods from another class.

7️⃣ What is polymorphism?
Answer: One interface, multiple implementations.

8️⃣ What is abstraction?
Answer: Hiding implementation details and showing only essentials.

9️⃣ What is an interface?
Answer: A contract that defines methods without implementation.

πŸ”Ÿ What is method overloading?
Answer: Multiple methods with the same name but different parameters.
❀4
PostgreSQL Architecture
Forwarded from Programming Quiz Channel
Which data structure provides O(1) average lookup?
Anonymous Quiz
24%
Linked list
38%
Hash map
28%
Array with search
11%
Tree
❀2
πŸ’» Coding Interview Questions

1️⃣ What is a database?
Answer: An organized collection of data for efficient storage and retrieval.

2️⃣ What is SQL?
Answer: Structured Query Language used to manage relational databases.

3️⃣ What is a primary key?
Answer: A unique identifier for each record in a table.

4️⃣ What is a foreign key?
Answer: A key that links one table to another.

5️⃣ What is normalization?
Answer: Organizing data to reduce redundancy.

6️⃣ What is an index in a database?
Answer: A structure that improves data retrieval speed.

7️⃣ What is a JOIN?
Answer: Combines rows from multiple tables based on a condition.

8️⃣ INNER JOIN vs LEFT JOIN?
Answer: INNER returns matching rows; LEFT returns all left-table rows.

9️⃣ What is ACID?
Answer: Atomicity, Consistency, Isolation, Durability.

πŸ”Ÿ What is a transaction?
Answer: A sequence of database operations executed as a single unit.
❀4
Program vs Process vs Thread
❀1
Forwarded from Programming Quiz Channel
Which algorithm is commonly used for shortest path?
Anonymous Quiz
21%
Merge sort
62%
Dijkstra
7%
KMP
10%
BFS only
The β€œI’ve Never Seen This Before” Moment

πŸ—―Scenario: The interviewer finishes explaining the problem and you realize you have never practiced anything like it.

πŸ‘‰ Do this: Shift into discovery mode. Ask about constraints, input size, and edge cases. Then propose a naive solution first and improve it. This shows structured thinking and calm problem solving, which often scores higher than instantly jumping to an optimal answer.
πŸ‘4
❔Interviewer:
Explain the difference between horizontal and vertical scaling.


βœ… Answer:

Vertical scaling means increasing the resources of a single machine, such as adding more CPU or memory. It is simpler to implement but has hardware limits and can become a single point of failure.

Horizontal scaling means adding more machines and distributing the load across them. It provides better fault tolerance and scalability but introduces additional complexity such as load balancing, data consistency, and distributed coordination.

Modern high scale systems typically favor horizontal scaling because it supports elastic growth and higher availability.
πŸ‘3❀2
The Memory Usage Question

πŸ—― Scenario: After solving the problem, the interviewer asks about space complexity and you did not track it.

πŸ‘‰ Do this: Always mention both time and space when presenting a solution. Count auxiliary data structures and recursion stack if present. Technically, many candidates forget that recursion adds implicit space. Calling this out makes you look much more thorough.
πŸ‘4
πŸ’» Coding Interview Questions

1️⃣ What is a pointer?
Answer: A variable that stores the memory address of another variable.

2️⃣ What is memory allocation?
Answer: The process of reserving memory for program execution.

3️⃣ Stack vs Heap memory?
Answer: Stack is fast and automatic; heap is dynamic and manually managed.

4️⃣ What is garbage collection?
Answer: Automatic memory cleanup of unused objects.

5️⃣ What is a deadlock?
Answer: When processes wait forever for resources held by each other.

6️⃣ What is multithreading?
Answer: Running multiple threads concurrently within a process.

7️⃣ What is synchronization?
Answer: Controlling access to shared resources in concurrent programs.

8️⃣ What is a race condition?
Answer: When multiple threads access shared data unsafely.

9️⃣ What is a process?
Answer: An independent program in execution.

πŸ”Ÿ What is a thread?
Answer: The smallest unit of execution within a process.
The Final Question Trap

πŸ—― Scenario: The interviewer smiles and says,
Do you have any questions for us?


πŸ‘‰ Do this: Always have one thoughtful question ready. Ask about the team’s biggest technical challenge or what success looks like in the first six months. Sharp questions make you memorable long after the coding part ends.
❀3
Forwarded from Programming Quiz Channel
Which life cycle model is risk-driven?
Anonymous Quiz
20%
Agile
42%
Waterfall
13%
V-model
26%
Spiral
❀1
❔Interviewer:
How does database indexing improve performance?


βœ… Answer:

Database indexing improves performance by creating a data structure, typically a B-tree or hash based structure, that allows the database engine to locate rows quickly without scanning the entire table.

Without an index, queries often require full table scans, which are O(n). With a proper index, lookups can be reduced to O(log n) or even O(1) depending on the index type.

However, indexes come with trade offs. They consume additional storage and can slow down write operations because the index must be updated whenever the data changes. Therefore, indexes should be added selectively based on query patterns.
❀4πŸ‘1
AI vs Machine Learning vs Deep Learning vs Generative AI
❀1
❔Interviewer:
How do you prioritize tasks when everything seems urgent?


βœ… Answer:

When multiple tasks are urgent, I first evaluate impact and urgency separately. I prioritize work that affects customers or production stability the most.

I also communicate early with stakeholders to align expectations and avoid silent trade offs. If necessary, I break work into smaller deliverables to show progress quickly.

This structured prioritization helps ensure that the most critical issues are addressed first while maintaining transparency with the team.
❀4
The Clarification You Forgot to Ask

πŸ—― Scenario: Halfway through coding, the interviewer says,
What about negative numbers?

Your solution breaks. You knew you should have asked more questions.

πŸ‘‰Do this: Before writing code, lock in the habit of asking at least three clarifying questions. Confirm input ranges, data types, and whether duplicates or negatives are possible. Technically, this protects you from hidden constraints that often change the entire approach. Strong candidates reduce surprises early.
❔Interviewer:
What is the difference between REST and RPC?


βœ… Answer:

REST is an architectural style that models interactions around resources using standard HTTP methods such as GET, POST, PUT, and DELETE. It emphasizes stateless communication and resource oriented design.

RPC, or Remote Procedure Call, focuses on invoking actions or functions on a remote server as if they were local calls. It is typically more operation focused rather than resource focused.

REST is generally preferred for public web APIs due to its simplicity and cache friendliness, while RPC based approaches like gRPC are often used in internal microservices where performance and strong contracts are more important.
❀3
πŸ’» Coding Interview Questions

1️⃣ What is an API?
Answer: A set of rules that allows software to communicate with other software.

2️⃣ What is REST?
Answer: An architectural style for building web services using HTTP.

3️⃣ What is HTTP?
Answer: A protocol for transferring data over the web.

4️⃣ GET vs POST?
Answer: GET retrieves data; POST sends data to the server.

5️⃣ What is a status code 404?
Answer: Resource not found.

6️⃣ What is JSON?
Answer: A lightweight data-interchange format.

7️⃣ What is authentication?
Answer: Verifying user identity.

8️⃣ What is authorization?
Answer: Granting permissions after authentication.

9️⃣ What is a cookie?
Answer: Small data stored in the browser.

πŸ”Ÿ What is a session?
Answer: Server-side storage of user data during interaction.
❀2
❔Interviewer:
How do you approach debugging a system you did not build?


βœ… Answer:


When debugging an unfamiliar system, I start by understanding the high level architecture and the data flow between components.

Next, I reproduce the issue in a controlled environment and use logs, metrics, and traces to narrow down where the failure occurs. I form hypotheses and validate them incrementally rather than making broad changes.

Throughout the process, I document findings and communicate with team members who have context. This structured approach helps reduce guesswork and speeds up root cause identification.
πŸ‘2