- 2022-02-12: Limiting factor in playing an arcade style space shooter via sensors and a hooked up keyboard.
- 2022-02-05: Does the time taken to count integers (that are less than a threshold) in an unordered array, remain the same, or vary?
- 2022-01-29: Does splitting a service into microservices help or hurt the availability?
- 2022-01-22: Can closures+lambdas be implemented irrespective of whether the language is garbage collected?
- 2022-01-15: Debugger crashed before a breakpoint was hit. What happens to the program being debugged?
- 2022-01-08: No puzzle on account of my travels
- 2022-01-01: Relative CPU performance of a process b/w native vs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
┌──────────────────────────────┬────────────────────┬─────────────────────────────────────────────────┐ | |
│ Question │ Attr Params │ Sample Args │ | |
├──────────────────────────────┼────────────────────┼─────────────────────────────────────────────────┤ | |
│ Last n Days spend for card │ card,Day1-Day n │ card#ABCD,(Day-2021-09-05,Day-2021-08-30) │ | |
│ Last 4 Weeks spend for user │ user,Week 1-Week 7 │ user#1234,(Week-2021-36,Week-2021-33) │ | |
│ Total spend for organization │ org,Total │ org#12AB,(Total) │ | |
│ Monthwise Purchase for Team │ team,Month │ org#12AB#team#22,(Month-2021-06, Month-2021-02) │ | |
└──────────────────────────────┴────────────────────┴─────────────────────────────────────────────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package co.in.shoonya.abc.prep.ds.lists; | |
import co.in.shoonya.abc.prep.ds.lists.ds.ListNode; | |
public class AggregateAtZeroNode { | |
public static void main(String[] args) { | |
ListNode<Integer> l1 = new ListNode<Integer>(1); | |
l1.setNext(new ListNode<Integer>(4)); | |
l1.getNext().setNext(new ListNode<Integer>(0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package co.in.shoonya.abc.kata; | |
public class CdkShoppingCart { | |
public static void main(String[] args) { | |
System.out.println(billAmount(CustomerType.Regular, 15000d)); | |
System.out.println(billAmount(CustomerType.Premium, 20000d)); | |
} | |
private static double billAmount(CustomerType type, double input) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package co.in.shoonya.abc.prep.ds.classic.strings; | |
// Given a string of characters (a, b, c,....z), we want to break the string into a maximum number of substrings | |
// in which every character comes in only one substring. We have to return length of all substrings. | |
// Ex 1: Input string = "abcdefgahijklhopqrsot" | |
// Output = [8, 5, 6, 1] | |
// Ex 2: Input string = "abcd" | |
// Output = [1, 1, 1, 1] | |
import java.util.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Set; | |
public class GridQuestion { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<speak> All good except 2 escalations. <break time=“1s”/> We had 5 new deployments and have new release coming this Friday</speak> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"address":{"street":"Oude Ebbingestraat","housenumber":"12","postalcode":"9712 HJ","city":"Groningen","geoLocation":{"lat":"53.219319","lng":"6.56671"}},"distance":0,"type":"ING"},{"address":{"street":"Amsterdamsestraat","housenumber":"9","postalcode":"2587 CN","city":"Den Haag","geoLocation":{"lat":"52.111805","lng":"4.287714"}},"distance":0,"type":"ING"},{"address":{"street":"Oudenoord","housenumber":"1","postalcode":"3513 EG","city":"Utrecht","geoLocation":{"lat":"52.0970886","lng":"5.1133961"}},"distance":0,"type":"ING"},{"address":{"street":"Bloemenoordplein","housenumber":"50","postalcode":"5143 TC","city":"Waalwijk","geoLocation":{"lat":"51.6823433","lng":"5.0782567"}},"distance":0,"type":"ING"},{"address":{"street":"Dorpsstraat","housenumber":"2","postalcode":"2361 BB","city":"Warmond","geoLocation":{"lat":"52.195528","lng":"4.502244"}},"distance":0,"type":"ING"},{"address":{"street":"Waalderstraat","housenumber":"48","postalcode":"1791 EC","city":"Den Burg","geoLocation":{"lat":"53.056402","lng":"4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chapter 4: Expressions and Simple functions | |
=========================================================================================================================== | |
There are 2 types of expressions. | |
1. def x = 5 | |
2. val x = 5 | |
Here # 1 represens definition and expression is at the right hand side of the = sign. It is not evaluated immediately. | |
Here # 2 represents value expression and its value is evaluated immediately and whenver val is being used; it replaces | |
it with pre-computed value of expression. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ResultSeProcessor extends CamelProcessor<MyJPAEntity> | |
{ | |
public void process(Exchange exchange) throws Exception | |
{ | |
process(exchange, getRowMapper()); | |
} | |
private static ResultMapper<MyJPAEntity> getRowMapper() | |
{ | |
ResultMapper<MyJPAEntity> mapper = new ResultMapper<MyJPAEntity>() |
NewerOlder