Professional Documents
Culture Documents
Good study habits include finding a quiet location to study, taking breaks,
settings goals, and taking practice tests.
Here's the full list, and the psychological reasons why they work.
Studying can be hard. The good news is that anybody can develop good study habits
to make studying more effective, efficient, and enjoyable.
How to Learn:
Powerful mental tools to help you master tough subjects.
You’ll learn the psychology behind procrastination and memory, plus many ways to
help you get the most out of your study time.
2. Minimize distractions.
Picking a good location to study can be the first step in keeping yourself focused
on your work.
But there are many types of distractions that can reach you no matter where you
choose to work.
Here are some tips on minimizing these distractions:.Turn off your wifi:
If you’re working on a computer and you don’t need your wifi, try turning it off.
This can keep you from inadvertently wandering into the distracting parts of the
internet.
4.Be mindful of your phone: It’s no secret that our smartphones can be hugely
distracting.
Turning off your notifications, keeping your phone out of sight in your bag, or
giving it to a friend to keep you from checking it too often can help you stay
focused. You might also try a focus app, like Forest or Focus To-Do, that can block
distracting apps and set timers for study sessions.
3. Take breaks.
Taking intentional breaks has been linked to better retention, increased attention,
and boosts in energy.
Research shows that working for around 50 minutes, then giving yourself a 15- to
20-minute break, can lead to optimum productivity .
Here are a few ways you can give yourself a break:
Instead of saving your studying for before a test, briefly review material you
learned once a week. If you are studying for an exam, space out your studying up to
several weeks (or even months, depending on the test) leading up to the exam day.
This can help you retain the information long term.
Work Smarter, Not Harder: Time Management for Personal & Professional Productivity
You will be able to gain and apply your knowledge and understanding of personal and
professional awareness, organization and commitment, and use the tools,
Skills you'll build:Task Management, Management, Planning, Plan
6. Reward yourself.
Rewarding yourself with treats—“bribing” yourself—has been linked to better self-
control, and can be helpful in forming good habits .
Telling yourself you’ll get a small reward if you finish the section you wanted to
get through, or perhaps a larger reward if you have a productive day of studying,
can be good motivation to get to your goal.
Small rewards can be a candy bar, a hot drink from your favorite coffee shop, a
quick game of your choice, or a short episode of a TV show.
Bigger rewards for a long day of studying or getting done with an exam can include
getting your favorite meal, spending some time relaxing with friends, or making
time for your favorite activity.
1.Create flashcards
2.Write your own questions
3.Search for practice questions online
Mindshift is designed to help boost your career and life in today’s fast-paced
learning environment.
Whatever your age or stage, Mindshift teaches you ...Skills you'll build:Learning
To Learn, Lifelong Learning, Pomodoro Technique, Meta Learning
Around the world, we find ourselves facing global epidemics of obesity, Type 2
Diabetes and other predominantly diet-related diseases. To address these ...
Skills you'll build:
Exercise: Exercise brings oxygen to the part of your brain responsible for thought,
encourages the development of new nerve cells, and boosts brain cell connections.
This makes for brains that are more neuroplastic and efficient—plus it brings a
host of other health benefits, like lower blood pressure, reduced mental stress,
and weight control.
Mental wellness: Mental health is important because it helps us deal with stress,
improves our relationships with others, allows us to live more meaningfully, and be
more productive in our work. Exercising, eating well, and getting good sleep can
each boost our mental health. But there are other ways of fortifying mental
strength, such as connecting with others, practicing gratitude, meditating, and
developing a sense of meaning in life [9].
Full-Stack Developer Interview Questions Java
Full-stack developers are skilled programmers who can work with both the front-end
and back end of a website and applications.
They are responsible for developing and designing front/ back ends web
architecture, server-side applications, design databases, server-side applications,
and much more.Full-Stack Developer Interview Questions Java
Q.2) What are MVC and MVP and how MVC is different from MVP?
MVC and MVP both are architectural patterns that are used to develop applications.
The model components contain data and logic related to it. The View component is
responsible for displaying model objects inside the user interface.
The Controller receives the input and calls model objects based on handler mapping.
It also passes model objects to views in order to display output inside the view
layer.
MVP:
MVP stands for Model View Presenter. It is derived from the MVC architectural
pattern.
It adds an extra layer (known as indirection) to the architectural pattern that
splits the View and Controller into View and Presenter.
The role of Controller is replaced with a Presenter.
It exists at the same level as View in MVC. It contains UI business logic for the
View.
The invocations received from the View directly sends to the Presenter. It
maintains the action (events) between View and Model.
The Presenter does not directly communicate with the View. It communicates through
an interface.
The major difference between MVC and MVP architectural pattern is that in MVC
architectural pattern Controller does not pass the data from the Model to the View.
It only notifies the View to get the data from the Model itself.
While in MVP architectural pattern the View and Model layers are connected with
each other.
The presenter itself receives the data from the Model and sends it to the View to
show.
Another difference is that MVC is often used in web-frameworks while MVP is used in
app development.
It supports secure cross-origin requests and transfers data between servers and
browsers. Advanced browsers use CORS in APIs.
It is flexible and safe in comparison to JSONP (JSON with Padding). It provides
better web service integration.
While using the MVC to enable CORS, the same CORS service can be used but we cannot
use the same CORS middleware.
We can use a particular CORS for a particular action, for a particular controller,
and globally for all controllers.
A pre-flight check (or request) is sent by the browser to the server which ensures
that the server will permit the actual request or not.
For example, invoking the URL https://example.com through https://demo.com.
Q.14 Explain semantic HTML with an example and why we should use it?
In web design, the idea of using HTML elements to indicate what they actually
are.It is known as semantic HTML or semantic markup.
Semantic HTML is HTML that represents meaning to the web page rather than just
presentation.
For example, tag <p> indicates that a paragraph is enclosed in it.
It is both semantic and presentational because the user know what paragraph are
and the browser also know how to display them.
On the other hand, tags such as <b> and <i> are not semantic.
They only represent how text should look. These tags do not provide any additional
meaning to the markup.
Example of semantic HTML tags are header tags <h1> to <h6>, <abbr>, <cite>, <tt>,
<code>, <blockquote>, <em>, etc.
There are some other semantic HTML tags that are used to build a standards-
compliant website.
We should use the semantic HTML for the following reasons:
It provides additional information about the document in which it is used. It also
aids in communication.
Semantic tags make it clear to the browser what the meaning of a page and its
content is.
It provides information about the contents of those tags that goes beyond just how
they look on a page.
It gives us many more hooks for styling the content of the page.
The clarity of semantic tag is also communicated with search engines that ensure
the right pages are delivered for the right queries.
2.Undefined: Undefined means the variable is declared but not assigned any value to
it. It may be a variable itself does not exist.
If we use it with typeof operator it gives the result undefined. It is not valid in
JSON.
Note: Null and undefined both are primitive.Let's understand it through an example.
var var1
var var2 = null //assigning null value to the variable var2
console.log(`var1 : ${var1}, type : ${typeof(var1)}`)
console.log(`var2 : ${var2}, type : ${typeof(var2)}`)
When we execute the above code, it generates the following output:
16) What are the key differences between GraphQL and REST?
Both, REST and GraphQL, are API design architectures that can be used to develop
web services, especially for data-driven applications.
GraphQL REST
GraphQL is an API design architecture, but with a different approach that is much
flexible.
REST is a robust methodology and API design architecture used to implement web
services.
It follows client-driven architecture. It follows server-driven architecture.
It does not deal with the dedicated resources. It deals with the dedicated
resources.
It has a single endpoint that takes dynamic parameters. It has multiple
endpoints.
It provides stateless servers and structured access to resources.
It provides stateless servers and flexible controlled access to resources.
It is elastic in nature. It is not rigid in nature.
It supports only JSON format. It supports XML, JSON, HTML, YAML, and other formats
also.
The client defines response data that it needs via a query language. Data
represented as resources over HTTP through URI.
It provides synchronous and asynchronous communication in multiple protocols such
as HTTP, MQTT, AMQP. It provides synchronous communication through HTTP only.
Its design based on HTTP (status, methods, and URI). Its design based on message
exchange.
It provides high consistency across all platforms. It is difficult to achieve
high consistency across all platforms.
Development speed is fast. Development speed is slow.
17) Compare fail-fast and fail-safe iterators?
Basis of Comparison Fail Fast Iterator Fail Safe Iterator
Operates It operates directly on the collection itself. It operates on a cloned
copy of the collection.
Exception It throws a ConcurrentModificationException in modifying the object
during the iteration process. It does not throw Exception.
Clone Object No clone object is created during the iteration process. A copy
or clone object is created during the iteration process.
Memory utilization It requires low memory during the process. It requires
more memory during the process.
Modification It does not allow modification during iteration. It allows
modification during the iteration process.
Performance It is fast. It is slightly slower than Fail Fast.
Examples HashMap, ArrayList, Vector, HashSet, etc. CopyOnWriteArrayList,
ConcurrentHashMap, etc.
18) What is a connection leak in Java and how can we fix it?
In Java, a connection leak is a situation when the developer forgets to close the
JDBC connection, it is known as connection leak.
The most common type of Connection Leak experienced in Java development, is when
using a Connection Pool .
We can fix it by closing the connection and giving special attention to the error
handling code.
23) How many ways to handle exceptions in the Spring MVC Framework?
Spring MVC Framework provides the following ways to handle exceptions:
The first curly brace represents the creation of an anonymous inner class. .
Remember that the second curly brace will not be considered in such a case. It is
just like creating an anonymous inner class.
The second curly brace represents an initialization block that we have seen in it
as a class for initialization.
When we use the initialization block for an anonymous inner class it becomes Java
double brace initialization.
The inner class has a reference to the enclosing outer class. We can use the
reference by using this pointer.
It is used to initialize collections because it is easier to initialize a constant
collection using double brace initialization.
5.Lock Time-out: We can also specify the time for a thread to acquire a lock.
If a thread does not acquire a lock, the thread must wait for a specific time
before retrying to acquire a lock.
8) What is the difference between the local variable and global variable in C?
Following are the differences between a local variable and global variable:
Basis for comparison Local variable
Global variable
Declaration A variable which is declared inside function or block is known
as a local variable. A variable which is declared outside function or
block is known as a global variable.
Scope The scope of a variable is withina function in which they are declared.
The scope of a variable is available throughout the program.
Access Variables can be accessed only by those statements inside a function in
which declared Any statement in the entire program can access variables.
Life Life of a variable is created when the function block is entered and
destroyed . Life of a variable exists until the program is executing.
Storage Variables are stored in a stack unless specified. The compiler
decides the storage location of a variable.
11) What is the difference between call by value and call by reference in C?
Following are the differences between a call by value and call by reference are:
Call by value
Call by reference
Description When a copy of the value is passed to the function, then the original
value is not modified. When a copy of the value is passed to the
function, then the original value is modified.
Memory location Actual arguments and formal arguments are created in separate
memory locations. Actual arguments and formal arguments are
created in the same memory location.
Safety In this case, actual arguments remain safe as they cannot be
modified.In this case, actual arguments are not reliable, as they are modified.
Arguments The copies of the actual arguments are passed to the formal arguments.
The addresses of actual arguments are passed to their respective formal arguments.
Value of a is: 13
Value of b is: 17
Example of recursion
#include <stdio.h>
int calculate_fact(int);
int main()
{
int n=5,f;
f=calculate_fact(n); // calling a function
printf("factorial of a number is %d",f);
return 0;
}
int calculate_fact(int a)
{
if(a==1)
{
return 1;
}
else
return a*calculate_fact(a-1); //calling a function recursively.
}
Output:
1 2 3 4 5
.
14) What is a pointer in C?
A pointer is a variable that refers to the address of a value. It makes the code
optimized and makes the performance fast.
Whenever a variable is declared inside a program, then the system allocates some
memory to a variable. The memory contains some address number.
The variables that hold this address number is known as the pointer variable.
For example:
Data_type *p;
The above syntax tells that p is a pointer variable that holds the address number
of a given data type value.
Example of pointer
#include <stdio.h>
int main()
{
int *p; //pointer of type integer.
int a=5;
p=&a;
printf("Address value of 'a' variable is %u",p);
return 0;
}
Output:Address value of 'a' variable is 428781252
#include<stdio.h>
void main()
{
int *ptr = malloc(constant value); //allocating a memory space.
free(ptr); //ptr becomes a dangling pointer.
ptr=NULL; //Now, ptr is no longer a dangling pointer.
}
In the above example, after deallocating the memory from a pointer variable, ptr is
assigned to a NULL value.
This means that ptr does not point to any memory location. Therefore, it is no
longer a dangling pointer.
#include <stdio.h>
int main()
{
int a=10;
int *ptr,**pptr; // *ptr is a pointer and **pptr is a double pointer.
ptr=&a;
pptr=&ptr;
printf("value of a is:%d",a);
printf("\n");
printf("value of *ptr is : %d",*ptr);
printf("\n");
printf("value of **pptr is : %d",**pptr);
return 0;
}
In the above example, pptr is a double pointer pointing to the address of the ptr
variable and ptr points to the address of 'a' variable.
22) What functions are used for dynamic memory allocation in C language?
1.malloc():-The malloc() function is used to allocate the memory during the
execution of the program.
It does not initialize the memory but carries the garbage value.
It returns a null pointer if it could not be able to allocate the requested space.
Syntax:- ptr = (cast-type*) malloc(byte-size) // allocating the memory using
malloc() function.
2.calloc()
The calloc() is same as malloc() function, but the difference only is that it
initializes the memory with zero value.
Syntax:ptr = (cast-type*)calloc(n, element-size);// allocating the memory using
calloc() function.
realloc()
3.The realloc() function is used to reallocate the memory to the new size.
If sufficient space is not available in the memory, then the new block is allocated
to accommodate the existing data.
Syntax:- ptr = realloc(ptr, newsize); // updating the memory size using realloc()
function. ptr is allocated to a new size.
#include<stdio.h>
union data
{
int a; //union members declaration.
float b;
char ch;
};
int main()
{
union data d; //union variable.
d.a=3;
d.b=5.6;
d.ch='a';
printf("value of a is %d",d.a);
printf("\n");
printf("value of b is %f",d.b);
printf("\n");
printf("value of ch is %c",d.ch);
return 0;
}
In the above example, the value of a and b gets corrupted, and only variable ch
shows the actual output.
This is because all the members of a union share the common memory space. Hence,
the variable ch whose value is currently updated.
But, if we use #define, we can compile and run a C program without using the main()
function. For example:
#include<stdio.h>
#define start main
void start() {
printf("Hello");
}
More details.
char ch;
printf("Enter a character ");
ch=getch(); // taking an user input without printing the value.
printf("\nvalue of ch is %c",ch);
printf("\nEnter a character again ");
ch=getche(); // taking an user input and then displaying it on the screen.
printf("\nvalue of ch is %c",ch);
return 0;
}
Output:
Enter a character
value of ch is a
Enter a character again a
value of ch is a
In the above example, the value entered through a getch() function is not displayed
on the screen while the value entered through a getche() function is displayed on
the screen.
34) Who is the main contributor in designing the C language after Dennis Ritchie?
Brain Kernighan.
35) What is the difference between near, far and huge pointers?
A virtual address is composed of the selector and offset.
A near pointer doesn't have explicit selector whereas far, and huge pointers have
explicit selector.
When you perform pointer arithmetic on the far pointer, the selector is not
modified, but in case of a huge pointer, it can be modified.
These are the non-standard keywords and implementation specific. These are
irrelevant in a modern platform.
38) What are the functions to open and close the file in C language?
The fopen() function is used to open file whereas fclose() is used to close file.
42) Write a program to swap two numbers without using the third variable?
#include<stdio.h>
#include<conio.h>
main()
{
int a=10, b=20; //declaration of variables.
clrscr(); //It clears the screen.
printf("Before swap a=%d b=%d",a,b);
a=a+b;//a=30 (10+20)
b=a-b;//b=10 (30-20)
a=a-b;//a=20 (30-10)
for(i=1;i<=number;i++){
fact=fact*i;
}
printf("Factorial of %d is: %d",number,fact);
getch();
}