Paycom Interview Questions All Answers Correct
Paycom Interview Questions All Answers Correct What is a dynamic ip address and a static ip address? - Difference between static and dynamic IPs. When a device is assigned a static IP address, the address does not change. Most devices use dynamic IP addresses, which are assigned by the network when they connect and change over time - A dynamic IP address is an IP address that's automatically assigned to each connection, or node, of a network, like your smartphone, desktop PC, wireless tablet... whatever. This automatic assignment of IP addresses is done by what's called a DHCP server. A DHCP server assigned IP address is called dynamic because it will often be different on future connections to the network. The "opposite" of a dynamic IP address is called a static IP address (one that was configured manually) Group by clause in SQL? The GROUP BY statement is often used with aggregate functions (COUNT, MAX, MIN, SUM, AVG) to group the result-set by one or more columns. SELECT column_name(s) FROM table_name WHERE condition GROUP BY column_name(s) ORDER BY column_name(s); Ex: The following SQL statement lists the number of customers in each country: SELECT COUNT(CustomerID), Country FROM Customers GROUP BY Country; SQL Joins A JOIN clause is used to combine rows from two or more tables, based on a related column between them. Here are the different types of the JOINs in SQL: (INNER) JOIN: Returns records that have matching values in both tables LEFT (OUTER) JOIN: Return all records from the left table, and the matched records from the right table RIGHT (OUTER) JOIN: Return all records from the right table, and the matched records from the left table FULL (OUTER) JOIN: Return all records when there is a match in either left or right table SQL INNER JOIN Keyword The INNER JOIN keyword selects records that have matching values in both tables. SELECT column_name(s) FROM table1 INNER JOIN table2 ON n_name = n_name; Ex: SELECT Orders.OrderID, Customers.CustomerName FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID; SQL LEFT JOIN The LEFT JOIN keyword returns all records from the left table (table1), and the matched records from the right table (table2). The result is NULL from the right side, if there is no match. SELECT column_name(s) FROM table1 LEFT JOIN table2 ON n_name = n_name; The following SQL statement will select all customers, and any orders they might have: SELECT Customers.CustomerName, Orders.OrderID FROM Customers LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID ORDER BY Customers.CustomerName; SQL RIGHT JOIN The RIGHT JOIN keyword returns all records from the right table (table2), and the matched records from the left table (table1). The result is NULL from the left side, when there is no match. SELECT column_name(s) FROM table1 RIGHT JOIN table2 ON n_name = n_name; The following SQL statement will return all employees, and any orders they might have have placed: SELECT Orders.OrderID, Employees.LastName, Employees.FirstName FROM Orders RIGHT JOIN Employees ON Orders.EmployeeID = Employees.EmployeeID ORDER BY Employees.LastName SQL FULL OUTER JOIN The FULL OUTER JOIN keyword return all records when there is a match in either left (table1) or right (table2) table records. SELECT column_name(s) FROM table1 FULL OUTER JOIN table2 ON n_name = n_name; SELECT Customers.CustomerName, Orders.OrderID FROM Customers FULL OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID ORDER BY Customers.CustomerName; SQL Self JOIN A self JOIN is a regular join, but the table is joined with itself. SELECT column_name(s) FROM table1 T1, table1 T2 WHERE condition; SELECT A.CustomerName AS CustomerName1, B.CustomerName AS CustomerName2, A.City FROM Customers A, Customers B WHERE A.CustomerID B.CustomerID AND A.City = B.City ORDER BY A.City; Palindrome of a string - A string is said to be palindrome if reverse of the string is same as string. For example, "abba" is palindrome, but "abbc" is not palindrome. 1) Find length of str. Let length be n. 2) Initialize low and high indexes as 0 and n-1 respectively. 3) Do following while low index 'l' is smaller than high index 'h'. .....a) If str[l] is not same as str[h], then return false. .....b) Increment l and decrement h, i.e., do l++ and h-. 4) If we reach here, it means we didn't find a mis SOLID Design principles The SOLID principles of Object Oriented Design include these five principles: SRP - Single Responsibility Principle.: a class should have only a single responsibility (i.e. changes to only one part of the software's specification should be able to affect the specification of the class). OCP - Open/Closed Principle: software entities ... should be open for extension, but closed for modification LSP - Liskov Substitution Principle.: objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program. ISP - Interface Segregation Principle: many client-specific interfaces are better than one general-purpose
Document information
- Uploaded on
- March 12, 2024
- Number of pages
- 13
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers