Posts

API Design

Day 1: API Fundamentals Simplified  ↳ lnkd.in/e8eMet_k  ↳ lnkd.in/er9JiGxw Day 2: API Methods & Terminologies  ↳ lnkd.in/ey9v7-hU  ↳ lnkd.in/eRsPMzpd Day 3: API Authentication & Status Codes  ↳ lnkd.in/eNPfpAdE  ↳ lnkd.in/egXizUrS Day 4: REST API vs GraphQL + Integration Basics  ↳ lnkd.in/eZHREdgC  ↳ lnkd.in/eDASPP5m Day 5: Deep Dive into API Integration  ↳ lnkd.in/eZwFVrH7  ↳ lnkd.in/e4WGDffA Day 6: API Testing Fundamentals  ↳ lnkd.in/emgmWJqH  ↳ lnkd.in/eCPnGTGi Day 7: Working with APIs in Python  ↳ lnkd.in/eM23ah2y Day 8: API Scaling Essentials  ↳ lnkd.in/e3mZSvmn Day 9: Developing Robust APIs  ↳ lnkd.in/eBXzbFyg Day 10: Hands-on with Postman  ↳ lnkd.in/ezue3d4B Day 11: API Security Deep Dive  ↳ lnkd.in/e79ZYfPa Day 12: Final Project – Combine Everything  ↳ Use all the previous resources to build a complete API project. With just 12 days of focused learning, you’ll have the confidence an...

𝗧𝘆𝗽𝗲𝘀 𝗢𝗳 𝗚𝗮𝗿𝗯𝗮𝗴𝗲 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗼𝗿𝘀 𝗜𝗻 𝗝𝗮𝘃𝗮

 𝗧𝘆𝗽𝗲𝘀 𝗢𝗳 𝗚𝗮𝗿𝗯𝗮𝗴𝗲 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗼𝗿𝘀 𝗜𝗻 𝗝𝗮𝘃𝗮 ======================== There are total 7 types of garbage collectors available in Java. 𝟭) 𝗦𝗲𝗿𝗶𝗮𝗹 𝗚𝗮𝗿𝗯𝗮𝗴𝗲 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗼𝗿 Single thread performs all GC work, application is paused during GC, medium throughput with high pause time, suitable for small applications with limited memory (<100MB) 𝟮) 𝗣𝗮𝗿𝗮𝗹𝗹𝗲𝗹 𝗚𝗮𝗿𝗯𝗮𝗴𝗲 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗼𝗿 Multiple threads share GC work, application is paused during GC but it is minimal as multiple threads collect garbage in parallel, high throughput with medium pause time, suitable for applications with medium to large heap memory (in GBs). 𝟯) 𝗖𝗼𝗻𝗰𝘂𝗿𝗿𝗲𝗻𝘁 𝗠𝗮𝗿𝗸-𝗦𝘄𝗲𝗲𝗽 (𝗖𝗠𝗦) 𝗚𝗮𝗿𝗯𝗮𝗴𝗲 𝗖𝗼𝗹𝗹𝗲𝗰𝘁𝗼𝗿 (𝗗𝗲𝗽𝗿𝗲𝗰𝗮𝘁𝗲𝗱 𝘀𝗶𝗻𝗰𝗲 𝗝𝗮𝘃𝗮 𝟵) Most of GC work is done concurrently with application threads thus reduces pause time further, High throughput with low pause time, suitable for appliactions with medium to large heap me...

Do you know how does 𝙎𝙥𝙧𝙞𝙣𝙜𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣.𝙧𝙪𝙣() work internally?

Image
    The 𝙎𝙥𝙧𝙞𝙣𝙜𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣 class provides a convenient way to bootstrap a Spring application that is started from a main() method. By default, 𝙎𝙥𝙧𝙞𝙣𝙜𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣 class will perform the following steps to bootstrap your application: 1. Creates an 𝙚𝙢𝙥𝙩𝙮 𝙀𝙣𝙫𝙞𝙧𝙤𝙣𝙢𝙚𝙣𝙩 𝙤𝙗𝙟𝙚𝙘𝙩. 2. Find the external configuration file like 𝙖𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣.𝙥𝙧𝙤𝙥𝙚𝙧𝙩𝙞𝙚𝙨 / 𝙖𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣.𝙮𝙢𝙡 from the classpath of the application and load these properties into the environment object. 3. Print 𝙎𝙥𝙧𝙞𝙣𝙜 𝘽𝙖𝙣𝙣𝙚𝙧. 4. Identifies the type of the application by using property 𝙒𝙚𝙗𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣𝙏𝙮𝙥𝙚 and instantiates an appropriate IOC Container. 5. Instantiates the 𝙎𝙥𝙧𝙞𝙣𝙜𝙁𝙖𝙘𝙩𝙤𝙧𝙞𝙚𝙨 and register with IOC Container. 6. Initialise the IOC Container by executing 𝘼𝙥𝙥𝙡𝙞𝙘𝙖𝙩𝙞𝙤𝙣𝘾𝙤𝙣𝙩𝙚𝙭𝙩𝙄𝙣𝙞𝙩𝙞𝙖𝙡𝙞𝙯𝙚𝙧. 7. Prepare the context by 𝙋𝙧𝙚𝙥𝙖𝙧𝙚𝘾𝙤𝙣𝙩𝙚𝙭𝙩. 8. Refresh the context by ...

