Posts

Collections in Java

  HashMap: -------- hashCode() method is used to get the hash code of the object. In HashMap, hashCode() is used to calculate the bucket. Bucket - used to store nodes. 2 or more nodes can have same bucket. Those nodes are linked via linked list. index of bucket = hashCode(key) & (n-1) n=size of bucket array HashMap hm = new HashMap(); hm.put("a",1); First, hashCode of key 'a' is calculated and then the index of bucket array. Second, the details of element is stored as a linked list. {   int hash = 115   Key key = {"saurabh"}   Integer value = 30   Node next = null } Third, in case of same index the new element is saved as an linked list with address saved on next variable of first element. Collection: ---------- 1. Iterable Interface: Root interface of all collection class. it contains only one abstract method i.e., Iterator<T> iterator() 2. Collection Interface : implemented by all class in collection framework. Declares the method that ev...

Cache

Image
Accessing data concurrently may lead to issues! It means that two different threads are trying to read and write the same variable at the same time. This is called a race condition. Who is responsible for the CPU sharing? A special element called a scheduler. There are three reasons for the scheduler to pause a thread: • The CPU should be shared equally among threads • The thread is waiting for some more data • The thread is waiting for another thread to do something Synchronization: Prevents a block of code to be executed by more than one thread at the same time. All shared variables should be accessed in a synchronized or a volatile way. Cache: The minimize unit in CPU’ cache’ is a cache line (for nowadays, a common size of cache line in CPU is 64 byte). Thus when CPU read a variable from memory, it would read all variables nearby that variable.    When core1 read variable a from memory, it would put variable b into cache at the same time. if one variable has existed i...

Interview Questions for QA/SDET

 Test Plan - Test Strategy ? How to test what to test  Test Approach ? API testing > JMeter/ POST , SQL queries  Scenarios - real time like Paytm , Amazon  Review - method >  Estimation technique  > Planning poker  > WBS - work breakdown structure  > T-shirt sizing  Agile methodology  > Agile ceremonies  > RCA technique    - Fish bone    - Prato chart / 80-20 rule    - 5Y method  Risk  > types of risk > how to calculate risk  Mitigation plan and contingency plan Best practices of framework  How you decide feasibility of automation tools  How you start automation  Oops  Collection – list, hash map, tree set,  How you share your project health ? QA health check  . Burn down chart   KPI’s  o Defect density  o Defect removal efficiency  o Defect leakage  o Velocity   JiRA dashboard > Covera...

OAuth working with eg

 Authorization: OAuth is an open-standard authorization protocol or framework that provides applications the ability for “secure designated access.” like taleo uses linkedin to fetch user's details. SAML (Security Assertion Markup Language) is an alternative federated authentication standard that many enterprises use for Single-Sign On (SSO). SAML enables enterprises to monitor who has access to corporate resources. Diff b/w OAuth and SAML: SAML uses XML to pass messages, and OAuth uses JSON. OAuth provides a simpler mobile experience, while SAML is geared towards enterprise security. OAuth uses API calls extensively and SAML drops a session cookie in a browser that allows a user to access certain web pages. OAuth working with eg: Taleo(Customer) - LinkedIn(Service Provider) 1. Taleo asks for REQUEST TOKEN. 2. LinkedIn provides the request token and SECRET. The secret is used to prevent request forgery.  The consumer uses the secret  to sign each request so that the servi...

3 of Agile

Image
  3 Roles: 1. Product Owner: Person responsible for defining the features that are needed in the product. 2. Scrum Master: Leader of team, responsible for protecting the team and the process and keeping things going. Ensuring the relationship inside as well as outside the team 3. Team: dev, testers, writers and anyone else helping in developing the product. 3 Artifacts/Documents: 1. Product Backlog: PO create a prioritized list of features know as User Stories that could go into the product. This list evolves and changes priority with every sprint. 2. User Stories: Way of describing a feature set.  e.g., As a …………..(user)     I need ……bla bla….     So that ……reason…. 3. Sprint Backlog: The highest priority user stories go into the sprint backlog. These get estimated for size and are committed for the next sprint.  4. Burndown chart: Show the progress during the sprint. 3 Ceremonies: 1. Sprint Planning: Where PO, SM and team meet to ...

Shadow DOM

  What is Shadow DOM?? - How to deal with it in Selenium. - It allows hidden DOM trees to be attached to elements in the regular DOM tree - This shadow DOM tree starts with a shadow root, underneath which you can attach any element, in the same way as the normal DOM. Some terminology under shadow DOM - Shadow host: The regular DOM node that the shadow DOM is attached to. Shadow tree: The DOM tree inside the shadow DOM. Shadow boundary: the place where the shadow DOM ends, and the regular DOM begins. Shadow root: The root node of the shadow tree. In Selenium, JavaScript is used to access shadow element - WebElement shadowHost = driver.findElement(By.cssSelector(".shadowHost")); JavascriptExecutor jsDriver = (JavascriptExecutor) driver; WebElement shadowRoot = (WebElement) jsDriver.executeScript("return arguments[0].shadowRoot", shadowHost); WebElement shadowContent = shadowRoot.findElement(By.cssSelector(".shadowContent")); In Selenium 4 with Chromium brows...

𝗟𝗞ð—Ūð—ą 𝗕ð—Ūð—đð—Ūð—ŧ𝗰ð—ēð—ŋ 𝘃𝘀. ð—Ĩð—ē𝘃ð—ēð—ŋ𝘀ð—ē ð—Ģð—ŋ𝗞𝘅𝘆 𝘃𝘀. 𝗔ð—Ģ𝗜 𝗚ð—Ū𝘁ð—ē𝘄ð—Ū𝘆

What are the differences between a load balancer, a reverse proxy, and an API gateway? All three are used to optimise and manage web traffic. However, they vary in their function and use cases: A ð—đ𝗞ð—Ūð—ą ð—Ŋð—Ūð—đð—Ūð—ŧ𝗰ð—ēð—ŋ is a device that distributes incoming network traffic across multiple servers. The goal is to ensure that no single server is overwhelmed with traffic, which can lead to slow response times or even downtime. Load balancers are ideal for high-traffic websites or applications that need to handle a large volume of requests. A ð—ŋð—ē𝘃ð—ēð—ŋ𝘀ð—ē ð—―ð—ŋ𝗞𝘅𝘆, on the other hand, is a server that sits between the client and the webserver. The reverse proxy intercepts requests from clients and forwards them to the appropriate server. The reverse proxy can also cache frequently requested content, which can help improve performance and reduce server load. Reverse proxies are ideal for websites or applications that need to handle a large number of concurrent connections. An 𝗔ð—Ģ𝗜 ð—ī...