TGViewer
Channel Public Channel
Coding Interview Preparation

Coding Interview Preparation

@coding_interview_preparation

Coding interview preparation for software engineers

Interview questions, DSA, clean solutions.
Join 👉 https://rebrand.ly/bigdatachannels

Buy ads: https://telega.io/c/coding_interview_preparation

DMCA: @disclosure_bds
Contact: @mldatascientist
Subscribers
5.9K
Photos
486
Videos
2
Links
174

Showing posts older than #1148 · Back to latest

Older Posts 19 shown
Post #1147 675
OSI Model Explained
Post #1145 670
Functions You Should Know
  • ❤ 1
Post #1144 724
You're in an interview, and the interviewer asks,

How many types of API functions are available in Node.js? Explain them.


here's how you can answer:

Sample Answer:

In Node.js, there are mainly two types of API functions: blocking (synchronous) and non-blocking (asynchronous).

Blocking functions execute code one line at a time, meaning the next line won’t run until the current task is finished. For example, when you use fs.readFileSync() to read a file, it waits until the file is completely read before moving on to the next line of code. This approach can slow down the application if the task takes a long time because it blocks everything else from running.

Non-blocking functions, on the other hand, let other code run while the task is happening in the background. For instance, fs.readFile() reads a file asynchronously and immediately moves on to the next line without waiting. This makes non-blocking functions much faster and more efficient, especially for tasks like reading files, making network requests, or interacting with a database.

Node.js relies heavily on non-blocking functions because they help the application handle many tasks at once without getting stuck, making it more responsive and scalable. This approach is great for high-performance applications like web servers, where you need to handle multiple requests at the same time without delays.

So, to sum it up: blocking functions execute tasks one by one, stopping other code from running, while non-blocking functions run tasks in the background, keeping everything else running smoothly.


▶️ Tap on the text to Copy.
  • ❤ 2
Post #1143 607
SQL Basics handmade cheatsheet
Post #1142 669
The Software Design and Architecture Stack
  • ❤ 2
Post #1141 660
Discrete Data Vs. Continuous Data
Post #1140 638
Mistakes Of Data Scientist
Post #1139 616
Types of Inheritance

1. Single Inheritance:
In single inheritance, a class can inherit from only one parent class. This is the simplest form of inheritance. The derived class inherits the attributes and methods of a single base class.

2. Multiple Inheritance:
Multiple inheritance allows a class to inherit from more than one parent class. In this case, the derived class inherits the attributes and methods of multiple base classes.

3. Multilevel Inheritance:
In multilevel inheritance, a class derives from another class, which in turn derives from another class, creating a chain or hierarchy of classes.

4. Hierarchical Inheritance:
In hierarchical inheritance, multiple derived classes inherit from a single base class. This creates a tree-like structure of classes, with a common base class.

5. Hybrid Inheritance:
Hybrid inheritance is a combination of two or more types of inheritance within the same program.
Post #1138 579
Inheritance in Object Oriented Programming (OOP)

A concept that allows one class to inherit the properties and behaviours (i.e., fields and methods) of another class.
Inheritance promotes code reusability and helps in structuring and organizing code.

In inheritance we have:
1. Base Class (Parent Class or Superclass):
The class whose properties and methods are inherited by another class.

2. Derived Class (Subclass or Child Class):
The class that inherits from a base class is known as the derived class or subclass.

Syntax:
class BaseClass {

};

class DerivedClass : access-specifier
BaseClass {

};



Imagine we have a "Vehicle" class. This class defines what all vehicles have in common, like wheels and an engine.
Now, if we want to create a "Car" class, you can make it inherit from the "Vehicle" class.

So, inheritance helps us avoid repeating the same code and makes it easier to create new classes that share common features with existing classes.
  • ❤ 1
Post #1136 561
P-Value Approach
Post #1135 668
How To Solve Any Problem In 60 Minutes
Post #1133 672
Finding the Pvalue
Post #1132 699
Docker clearly explained
Post #1130 765
Top 10 Core Java Interview Questions
Post #1128 748
SQL Vs MongoDB
Post #1127 849
C++ Ultimate Guide
Post #1126 881
C++ Cheatsheet
Post #1125 881
Object Oriented Programming
  • ❤ 7
Older posts →
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →