Shalini Tewari Profile picture
Software, full stack developer | Simplifying web development and programming for you 🚀
Kolusu_Trinadh Profile picture Suryansh Singh Profile picture 2 subscribed
Jul 23 5 tweets 3 min read
Most asked JavaScript Interview Questions 🧵: Easy:

1. What is JavaScript?
2. Explain the difference between let, const, and var.
3. What are JavaScript data types?
4. What is typeof operator? Provide examples.
5. What is the difference between == and ===?
6. How do you declare a function in JavaScript?
7. Explain the concept of hoisting in JavaScript.
8. What are JavaScript closures? Provide an example.
9. What is an IIFE (Immediately Invoked Function Expression)?
10. Explain the difference between null and undefined.
11. What are template literals in JavaScript?
12. What is the difference between map and forEach?
13. What are arrow functions?
14. Explain the difference between call, apply, and bind.
15. What is event delegation?
16. What is a promise in JavaScript?
17. Explain the concept of async/await.
18. What is JSON? How do you parse and stringify JSON in JavaScript?
19. What are ES6 modules?
20. How can you create an object in JavaScript?
21. Explain the difference between var, let, and const scope.
22. What is the purpose of the this keyword in JavaScript?
23. What is the difference between synchronous and asynchronous code?
24. What is the spread operator in JavaScript? Provide an example.
25. How do you handle exceptions in JavaScript?

These questions are mainly for your thorough understanding. They have a lower chance of being asked directly in interviews.
Jul 8 4 tweets 2 min read
Best practices for frontend web developers: 1. Craft Clean Code

- Semantic HTML: Build meaningful, well-structured content.
- Consistent Style: Keep your code neat with clear naming, indentation, and comments.
- Modular CSS: Embrace BEM for organized and maintainable styles.

2. Speed Up Your Site

- Cut HTTP Requests: Combine files and use CSS sprites.
- Optimize Images: Choose the right format, compress, and go responsive.
- Lazy Load: Delay loading images and media for a faster experience.
- Code Splitting: Only load the JavaScript you need.

3. Stay Responsive

- Mobile-First: Design for small screens first, then scale up.
- Fluid Layouts: Use CSS Grid or Flexbox.
- Media Queries: Tailor styles for different screen sizes and orientations.

4. Boost Accessibility

- Keyboard Friendly: Ensure full functionality via keyboard.
- Alt Text Matters: Describe images for screen readers.
- Contrast Counts: Ensure readable color contrasts.
Jul 7 4 tweets 2 min read
Ask someone the difference between SQL and NoSQL, they'll say one is relational other is non-relational, but there is more to it:

Here is how you can explain in detail: SQL (Structured Query Language):

Structure:
- Uses a fixed schema.
- Data organized into tables with predefined columns and data types.

Language:
- Uses SQL (Structured Query Language) for querying.
- Powerful for complex queries involving joins and aggregations.
Example: SELECT * FROM users WHERE age > 20;

Flexibility:
- Rigid schema, less flexible.
- Schema changes require migrations.

Transactions:
- Supports ACID (Atomicity, Consistency, Isolation, Durability) properties.
- Ideal for applications requiring reliable transactions.
Example use case: Banking systems, financial applications.

Community and Support:
- Long-established with a vast community.
- Mature tools and extensive documentation.

Cost:
- May involve higher costs due to the need for powerful servers for vertical scaling.

Popular SQL Databases:
MySQL
PostgreSQL
SQLite
Jul 6 6 tweets 2 min read
The first time I got this interview question, I was stunned. I thought there were only 5 HTTP methods, but there are more! Here's a quick guide so you don't get caught off guard like I did :)

Imagine you're in an interview, and the interviewer asks:

"Tell me about all the HTTP Methods other than GET, POST, PUT, PATCH, and DELETE." There are total 9 HTTP Methods:
1. GET
2. POST
3. PUT
4. PATCH
5. DELETE
6. HEAD
7. OPTIONS
8. CONNECT
9. TRACE
Jul 5 5 tweets 2 min read
We often check the "Accept all cookies" option. Do you know what these 'cookies' mean?

