Create a counter with two buttons + and -. On clicking these buttons the number should increment and decrement respectively from the given value. Show error when you give any input other than number.
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Odio possimus ipsa placeat debitis! Sunt, cumque natus
13 | praesentium aut vero eligendi aperiam officiis! Officiis aliquid cumque ipsa est repudiandae illo quam?
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 | Build a counter application and then some questions were asked related to the coding part
14 |
15 |
0
16 |
17 |
18 |
19 |
20 |
21 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/Two_days_before/q10.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | Create a password checker web app. If password is less than 10 characters then show an error to user otherwise show success.
11 |
12 |
13 |
14 |
15 |
16 |
33 |
34 |
--------------------------------------------------------------------------------
/Two_days_before/q11.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
14 |
15 |
16 |
17 | Create a web app and render your name using any heading or paragraph tag.
18 | It should have a border of 1px around it. Create 2 buttons, '5px' and '10px' below your name. The width of border
19 | should change to 5px and 10px by clicking respective buttons.
20 |
21 |
Pritam Kumar
22 |
23 |
24 |
25 |
26 |
27 |
28 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Two_days_before/q12.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 | Take an input from the user in text format.
13 | Have 3 buttons with the names of "Log" ,"Warn" and "Error".
14 | If user clicks on "Log" button then the text entered by user will be shown in black color.
15 | Similarly if the user clicks on "Warn " and "Error " buttons then the text entered by user will be shown on the
16 | screen in the yellow and red colors respectively
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/Two_days_before/q13.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 | Create a web app, where I input my name, and then I input a password.
13 | If the password contains the input name in it, show an error message "Password can't have name"
14 |
15 |
16 |
17 |
18 |
19 |
20 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Two_days_before/q14.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 | Here's an API Link: https://mystery-api.kushanksriraj.repl.co/get
13 |
14 | This API link can give two errors, either 404, or 401.
15 | If the error is 404, show the user 'page not found' and if the error is 401, show the user
16 | 'you are not logged in'.
17 | Followup question: If the status is 200 then show the message "API is working"
18 |
19 |
20 |
21 |
50 |
51 |
--------------------------------------------------------------------------------
/Two_days_before/q15.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 | Create an Input Element, which shows a display message according to the
12 | Input text with the click of a button. If you type -
13 |
14 |
15 |
16 |
17 |
18 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Two_days_before/q16.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
Create 2 buttons with text YJHD and ZNMD. At the click of a button, call the given API with the query as same as
13 | the button text, and display the message you get on the screen.
14 | Followup: Instead of using calling the fetch function twice in both events(clicking of buttons), enclose it in a
15 | different function so that it can be used accordingly in both areas.
16 |
17 | The trick in the follow-up: addEventListerner methods do not require any additional parameter to be attached in
18 | the function that is passed as 2nd parameter otherwise that function gets called there itself on the spot
19 | instead of executing the function on the event. Solved by using arrow Function
13 | // Create a counter app which consist of counter value with two buttons + and -. On clicking these buttons the
14 | number should increment and decrement respectively. Add on make '-' button disable while counter value is 0,
15 | only enable when the counter value is greater than 0 and again disable '-' button when counter value becomes 0.
16 |
Here’s an API. Fetch the name and age of user and show them on the web page. Now check weather the user is
13 | eligible for vaccination ( must be above 45 ). If yes, show the name in green colour. API -
14 | https://randomuser.me/api/?results=10
Here' an API. It will give an error. Write a web app, call this API and read the error message. Show the name of the error (not whole error). API - https://randomsuser.me/api/
11 |
12 |
13 |
14 |
27 |
28 |
--------------------------------------------------------------------------------
/Two_days_before/q2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
21 |
22 |
23 |
24 |
25 | // Question - Create an Input Element, display the text entered in it, in an outside div. Now Create three buttons,
26 | with the names Bold, Italics and Strike through. And clicking on the button will apply the respective style to the
27 | text present in output div.
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
Here’s an API. Fetch the name and gender of user and show them on the web page. Now check weather the user is male or female. If the user is a female, show the name in pink colour. API - https://randomuser.me/api/?results=10
Put a paragraph on web with 16px font size. Now Increase the font size by 4px and vice-versa with the help of two
13 | buttons. Now change the colour of paragraph to RED when font size is divisible by 5. ( This question was given
14 | by Pranshu (neoGrad) in my mock interview)
Create a web app to simulate the dark mode functionality. On clicking the button, background color should change
21 | from WHITE to GREY and vice-versa.
Create a password checker web app.If the length of the password is less than 10 characters then show an error
13 | message and if its length is greater then show the
14 | message "Password is valid"
15 | Followup: If there is nothing in the input section then no message should be shown
16 | (Kevin does it using Vanilla JS on stackblitz)
Refer to https://npmjs.com/ on the top navbar at the left there is a heart shaped icon which when clicked returns
13 | 3 words every now on each click and the first character taken from each of the 3 words forms "NPM"
14 | So what Akshay wanted Divya to do was to have a button in the display which on every click show a random word
15 | from a list of words
16 | (Divya did it using Vanilla JS on Vscode)
17 | Hint: use the inbuilt function random from Math library for solving it
// create three button plus, minus and reset
11 | // and create an element div with 0 as an initial text content
12 | // when the user clicks "plus" increment element by one
13 | // when the user clicks "minus" decrement it by one
14 | // when the user clicks "reset"
15 | // set it to zero
create a div and three buttons having innertext as left align,center align and right align . in clicking any of
13 | the button the text insode of that div should become as the text of the button and should do the task that the
14 | inner text of the button says
you have to create a profit and loss calculator, in which you will make two input sections one will take current price and other one will take the cost price and to show result one will click on a button and a message will be shown, if there is loss then you just have to show a message with loss amount and similarly for profit
13 | Here is an API: https://otpgenerator.ishanjirety.repl.co/get-otp?name= . You will enter a name as input from
14 | your app and send this API a request with the name along with it (this will be the final URL :
15 | https://otpgenerator.ishanjirety.repl.co/get-otp?name=Nameentered) on button click . In the response you will
16 | get an OTP which should be shown on the screen.
17 |
18 | Followup1: Make another input section that asks the user to guess the OTP and for checking whether the guess is
19 | equal to the actual one or not add a button "Validate" which on clicking shows the message "Success " or
20 | "Failure" depending . Response is coming in the form of Name-OTP format so something like Pratyush-570928.So
21 | compare the OTP value from the response as well as the input which is being entered
22 |
23 | Followup2: Change the color of validate message to GREEN when success comes up and change it to RED if failure
24 | comes up on click of Validate Button.
25 |
Create a web app which should have one input field and one button. If the input value is even number then text
13 | should be green and if odd, text should be red
// Create a web app which will have 2 input fields.. in 1st input, user can enter a sentence. In 2nd input, user can enter a word. Now if word is present in sentence, then display: found.. else display not found. And the display should work as soon as u enter the text in 2nd input field
Create two objects with name, power, and yuga as Ram, 2500, Treta. Krishna, 2325, Dwapar. Say if every character in name is worth 35 power points. Write a function which takes two objects and return the person with more power based on their name and power both.
11 |
Create a web app which would take two inputs. It would also have 4 buttons: +, -, x /. Based on the button clicked perform the operation on the two inputs. You can do this in React or vanillaJS based on your choice
11 | Create two objects with name, power, and yuga as Ram, 2500, Treta. Krishna, 2325, Dwapar. Write a function which takes two objects and return the person with more power.
12 |
Create a web app where I can input a text. Now, create three buttons h1, h2, h3. When I click on any of the button, the text should become h1, h2, or h3.
// Here' an API. It will give an error. Write a web app, call this API and read the error message. Show the name of the error (not whole error). API https://randomsuser.me/api/
11 |
12 |
13 |
14 |
22 |
23 |
--------------------------------------------------------------------------------
/Two_days_before/q4.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 | Create a web app to simulate the character counter functionality of Twitter. When user starts to type something,
14 | counter should starts to decrease from 30. When counter reaches to 15, show it in yellow till 0. When counter
15 | reaches to 0, show it in red till infinite -ve number ( no min limit ). Now create a button. On clicking the button,
16 | show the input text on web page. Also, when counter is less than 0, disable the button.
17 |
18 | 30
19 |
20 |
21 |
22 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/Two_days_before/q40.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
//You need to create three input fields and an output field.
11 | // First, two input fields will take numbers as input. The last input field will take the operator as input. // Operators are +, -, × and /. If the third input field value is + then show in the output field the sum of the first input value + second input value. Similarly, if we enter ×, - and / in the third input field. // Note: Button is not required. for this question: limit the last input field to take only +,-,× and /. Show error if user gives any other input.
// Create a password checker. When char goes above 10, input border should become green. Now create a button. On clicking the button, show/hide the password. ( change ......... to text and vice versa. ) HINT - you need to change the type of input field...........for this question, it works only when the cursor is outside of the input field, when cursor inside its yellow, how to change that?
// Another question: // You have to create a counter.
14 | // Create two buttons + and -. On clicking the + button increment the counter. Similarly for -. // Now highlight
15 | the counter:
16 | // i. If the counter value is multiple of 3 then highlight the counter with Red colour.
17 | // ii. If the counter value is multiple of 5 then highlight it with Green colour.
18 | // iii. If the counter value is multiple of both 5 and 3 then highlight it with Yellow colour.
// Create a password checker. When char goes above 10, input border should become green. Now create a button. On
13 | clicking the button, show/hide the password. ( change ......... to text and vice versa. ) HINT - you need to
14 | change the type of input field...........for this question, it works only when the cursor is outside of the
15 | input field, when cursor inside its yellow, how to change that?
16 |
// The question Pranshu asked was that the user will not be able to
13 | // add more characters after a certain limit has been reached(deleting
14 | // characters is still possible).He asked Saksham to disable the button
15 | // when the text area is empty and enable it when something is typed.
16 |
17 | // As an extension of this, you can also cover the edge case that the
18 | // button should remain disabled if there are only spaces in the text area.
// 11.Create a web app which has two input fields and two buttons. One input field will be used to take the input from the user and on the click of a button it will be displayed in h1,p, or you can use any tag of your preference. the second onput will take the color and on the click of the other button the displayed text should change to the color enterd by the user.
// HTML page contains the following form:
11 | // Write a setup function that registers a click handler and implements the following logic:
12 | // When a button with id double is clicked, the value of the text field with id value should be doubled.
13 | // If the value of the text field is not numeric, the button click should set it to 1.
14 | // Ye chit chat mai mast question mila muzhe
15 |
16 |
--------------------------------------------------------------------------------
/Two_days_before/q5.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 | Create a game (Guess The Number) where user has to guess the random number range from 1 to 10. User will input a
13 | number between 1 to 10 . On clicking the button, show the user whether he/she has guess the number or not
14 |
15 |
16 |
17 |
18 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Two_days_before/q50.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/Two_days_before/q51.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 |
14 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Two_days_before/q6.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 | The question Pranshu asked was that the user will not be able to
13 | add more characters after a certain limit has been reached (deleting
14 | characters is still possible). He asked Saksham to disable the button
15 | when the text area is empty and enable it when something is typed.
16 | As an extension of this, you can also cover the edge case that the
17 | button should remain disabled if there are only spaces in the text area.
18 |
19 |
20 |
21 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Two_days_before/q7.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 | Create a web app where user can input his/her name and a colour. (put a list of colours from which user can choose
13 | one ). On clicking the button, show the name with the same colour which user has entered.
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/Two_days_before/q8.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | Create an array of 10 names. [ "Abhi", "Vishal","Aryan","John",.........upto 10 ]. Now create a button. On clicking the button, show one random name.
11 |
12 |
13 |
14 |
15 |
16 |
36 |
37 |
--------------------------------------------------------------------------------
/Two_days_before/q9.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 | Create a password checker. When char goes above 10, input should become green. Now create a button. On clicking the button, show/hide the password. ( change ●●●●● to text and vice versa. ) HINT - you need to change the type of input field.
11 |
12 |
13 |
14 |
15 |
35 |
36 |
--------------------------------------------------------------------------------
/interview_q/Q10.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
12 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/interview_q/Q12.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
17 |
18 |
19 |
22 |
34 |
35 |
--------------------------------------------------------------------------------
/interview_q/Q14.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | Document
10 |
11 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/interview_q/Q15.js:
--------------------------------------------------------------------------------
1 | // Create two objects with name, age, and yuga as Ram, 25, Treta. Krishna, 31, Dwapar. Write a function which takes two objects and return the person with more age.
2 |
3 | const persOne = {
4 | name: 'Ram',
5 | age: 25,
6 | yuga: 'Treta'
7 | }
8 | const persTwo = {
9 | name: 'Krishna',
10 | age: 31,
11 | yuga: 'Dwapar'
12 | }
13 |
14 | function checkAge(one, two){
15 | if(one.age>two.age){
16 | return one
17 | }else{
18 | return two
19 | }
20 | }
21 |
22 | const checkingAge = checkAge(persOne, persTwo)
23 |
24 | console.log(`The person ${checkingAge.name} getting old ${checkingAge.age} years`)
--------------------------------------------------------------------------------
/interview_q/Q16.js:
--------------------------------------------------------------------------------
1 | // Create two objects with name, power, and yuga as Ram, 2500, Treta. Krishna, 2325, Dwapar. Write a function which takes two objects and return the person with more power.
2 |
3 | const persOne = {
4 | name: 'Ram',
5 | power: 2500,
6 | yuga: 'Treta'
7 | }
8 | const persTwo = {
9 | name: 'Krishna',
10 | power: 2325,
11 | yuga: 'Dwapar'
12 | }
13 |
14 | const checkPower = (one, two) =>{
15 | if(one.power> two.power){
16 | return one
17 | }else{
18 | return two
19 | }
20 | }
21 |
22 | const checking = checkPower(persOne, persTwo)
23 |
24 | console.log(`The person ${checking.name}has more power ${checking.power}`)
--------------------------------------------------------------------------------
/interview_q/Q17.js:
--------------------------------------------------------------------------------
1 | // Create two objects with name, power, and yuga as Ram, 2500, Treta. Krishna, 2325, Dwapar. Say if every character in name is worth 35 power points. Write a function which takes two objects and return the person with more power based on their name and power both.
2 |
3 | const persOne = {
4 | name: 'Ram',
5 | power: 2500,
6 | yuga: 'Treta'
7 | }
8 | const persTwo = {
9 | name: 'Krishna',
10 | power: 2325,
11 | yuga: 'Dwapar'
12 | }
13 |
14 | function checkPower(one, two){
15 | var powerOne = Number(one.name.length)*35
16 | var powerTwo = Number(two.name.length)*35
17 | if(powerOne>powerTwo){
18 | return one
19 | }else{
20 | return two
21 | }
22 | }
23 |
24 | const checkingPower = checkPower(persOne, persTwo)
25 |
26 | console.log(`The Person ${checkingPower.name} has more power based on name.`)
--------------------------------------------------------------------------------
/interview_q/Q18.js:
--------------------------------------------------------------------------------
1 | var readlineSync = require('readline-sync')
2 |
3 | // Create a CLI app which would detect fake news.
4 | // This app will take news as input and then source.
5 | // If source is Facebook or whatsapp then it will output user saying,
6 | // // "Don't believe things on FB and Whatsapp". Can you extend this to include telegram as well?
7 |
8 | var news = readlineSync.question("Enter your news \n")
9 | var source = readlineSync.question("Enter your source of news \n")
10 |
11 | if(source.toUpperCase() === 'facebook'.toUpperCase() || source.toUpperCase() === 'whatsapp'.toUpperCase() || source.toUpperCase() === 'telegram'.toUpperCase()){
12 | console.log(`The ${news} is completely fake if they belongs to facebook, telegram, whatsaap`)
13 | }else{
14 | console.log('You can read this news')
15 | }
16 |
--------------------------------------------------------------------------------
/interview_q/Q2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
21 |
22 |
23 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/interview_q/Q3.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
16 |
17 |
18 |
48 |
49 |
--------------------------------------------------------------------------------
/interview_q/Q4.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Document
8 |
9 |
10 |
11 |
neogcamp
12 |
13 |
14 |
15 |
16 |
39 |
40 |
--------------------------------------------------------------------------------
/interview_q/Q5.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
11 |
12 |
13 |
19 |
20 |
21 |
22 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/interview_q/Q6.js:
--------------------------------------------------------------------------------
1 | // Create a CLI app which takes name, unit test marks, pre final marks, final marks of 5 students. And then print who has the highest marks. What if I ask you to print the average as well?
2 |
3 | var readlineSync = require('readline-sync')
4 |
5 | var totalMark = 0;
6 | var highestMark = 0;
7 | var averageMark;
8 | var userName;
9 | var testMark;
10 | var preMark;
11 | var finalMark;
12 |
13 | for(i=0; i<2; i++){
14 | userName = readlineSync.question("Enter your name\n")
15 | testMark = readlineSync.question("Enter your test marks \n")
16 | preMark = readlineSync.question("Enter your pre final marks \n")
17 | finalMark = readlineSync.question("Enter your final marks \n")
18 |
19 | totalMark = totalMark + Number(testMark) + Number(preMark) + Number(finalMark)
20 |
21 | console.log(`Total marks of all students is ${totalMark}`)
22 |
23 | averageMark = totalMark / 2;
24 |
25 | if(totalMark > highestMark){
26 | highestMark = totalMark
27 | }
28 |
29 | }
30 |
31 | var mess = readlineSync.keyInYN(`know average marks of all students and as well as highest marks of the student`)
32 |
33 | if(mess == true){
34 | console.log(`The average marks of all students is ${averageMark} and highest marks of the student is ${highestMark}`)
35 | }else{
36 | console.log('Thank you for playing')
37 | }
--------------------------------------------------------------------------------
/interview_q/Q7.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Document
9 |
10 |
15 |
16 |
17 |
18 |
Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio quod expedita libero eos aperiam iusto tempora voluptas consequuntur minus est quibusdam eaque voluptatibus error, voluptates optio, deleniti rem impedit blanditiis.