Coding Problem 7: Techfest and the Queue [GFG - Problem Solving]

  A Techfest is underway, and each participant is given a ticket with a unique number. Organizers decide to award prize points to everyone who has a ticket ID between  a  and  b  ( inclusive ). The points given to a participant with ticket number  x  will be the  sum of powers of the prime factors  of  x . For instance, if points are to be awarded to a participant with ticket number  12 , the amount of points given out will be equal to  the sum of powers in the prime factorization  of  12  ( 2 2  × 3 1 ), which will be  2 + 1 = 3 . Given  a  and  b , determine the sum of all the points that will be awarded to the participants with ticket numbers between  a  and  b  ( inclusive ). Example 1: Input: a = 9 b = 12 Output: 8 Explanation: For 9, prime factorization is:3 2 So, sum of the powers of primes is: 2 For 10, prime factorization is : 2 1 x5 1 So, sum of the powe...

Coding Problem 6: Count possible ways to construct buildings [GFG - Problem Solving]

  There is a road passing through a city with   N   plots on both sides of the road. Plots are arranged in a straight line on either side of the road. Determine the   total number  of ways to construct buildings in these plots, ensuring that no two buildings are adjacent to each other. Specifically, buildings on opposite sides of the road cannot be adjacent. Using  *  to represent a plot and  ||  for the road, the arrangement for  N = 3  can be visualized as follows:  * * * || * *  *. Note:  As the answer can be very large, print it  mod 10 9 +7 . Example 1: Input: N = 1 Output: 4 Explanation: Possible ways for the arrangement are B||*, *||B, B||B, *||* where B represents a building. Example 2: Input: N = 3 Output: 25 Explanation: Possible ways for one side are BSS, BSB, SSS, SBS, SSB where B represents a building and S represents an empty space. Pairing up with possibilities on the other side of the road, total ...

Coding Problem 5: Find element occuring once when all other are present thrice [GFG - Problem Solving]

  Given an array of integers   arr[]   of length   N , every element   appears   thrice  except for one which   occurs   once . Find that element which  occurs   once . Example 1: Input: N = 4 arr[] = {1, 10, 1, 1} Output: 10 Explanation: 10 occurs once in the array while the other element 1 occurs thrice. Example 2: Input: N = 10 arr[] = {3, 2, 1, 34, 34, 1, 2, 34, 2, 1} Output: 3 Explanation: All elements except 3 occurs thrice in the array. Your Task: You do not need to take any input or print anything. You task is to complete the function  singleElement () which takes an array of integers  arr  and an integer  N  which finds and returns the element  occuring once  in the array. Constraints: 1 ≤ N ≤ 10 5 -10 9  ≤ A[i] ≤ 10 9 Expected Time Complexity:  O(N). Expected Auxiliary Space:  O(1). Solution : Repository:  coding-problems:  https://github.com/nileshkadam222/co...

Coding Problem 4: Smallest window containing 0, 1 and 2 [GFG - Problem Solving]

  Given a string   S   consisting of the characters   0 ,   1   and   2 . Your task is to find the length of the   smallest substring  of string   S   that contains all the three characters   0, 1  and   2 . If no such substring exists, then return   -1 . Example 1: Input: S = 10212 Output: 3 Explanation: The substring 102 is the smallest substring that contains the characters 0, 1 and 2. Example 2: Input: S = 12121 Output: -1 Explanation: As the character 0 is not present in the string S, therefor no substring containing all the three characters 0, 1 and 2 exists. Hence, the answer is -1 in this case. Your Task: Complete the function  smallestSubstring()  which takes the string  S  as input, and returns the length of the  smallest substring  of string S that contains all the three characters  0, 1  and  2. Expected Time Complexity:  O( length( S ) ) Expecte...