Here is the explanation: What are cookies?

Cookies are small text files that websites store on your computer or device when you visit them. These files contain information about your interactions with the site and are designed to enhance your browsing experience.

There are different types of cookies:

1. Session Cookies:
Temporary cookies that are erased when you close your browser.

2. Persistent Cookies:
These cookies remain on your device for a set period (days, months, or years).

3. First-party Cookies:
Set by the website you are currently visiting. Essential for the site's functionality, remembering user preferences, and providing a personalized experience.

4. Third-party Cookies:
Set by domains other than the one you're currently visiting. These are often used for tracking and advertising. For example, when you see ads related to your interests on various websites.
Jul 4 6 tweets 2 min read
My handmade JavaScript Cheatsheets(Notes) that might come in handy:

1. == vs === in JavaScriptImage 2. Strings in JavaScriptImage
Jul 4 5 tweets 2 min read
Almost every web developer interview I had as a fresher included the question:

"How does the web work?"

Here's how you can answer: - The web is powered by web servers, which are powerful computers connected to the internet 24/7. These servers store and serve web pages, files, and data. When you access a website, you're essentially requesting data from these servers.
It is a software and hardware that uses HTTP (Hypertext Transfer Protocol) and other protocols to respond to client requests made over the World Wide Web. T

- Each web server has a unique IP (Internet Protocol) address, which is a series of numbers like 192.158.1.38. However, since IP addresses are not user-friendly, we use domain names.
Domain names are human-readable addresses mapped to IP addresses, making it easier for people to access websites.

Example of an IP Address: 192.158.1.38
Example of a Domain Name: example. com

- A URL is the complete address used to access a specific resource on the internet. It includes the protocol, domain name, path, query, and fragment, specifying the exact location of a resource on a server.
Jul 2 6 tweets 3 min read
During a recent interview, my friend was asked,

"How does Bluetooth work?"
To my surprise, she couldn't answer.
So to ensure you're never caught off guard, here's a clear and concise explanation: 1. Bluetooth Pairing

Discovery and Inquiry
- Scanning and Inquiry:
When a Bluetooth device (e.g., your phone) initiates a scan, it sends out inquiry packets to discover nearby devices. Devices in discoverable mode (e.g., a speaker) respond with their Bluetooth addresses and device names.

- Inquiry Response:
The discoverable device sends back an inquiry response packet containing its unique Bluetooth address and other information.

Link Establishment

- Connection Request:
The initiating device sends a connection request to the discovered device, requesting to establish a link.

- Link Setup: The devices establish a temporary link, where they exchange basic information and agree on settings like frequency-hopping patterns.

Authentication and Pairing

- Authentication: If required, the devices exchange a PIN or passkey to authenticate each other. This ensures that the devices are allowed to connect.

- Link Key Generation: Once authenticated, the devices generate and exchange a link key, which is used for encryption and securing the connection.

- Bonding: The link key is saved for future connections, allowing the devices to pair automatically without re-entering the PIN.
Jun 26 5 tweets 2 min read
If I were to start DSA today, I would not miss these tips: 1. Build a Strong Foundation:
Choose a language and start with the basics. Understand the fundamentals of data structures and algorithms thoroughly. These are the building blocks of DSA.

2. Understand Time and Space Complexity:
Learn to analyse the time and space complexity of algorithms. This understanding is critical for evaluating the efficiency of your code.
Jun 20 4 tweets 2 min read
Error Handling in JavaScript explained:

Day 19 of #60daysofmern Error Handling in JS:

Handling errors in JavaScript is crucial for writing robust and reliable code. There are several mechanisms to deal with errors in JavaScript:

- Try-Catch Blocks: (preferred)
• JavaScript has a built-in mechanism for handling errors using try, catch, and finally blocks.
• We can wrap the potentially error-prone code in a try block, and if an exception occurs, it is caught and handled in the corresponding catch block.

