JavaScript Arrays[] Interview Questions 💙

Before proceeding, do check the previous one of this series 👇

Disclaimer:

• The questions covered here are mostly conceptual
• I do not claim only these type of questions are/should be asked during interviews
• For interviews, you should have fundamentals strong. And you should be able to provide solutions to practical problems.
Series: 4️⃣
Level: Beginner
Topics:

1️⃣ Basics
2️⃣ Properties
3️⃣ Methods
4️⃣ Looping
5️⃣ Operators
6️⃣ Common Operations
7️⃣ Comparison
1️⃣ Basics

✪ What is an Array?
✪ What is Array Literal?
✪ Explain about indexes and negative indexes in an Array?
✪ What does typeof return for an array?
✪ What is an Array-Like object? Give some examples.
✪ What operations of an Array can be done on an Array-Like object?
2️⃣ Properties

✪ How to find size of an array?
✪ How to create an Array of a given size?
✪ Is array in JavaScript static sized or, dynamic sized?
✪ Is "length" a mutable property?/Can "length" of an Array be changed manually?
✪ What does happen when "length" is reduced?
✪ What will happen when "length" is increased?
✪ How to remove elements from the end of an array by manipulating the "length" property?
3️⃣ Methods

✪ Which methods of Array.prototype accepts negative indexes?
✪ How to do deep level flat operation?
✪ Which method will you use?
⇨ To find the first element of an array that matches a condition
⇨ To find if an array has an element that matches a condition
⇨ To fetch an element using negative index
⇨ To insert multiple elements at the end of an array
⇨ To insert multiple elements at the starting of an array
⇨ To remove multiple elements at the starting of an array
⇨ To remove multiple elements at the end of an array
⇨ To insert multiple elements at an index after removing multiple elements from the same index
⇨ To populate all indexes with the same value
⇨ To retrieve a sub-array from an index to an index
⇨ To copy an array
⇨ To convert an array-like object to array
4️⃣ Looping

✪ Between for...in and for...of, which is more suitable for an Array to loop through?
✪ Mention all Array.prototype methods which loop through the array.
✪ Can you loop an array which is just created using Array(n)?
5️⃣ Operators

✪ What is destructuring assignment for arrays?
✪ What is rest parameter inside destructuring assignment?
✪ Which is valid? [a, b, ...c], [a, ...b, c]
✪ Explain how spread operator operates.
✪ Swap 2 numbers using Array Destructuring.
6️⃣ Common Operations

✪ Insert an element into an array at starting/ending/any position by not mutating the original.
✪ Update an element of an array at starting/ending/any position by not mutating the original.
✪ Delete an element from an array at starting/ending/any position by not mutating the original.
✪ Insert and delete an element into/from an array at starting/ending/any position by using splice()
✪ Create a copy of an array using spread operator syntax.
✪ Merge 2 or, more arrays using concat()
✪ Merge 2 or, more arrays using spread operator syntax
✪ Find sum of all elements in an array using reduce()
✪ Shuffle elements of an array.
✪ Sort elements of an array using a custom defined order.
7️⃣ Comparison

✪ Mention the difference between

⇨ "Array()" and "new Array()"
⇨ Single parameter Array() and Multiple parameter Array()
⇨ Array.of() and Array.from()
⇨ find() and filter()
⇨ findIndex() and indexOf()
⇨ includes() and some()
⇨ some() and every()
⇨ map() and flatMap()
⇨ slice() and splice()
⇨ forEach() and map()
⇨ forEach() and for...of
⇨ shift() and pop()
⇨ unshift() and push()
⇨ reduce() and reduceRight()
The next 🧵 of this series will provide questions from

1️⃣ String
In addition to JavaScript, I have shared Interview Questions on few other subjects (SQL, DSA, Python, HTML, React, GIT) More coming in future.

For your convenience, I organised all these questions 🧵 in a "Twitter Moment". If you are interested, check 👇

twitter.com/i/events/14559…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Swapna Kumar Panda ✨

Swapna Kumar Panda ✨ Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @swapnakpanda

18 Nov
SQL Interview Questions (S3)

This is the 3rd one in this series. Check the 2nd one 👇

Disclaimer:

• The questions covered here are mostly conceptual
• I never claim only these type of questions are/should be asked during interviews
• For interviews, you should have fundamentals strong. And you should be able to provide solutions to practical problems.
Read 16 tweets
14 Nov
📚 Books you must read for

⇨ DSA
⇨ SQL
⇨ JavaScript

Books were and still are the most important medium for our knowledge growth.

Do you love to read books? How about for technical subjects? If no, I would suggest you should.

Here, I will list few of my favourite ones. If you want to add any, feel free.
1️⃣ DSA

1️⃣ Grokking Algorithms
Author: Aditya Bhargava

2️⃣ Introduction to Algorithms
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein

3️⃣ Introduction to Algorithms
Author: Udi Manber

4️⃣ The Algorithm Design Manual
Author: Steven S. Skiena
Read 11 tweets
13 Nov
Introduction to SQL Commands and their Categorisation

Topics to be covered:

0️⃣ Introduction
1️⃣ DDL
2️⃣ DML
3️⃣ DQL
4️⃣ DCL
5️⃣ TCL
6️⃣ Final Words
0️⃣ Introduction

✪ SQL stands for Structured Query Language.

✪ SQL is a computer language for storing, manipulating and retrieving data stored in a relational database.

✪ SQL uses certain commands to carry out the required task.
Read 16 tweets
13 Nov
🤷‍♀️ JavaScript Interview Questions (Series 3)

👉 A detailed coverage on functions

👇
Before proceeding, do check the previous one of this series 👇

Disclaimer:

• The questions covered here are mostly conceptual
• I never claim only these type of questions are/should be asked during interviews
• For interviews, you should have fundamentals strong. And you should be able to provide solutions to practical problems.
Read 18 tweets
12 Nov
💙 Spread and Rest Parameter Operators (...) in JavaScript

Follow this 🧵 for the easiest and never-to-forget type explanation. Thank me later 😝

Happy Weekend 👋

👇👇👇
🤷‍♀️ What is the need? [The Background]

We all know that an array is a collection of elements "kept together" in memory in a contiguous manner so that we can easily access any element using an index.

⇨ As all elements were kept together, how can we break those apart?
🤷‍♀️ Why does an array need to be broken apart?

If elements of an array are going to be "treated separately", you have to take all them out. Let's take an example.

🤷‍♀️ Problem: Print all elements in an array separately.
✅ Solution:

✪ If size is 1.
⇨ console.log(a[0])
Read 17 tweets
12 Nov
👉Interview Questions👈

🕸 Python 🐍 : Series 2

Series: 2️⃣
Level: Beginner
Topics:

1️⃣ Operators
2️⃣ Arithmetic Operators
3️⃣ Logical Operators
4️⃣ Comparison Operators
5️⃣ Assignment Operators
6️⃣ Operators Precedence
7️⃣ Operators Associativity
8️⃣ Operator Overloading
Before proceeding, do check the first one of this series👇

Read 16 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Thank you for your support!

Follow Us on Twitter!

:(