Interview questions

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Tell me about exceptions and null pointer exceptions.

- (Application Programming Interface) - request is a way for one software component to communicate with another. - It involves sending a request, usually over HTTP, to an API endpoint, and receiving a response. - Common HTTP methods include GET, POST, PUT, and DELETE.

What's an interface?

- An interface in programming defines a contract for the structure of an object. - It doesn't provide any implementation but enforces a set of rules.

What is CSS, and what do you do when you want to organize elements horizontally (flexbox)?

- Cascading Style Sheet. - It is what gives the front in websites its appearance - display: flex;

How would you go about setting up a database?

- Choose a database (e.g., MySQL). - Add the corresponding dependency (e.g., mysql-connector-java). - Configure database connection in application.properties. - Define JPA entity classes (e.g., User). - Create a repository interface (e.g., UserRepository) extending JpaRepository. - Implement service layer (e.g., UserService) for business logic.

What do you know about scripting (bash)?

Bash is a command-line shell used in Unix-like operating systems. It allows scripting to automate tasks, and it's powerful for system administration. - Common bash commands: + ls: list files and directories + cd: change directory + pwd: print working directory + mkdir: make directory

React vs Angular

Both are popular frontend frameworks. - React is a library for building UIs, while Angular is a comprehensive framework with built-in tools.

Tell me about yourself?

Common first question. Answer: talk about your work background, skills, and interests and relate them to how well they fit the job.

How do you create a REST API?

Define requirements: Understand resource endpoints and operations. Choose tech stack: Pick Spring Boot (Java) for simplicity. Design API: Plan URL structure and request/response format. Project structure: Organize code into controllers, services, and models. CRUD operations: Code endpoints for Create, Read, Update, Delete.

Have you worked with any cloud platforms (AWS, Azure, GCP)?

I have done a little experimenting with AWS but very little knowledge as of right now.

How do you set up a primary key that automatically iterates?

In postgresql you would use the keyword Serial. Create Table employees { employee_id Serial Primary Key.

How good are you at learning new programming languages? Can you give an example of a time you learned a new programming language?

Java

What do you know about Java?

Java is a versatile, object-oriented programming language known for its platform independence and wide usage in various domains, from web development to enterprise applications.

What is the most important features of a database

Key features include data integrity, data security, efficient querying, scalability, and ACID properties (Atomicity, Consistency, Isolation, Durability).

What is SQL?

SQL (Structured Query Language) is a domain-specific language used for managing and manipulating relational databases. It's used to query and update data, define and modify the structure of databases.

Can you talk about a time when you had to learn something new to complete a task in a given amount of time?

She-strong.com, Insurance calculator

What was your last project and what did you do?

Shes Strong

Write code that would give a null pointer exception.

String str = null; try { if (str.equals("Hello")) { system.out.print(str); } } catch (NullPointerException e) { System.out.println("Caught a null pointer exception!"); }

Write an arrow function that returns the square root of an input.

const squareRoot = (num) => return Math.sqrt(num);

Write a function in JavaScript or TypeScript.

const sum = (a , b) => { return a+b; } // function Sum(a, b){ return a + b; }

How confident are you in Java, Angular/React, SQL?

- Create a Spring Boot Project: + Use Spring Initializr or your preferred IDE to create a new Spring Boot project. - Define Entity Classes: + Design and create Java classes to represent the entities in your system. Annotate them with @Entity for JPA integration. - Create a Repository: + Develop a repository interface extending JpaRepository to interact with the database. - Implement Service Layer: + Build service classes to handle business logic, utilizing the repository for data access. - Controller Setup: + Create controllers with @RestController annotation to handle incoming HTTP requests. - Define API Endpoints: + Use annotations like @GetMapping, @PostMapping, etc., to map methods to specific HTTP endpoints. - Request and Response Mapping: + Implement request and response mapping using @RequestBody and @ResponseBody annotations. - Exception Handling: + Implement global exception handling using @ControllerAdvice to ensure consistent error responses. - DTOs (Data Transfer Objects): + Use DTOs to define the structure of data exchanged between the client and the API. - Testing: + Write unit and integration tests using tools like JUnit and Mockito. + Run and Deploy: Run the Spring Boot application and deploy the API. Consider using tools like Docker for containerization.

How do you set up a REST API in Spring Boot?

- Create a project using Spring Initializr with "Spring Web" dependency. - Design your model class (e.g., User). - Create a controller with @RestController and define endpoints with @RequestMapping. - Implement CRUD operations in the controller. - Run the application, and your REST API is ready at the specified endpoints.

What do you know about data structures and algorithms?

- Data structures are specialized formats for organizing and storing data efficiently, such as arrays, linked lists, and trees. -Algorithms are step-by-step procedures or formulas to solve problems, including sorting, searching, and dynamic programming. They are essential for efficient coding and problem-solving in computer science.

How would you handle a null pointer exception?

- Exceptions are events that occur during the execution of a program that disrupts the normal flow of instructions. - Null Pointer Exception occurs when you try to access or call a method on an object that is null. I would use a try catch block

What frontend technologies do you know?

- HTML - CSS - Javascript - React Js -Tailwind CSS - I have use Vite - Bootstrap

You push code, a user finds a bug, what do you do?

- I would communicate with the user and replicate the bug. - Finding out how it came about to then be able to go into the code and resolve where the issue is coming. - Then write a unit test for that bug knowing it will fail and then go and write the code to resolve it.

If you had a database with a million records of employees and had a query to select employees with the name Jacob, how would you do it faster? (Indexing )

- Indexing is a common technique to optimize database queries. - by providing a quick reference to specific data - In the scenario you described, creating an index on the "name" column would significantly speed up the query for employees with the name Jacob. - CREATE INDEX idx_name ON employees(name);

What's the difference between JavaScript and TypeScript?

- JavaScript is a dynamically-typed scripting language, while - TypeScript is a superset of JavaScript that adds static typing.

What are your programming strengths?

- Learning new programming languages and tools. - Problem solving

What tech stack are you interested in?

- MERN stack - Java Spring boot with angular and postgres

What is a promise, and what is it used for?

A promise is an object representing the eventual completion or failure of an asynchronous operation.

What's your favorite part of OOP?

Abstraction.

What's the difference between an interface and a class.

An interface defines a contract, and a class implements it. An interface cannot have implementation details, while a class can.


Kaugnay na mga set ng pag-aaral

Managing people ch 8: values and attitudes

View Set

Biology Chapter 40 and 41 questions and vocab

View Set

Nursing 317: Maternal Adaptation During Pregnancy (NCLEX Questions and Review)

View Set

MedSurg EXAM 1: Dysrhythmias, PERI-OP

View Set

2年 CE-2 Lesson1(What's in your name?) part1

View Set

Ap Government: Unit 7 Judicial Branch

View Set