- Throwing Custom Errors:
• We can throw custom errors using the throw statement, allowing you to create meaningful error messages and handle them accordingly.

-Async/Await Error Handling:
• When working with asynchronous code and async/await, use try-catch blocks to handle errors in a synchronous manner.Image
Jun 17 5 tweets 3 min read
Introduction to Asynchronous JavaScript:

Day 18 of 60DaysofMERN 🚀 JavaScript is single-threaded, meaning it executes one task at a time. Asynchronous programming allows JavaScript to perform non-blocking operations, letting other tasks continue executing without waiting for previous ones to complete.

Difference between Synchronous and Asynchronous JavaScript:

Synchronous and asynchronous in JavaScript refer to how code is executed and how tasks are handled in relation to the event loop.

- Synchronous JavaScript:
• In synchronous code execution, tasks are performed one at a time, in sequence.

• Each task must complete before the next one starts, blocking the execution of code until the current task is finished.

• It follows a predictable and straightforward flow, making it easier to understand and debug.

- Asynchronous JavaScript:
• Asynchronous code allows tasks to be executed concurrently without waiting for the completion of each task.

• It doesn't block the execution of code; instead, it uses mechanisms like callbacks, promises, or async/await to handle tasks in the background.

• Asynchronous operations are often used for tasks that may take some time to complete, such as fetching data from a server or reading a file.
Jun 17 8 tweets 2 min read
You're in an interview, and the interviewer asks,

"Why did you leave your previous company?"

Here is how you can answer: The interviewer's a mind reader, right? Wrong!
They don't know why you left your last company. This is your chance to frame the narrative and showcase what you're looking for in a new opportunity.
Jun 16 5 tweets 2 min read
Want to become a skilled Web Developer? Don't miss these: 1. Master Responsive Design
To become a skilled web developer, mastering responsive design is essential. This involves creating web pages that look and function well on a variety of devices and screen sizes. By using fluid grids, flexible images, and media queries, you can ensure that your websites provide a consistent user experience across desktops, tablets, and smartphones.

2. Utilize CSS Frameworks
CSS frameworks like Bootstrap, Tailwind can significantly speed up your development process. By experimenting with these frameworks, you can learn how to quickly build responsive and aesthetically pleasing websites. They also introduce you to best practices and reusable components that can make your code more efficient and maintainable.
Jun 12 7 tweets 2 min read
How to present your personal projects in an interview the right way: 1. Start with a Clear Introduction:
Begin by introducing your project in a concise and engaging manner. Clearly state the problem you aimed to solve or the goal you wanted to achieve with your project.

Eg: "Thank you for the opportunity to discuss my project. I developed a [name & motive] "
Jun 11 4 tweets 3 min read
Strings and Conditional Statements in JavaScript explained:

Day 13 of #60daysofMERN Strings:

