Posts

Use ChatGPT for improve your coding quality

Image
Hi, This is  Shubham Mishra  from India,   In this post we will discuss about how to Use ChatGPT for improve your coding quality and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started... When first time i asked ChatGpt to write some script for me, I asked "Write a shell script to open multiple chrome windows with some url's", it was to my surprise that ChatGPT not only wrote the script it also tried to explain every line of code, you can check the script here : Shell script to open multiple chrome windows , so then onwards not only for writing script but also for reviewing some of my work related code I ask ChatGPT to review and rewrite me optimised code too. How can Chat GPT provide some general tips and best practices that developers can follow to write good code: 1. Follow coding standards and best practices: Consistency is key when it comes to writing good code. Follow established coding standards and bes

Amazon Interview question from leetcode coding problem 1

Hi, This is  Shubham Mishra  from India,  this is the part of  Ruby on Rails  exploration journey.  In this post we will discuss about the leetcode problem and its both worst and best case solution asked in Amazon interview process and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started... Problem Statement: Return the indices of the two numbers such that they add up to target given an array of integers nums and an integer target. You may presume that each input would have exactly one solution, and you may not use the same element twice. The input array nums can be assumed to not be sorted, but you are free to return the solution in any order. Example: Input: nums = [2,7,11,15], target = 9 Output: [0,1] Explanation: nums[0] + nums[1] = 2 + 7 = 9, so [0, 1] is the correct answer. Here is the function signature in Python to help you get started: The problem is to find two indices in an array of integers nums whose cor

Shell script to open multiple chrome windows with auto close command

Hi, This is  Shubham Mishra  from India,  this is the part of  Ruby on Rails  exploration journey.  In this post we will discuss about the shell script code to open multiple chrome windows and I am sure you will get excited to make your hands dirty with those code, so why to wait let's get started... In this blog we will going to write a shell script to open N number of url's in a new Chrome incognito windows. Some times we want to test load on our websites or want to increase the view count of our youtube videos then we need some automations, here the actual requst is : "Write a shell script for opening new incognito window of chrome from list of urls in random manner, and also keep random sleep time between 1 minute to 10 minute for next iteration and also close the opened window after 3 minutes" This is how the script functions: 1. Set the URL list to open. 2. cycle over each URL. 3. Set a random sleep period of between one and ten minutes. 4. Use the goog

Max Heap Create and Sorting

Image
Hi, this is Shubham Mishra. I write blogs on algorithms and new technologies. In today's blog, we will going to cover the max heap topic. Now before actually looking the code lets understand the max heap tree. A complete binary tree is a tree in which every levels are completely filled except the lowest one, which is filled from the left. And A max heap is a complete binary tree and the root node always have the max value of the tree, hence the name is max heap. Now with this max heap tree is have one more important property, the value of a node is always greater than or equal to the all chindren nodes. Confused, let me explain with a diagram: As can be seen in above tree, this is complete binary tree, since nodes are entered in such as way that all of the in between nodes are have 2 childrens. And any node's value is any time greater than all the children nodes. Take 6, it is greater than all the child nodes (5 -> 4, 2 And 3 -> 1). Similar to this 5 is greater than

Basics of IP address - What is IP address

Hi, This is  Shubham Mishra  a ROR, iOS, Python developer,  this is the part of  Computer science  exploration journey.  In this post we will discuss about the IP address and some theoretical concepts of IP address. The "IP" aspect of the IP address corresponds to "Internet Protocol." The "mail" part refers to a specific number that is connected to all the internet interaction you are doing ... something like a return address to a letter that you might send. (The entire thing happens in milliseconds.) Before starting with the definition, I would give you a simple explanation for the IP Address, Let's assume you are looking for your friends address to visit him on this weekend. Then on a call you asked your friend for his home address, he replied: Nation: India State: Maharashtra City: Mumbai Pincode: 400001 Plot: ABC Residency As you can see, I can represent above address as, india.maharashtra.mumbai.400001.ABCResidency Noticed something, yes this stru

Puzzles for the interview which every one should read once

Hi, This is  Shubham Mishra  a ROR, iOS, Python developer,  this is the part of  Algorithm analysis  exploration journey.  In this post we will discuss about the Awesome puzzles that may be asked in the interview process, whether it may be for any position or the role. Even if not for the interview but still you will enjoy to solve the below puzzles. The opportunity to bring unique insight to solving business issues will give you an immense advantage over other applicants. Only with daily practice and continuous effort can these capacities be established. For me it's like intellectual training for solve puzzles. I do it on a regular basis, and have progressed equally over time. I 'm sharing some of the trickiest & head scratching questions I've experienced in my journey to help you attain the ability. Such questions were aimed at organisations such as Goldman Sachs, Amazon , Facebook, JP Morgan etc. The Bus Chaos Chaos in the bus. There is a bus with 100 seats numbered

iOS Interview preparation : iOS general topics for interview

Image
Hi, This is  Shubham Mishra  a ROR, iOS, Python developer. In this blog we will see top iOS general topics discussion. In the dynamic world we should be updated so as to compete with others hence I have discussed below topics based on my and others interview experience. You can check my post for iOS interview questions set also,  iOS interview questions Page 1 Let's Begin the discussion with some of the famous but very general topics in the field of iOS, which every iOS developer must be aware of. Note: In this post I have discussed the iOS topics in the reference for the interview questions, do not refer if you are looking for the exact code for the implementation. Read below discussion if your are preparing for the iOS interview questions, and want to brush up the general concepts in iOS.   Passing data between the view controllers: Many of the time we come across a situation to pass data between the two view-controllers. In this we may have solve the problem with a way but have

Top interview questions for iOS developer for Objective-C and Swift Page 3

Image
Hi, This is  Shubham Mishra  a ROR, iOS, Python developer. In this blog we will see top iOS interview questions. In the dynamic world we should be updated so as to compete with others hence I have listed below top interview questions based on my and others interview experience. You can check my previous post  iOS interview questions page 2  for more iOS interview questions set. Let's Begin.... Designed by slidesgo / Freepik Q : Explain the Facade Design Pattern? A : The design pattern on the Facade provides a complex subsystem with a single interface. Instead of exposing the user to a collection of classes and their APIs, only one single unified API is exposed to that. Q : Explain the Decorator Design Pattern? A : The pattern decorator dynamically adds behaviours and obligations to an object without altering its code. It is an alternative to sub classifying where you change the actions of a class by wrapping it in with a specific entity. Two very common implementations of this patt

Top interview questions for iOS developer Page 2

Image
Hi, This is  Shubham Mishra  a ROR, iOS, Python developer. In this blog we will see top iOS interview questions. In the dynamic world we should be updated so as to compete with others hence I have listed below top interview questions based on my and others interview experience. This is the another sets of questions and answers, you can check my previous post,  iOS interview questions Page 1 Let's Begin.... Designed by slidesgo / Freepik Q : What do you mean by Dynamic Dispatch? A : The dynamic dispatch method is the selection mechanism for which implementation technique or function of a polymorphic operation to call at runtime. Which means invoking our methods like object method when we want to. But Swift is not dynamic dispatch by default. Q : What do you mean by Code Coverage? A : Code coverage is a measure which helps us calculate unit test values. Q : Explain Completion Handler? A : When our app is making an API call, completion handlers are super handy, and we need to do somet