Strings are a sequence of characters used to represent text. Strings can be created using single quotes ('), double quotes ("), or backticks (`) for template literals.

Creating String:
// Using single quotes
let singleQuoteString = 'Hello, World!';

// Using double quotes
let doubleQuoteString = "Hello, World!";

// Using backticks (template literals)
let templateLiteralString = `Hello, World!`;

Common String Methods:

1. length: Returns the length of the string.

2. charAt(index): Returns the character at the specified index.

3. charCodeAt(index): Returns the Unicode of the character at the specified index.

4. concat(...strings): Combines the text of two or more strings and returns a new string.

5. includes(searchString, position): Checks if the string contains the specified string.

6. endsWith(searchString, length): Checks if the string ends with the specified string.

7. indexOf(searchValue, fromIndex): Returns the position of the first occurrence of a specified value in a string.

8. lastIndexOf(searchValue, fromIndex): Returns the position of the last occurrence of a specified value in a string.

9. match(regexp): Searches a string for a match against a regular expression.

10. repeat(count): Returns a new string with a specified number of copies of the original string.

11. replace(searchValue, newValue): Searches for a specified value and replaces it with a new value.

12. search(regexp): Searches a string for a match against a regular expression and returns the index of the match.

13. slice(beginIndex, endIndex): Extracts a part of a string and returns a new string.

14. split(separator, limit): Splits a string into an array of substrings.

15. startsWith(searchString, position): Checks if the string starts with the specified string.

16. substring(startIndex, endIndex): Extracts the characters from a string between two specified indices.

17. toLowerCase(): Converts the string to lowercase.

18. toUpperCase(): Converts the string to uppercase.

19. toString(): Returns a string representing the specified object.

20. valueOf(): Returns the primitive value of a String object.Image
May 26 5 tweets 1 min read
Got a handle on JavaScript concepts and starting with projects? Here's what to avoid: 1. Read what the console is displaying, especially if you're getting error messages:
Don't ignore the console messages, they're like clues telling you what's wrong with your code. Take a moment to understand them, and you'll fix issues faster.

2. Are you working with the right type of variables? Which is the right choice?
Think of variables like tools. Make sure you're using the right one for the job. Mixing them up can mess things up, so double-check your choices.
May 23 6 tweets 2 min read
Master these Git commands for daily use: Initializing and Cloning Repositories

1. Initialize a New Repository
- git init
Sets up a new Git repository in the current directory by creating a .git subdirectory to store repository metadata.

2. Clone an Existing Repository
- git clone
Makes a local copy of an existing repository, including all its history and branches.
May 14 8 tweets 2 min read
You're in an interview and the interviewer concludes by saying,

"Do you have any questions for us?"

Here is how you can answer: 1. Team Dynamics and Collaboration:

"Could you tell me more about the team dynamics and collaboration within the company?"

- This question shows that you value teamwork and want to understand how teams work together within the company.
- It can provide insights into whether the company encourages collaboration and open communication, or if it operates more independently.
May 10 7 tweets 2 min read
You're in an interview, and the interviewer asks,

"Can you tell me about yourself?"/ "Tell me something about yourself."

Here is how you can answer: 1. Start with a Brief Introduction:

When asked about yourself in an interview, start by giving a brief introduction. Mention your name, where you're from, and a bit about your educational background. Keep it concise and relevant to the job you're applying for.

For example, "My name is [Your Name]. I grew up in [Your City/Town] and recently graduated with a degree in [Your Field]."
May 4 5 tweets 2 min read
Day 6 of #10daysofSQL

Topics covered:
- SQL functions
- Aggregate functions
- LIKE operator What are SQL functions?

SQL functions are predefined operations that can be invoked with specific arguments to perform computations, manipulate data, or return specific results. These functions can be categorized into several types based on their purpose:

1. Scalar Functions: These functions operate on a single value and return a single value.
eg: LEN(), CAST() etc.

2. Aggregate Functions: These functions operate on a set of values and return a single value summarizing that set.
eg: SUM(), AVG() etc.

3. Analytic Functions (Window Functions): These functions perform calculations across a set of rows related to the current row.
eg: ROW_NUMBER() etc.

4. Table-Valued Functions: Unlike scalar functions, table-valued functions return a table as a result. They can accept parameters and perform complex processing to generate the output table.
May 2 4 tweets 2 min read
Day 5 of #10daysofSQL 🚀

Topics covered:
- Data control language
- Transaction control language DCL (Data Control Language)
DCL includes commands such as GRANT and REVOKE which mainly deal with the rights, permissions, and other controls of the database system.

DCL commands:

1. GRANT:
This command gives users access privileges to the database.

Syntax:

GRANT SELECT, UPDATE ON MY_TABLE TO SOME_USER, ANOTHER_USER;

2. REVOKE:
This command withdraws the user’s access privileges given by using the GRANT command.

Syntax:

REVOKE SELECT, UPDATE ON MY_TABLE FROM USER1, USER2;