Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Looking for developers to team up with for future botting related projects

Featured Replies

I will no longer be accepting answers. Thanks for everyone who participated! I'm glad to hear a lot of people found it to be a fun learning experience :)

 

I'm sorry for the delay on the answers. I have been quite busy the past few days, and I'm hoping time frees up in the future. The developers I have chosen will be taking some courses I have designed (and might release in some form..) to ensure they are ready for what's to come!

 

Once again, thanks for the patience and participation. Great things are to come :)

____________________

Preface:

 

So I'm finally getting into the botting/scripting scene. I have quite a bit planned, and it would take quite a while to push these projects out without some help.

So I created a short quiz for anyone who may be interested in working with me on some projects. I don't expect all questions to be answered; this is more to get an idea of what you know. I don't mind teaching before bringing you on board, as long as you have a good view on programming already.

You can take this quiz even if you aren't interested in working on botting related projects with me.

Please send your answers to me in a private message, so others can't copy! A few of these questions may be googlable, so I expect an original answers in your own words. I've bee all up and down google, so don't try to be sneaky wink.png Positions are no longer available! Sorry!

 

Quiz (with answers):

1. What's an efficient way to measure elapsed time in Java? Why?

 

Anything independent of the system clock (such as System.nanoTime()) to prevent interferences while measuring time (manually changing the clock)

2. What's the difference between java.util.Timer and javax.swing.Timer?

 

swing.Timer executes on the Event Dispatch Thread. util.Timer executes on a background thread

3. Why do we use synchronization in multithreaded applications?

 

To ensure sequential memory ordering between a release and subsequent aquire of two locks, and to prevent thread interference

4. What is immutability? Give an original example of immutability

 

The inability to modify the state of something.

 

public final class ID {

     private final Picture picture;

     private final Date experation;

 

     public ID(Picture picture, Date experation) {

 

     }

 

     //no setters; prevent client from modifying

     //some immutable classes use setters like this:

     public ID changePicture(Picture picture) {

          return new ID(picture, experation);

     }

}

5. Java divides memory into 3 main sections. What are these sections and what purposes do they serve?

 

Thread Call Stacks - stores the frames of execution (in the form of methods) as well as local values.

 

Heap - stores objects and their instance values.

 

Metaspace - stores class data and static values

6. If you notice your application consuming a lot of memory due to short-lived object not being collected by the GC often, what do you do?

 

Tune your heap. In this case, shrink your young generation (more specifically, edan space)
 

7.

class Game implements KeyListener, MouseMotionListener {
    private Player player = new Player();
    private Dragon enemy = new Dragon();

    private boolean[] keys = new boolean[300];
    private Point mouseLocation = new Point(0, 0);

    public void update() {
        if(keys[KeyEvent.VK_UP])
player.move(Direction.NORTH);
        // handle other input events
    }

    public void keyPressed(KeyEvent e) {
        keys[e.getKeyCode()] = true;
    }

    public void keyReleased(KeyEvent e) {
        keys[e.getKeyCode()] = true;
    }

    public void keyTyped(KeyEvent e) {

    }

    public void mouseMoved(MouseEvent e) {
        mouseLocation = e.getPoint();
    }

    public void mouseEntered(MouseEvent e) {

    }

    public void mouseExited(MouseEvent e) {

    }
}

This code violates every SOLID principle. List how it violates each principle, and what can be done to fix it.

 

SRP - Has the responsibility of managing input, managing entities and managing game logic. Break down the responsibilities into their own objects (decomposition)

 

OCP - Requires modification of the class to update/add behavior to things like game logic and handling input. Create an abstraction and allow the client to specify different "strategies" rather than hardcoding systems into the class

 

LSP - Game is at risk of being extended upon, allowing the subclass to completely modify the behavior (by overriding critical methods like update, resulting in undesired results when we replace all instances of the base class Game with instances of it's subclasses). Either make the methods final, make the class final, or supply template methods that can't interfere with desired results if misused.

 

ISP - Forced to declare (but doesn't depend on) keyTyped, mouseEntered, mouseExited. Use KeyAdapter and MouseAdapter

 

DIP - The enemy is depending on a concrete type (Dragon) rather than an abstraction. Change the field type to something less concrete (Enemy)

8. What is the purpose of String interning, and when is it performed?

 

To prevent creating multiple String objects that contain the same character values. It's performed when using String literals or when you invoke String#intern()

9. Are Strings read in from an input stream interned?

 

No. They're transfered using bytes, then recreated into a String manually.

10. What's the difference between a blocking network server, a non blocking network server and an asynchronous network server?

 

Blocking halts a thread (blocks the thread) attempting to perform network operations until the operation is complete. Will wait if nothing is available (which is why it's considered blocking).

 

Non-blocking returns a null value if nothing is currently available, removing the need to block.

 

Asynchronous dispatches network operations (which may block) to "worker" threads (reusable threads)

11. When should you manually invoke System.gc()?

 

Never. It's a request which can be ignored, usually a sign of a "code smell"

12. List every form of object creation you know of.

 

The standard "new keyword followed by constructor call"

Reflection

Deserialization

Cloning

13. List some reasons why Singletons is now considered an anti-pattern.

 

Introduces global state and widely overused in places stronger design (such as dependency injection and aspect orientation) should be applied.

14. How do you properly terminate a Thread?

 

Let it "die gracefully". If it's continuous, create a (volatile) boolean which allows you to stop it from outside of the thread. If the thread is currently blocking, use interrupt().

15. Why are wildcard imports frowned upon?

 

The create ambiguity.

 

import javax.swing.Timer;

import java.util.Timer;

 

class MyClass {

     Timer timer; //swing or util?

}

16. volatile longs and double are "atomic". Why?

 

On 32 bit machines (or 64bit with compressed oops enabled), longs and doubles are 64bits long, which cannot fit in a 32bit register. It's split in 2, so we need to create a "happens before" relationship betwee the 2 registers when accessing ghe value.

17. What is double checked locking and when should it be used?

 

It's a form of synchronization that accounts for the possibility of 2 threads performing interleaved null-checks and variable assignments, accidentally generating a useless object (which gets dereferenced and replace with a new object immediately).

 

It should be used for lazy initialization in multithreaded environments. The "initialization on demand" idiom is a lot cleaner and should be preferred.

18. What's the difference between a programmer, a developer and a computer scientist?

 

Programmers understand the syntax of the language, such as specifications (conditionals, loops, objects) but do not fully understand the best use-cases for the specifications; they lack design skills.

 

Developers understand how to create structured environments. They tend to use tools like UMLs and flow charts to help guide design.

 

Computer scientists are the philosophers of the conputer world, setting the standards and conventions we use today. They are the innovators, which tries to improve things from how to manage things better at a transistor level, and how to manage things better at a source level (although the latter is rarer, they are the ones who brought us design patterns and philosophies like "Tell, don't ask!")

19. A programmer asks you "I need to get the location of the mouse without GUI. How do I do so?" What would you answer with?

 

You would need to either access the mouse natively through JNI (or use a third party API like JNativeHook) or simply use MouseInfo.getPointerInfo().getLocation()

 

20. What is a cross-cutting concern? How should you handle them?

 

An aspect of programming that applies to all other aspects, which results in coupling irrelevant things (such as Logging, which applies just about everywhere). You should handle them using aspect orientation; Java has frameworks like AspectJ which guides this task

21. What is delta timing?

 

Measuring responsiveness while measuring elapsed time. Accounts for possible delays and spare time in the current frame, which affects the next to reduce latency

22. Lambdas were intended to replace anonymous classes when working with functional interfaces. Some say it's nothing more than syntactic sugar. Is that true?

 

No. Lambdas use method handles under the hood, rather than declaring a new class and instantiating it.

23. What's the purpose of method references?

 

To lower the verbosity of lambda expressions that perform 1 function call. 

 

24. Primitive types are not allowed to be specified for generic type parameters. Some developers choose to use primitive wrapper types to get around this. What should you be aware of when using primitive wrapper types?

 

Autoboxing and unboxing
 

25.

List<String> list = new ArrayList<>();
list.add("hey");

for(String string : list) {
    list.remove(string);
}

The code above throws a ConcurrentModificationException. Why? What can you do to fix this?

 

It's modifying the collection directly while it's being iterated over. To avoid this, use a non fail-fast iterator or modify the collection using the iterator (not directly)

26. It's possible for a ClassCastException to occur when initializing a variable with an object that derived from the same class:

class MyType {

}

class OtherClass {
    public MyType get() {
        return new MyType();
    }
}

MyType type = OtherClass.get(); //ClassCastException

What could possibly cause this?

 

MyType in class Main was loaded by a different classloader than MyType in OtherClass.get(). Types must be loaded by thensame classloader to be identical

 

27. What are compressed oops

 

An optimization technique which involves shrinking the size of oops (ordinary object pointers) to 32bit for 64bit machines. Since Java 7, this is enabled by default.

Once again, I do not expect you to answer them all. But the more you can answer the better. All profits made would be split equally based on your impact on the project, and will be fully credited for anything you do.

Please do not post your answers here so people can't copy; send them to me in a message! Good luck!

Edited by fixthissite

Once you are done gathering fellow developers, you should release the answers. To be completely honest with you, I'm not good with remembering terms and would probably only be able to answer 5 of these off the top of my head.

 

  • Author

Once you are done gathering fellow developers, you should release the answers. To be completely honest with you, I'm not good with remembering terms and would probably only be able to answer 5 of these off the top of my head.

That is my plan :) Hopefully this could be a learning experience as well.

 

Don't feel discouraged to take the quiz. Even if you can only answer 5, depending on the questions you answered and the answer given, you might still have a good philosophical view on programming, which is enough to get me WANTING to teach you this stuff. No one else will see your answers, and I will not mention anything of your skill to anyone else; completely confidental! 

  • Author

good luck finding someone to answer those questions

I understand a lot of these questions are pretty advanced. The advanced questions are there to hopefully spot out the more knowledgable developers in the community. I don't expect scripters to know EVERY answer. Even less than half would be acceptable. As long as you know SOME of the answers, I'm sure I'll be able to easily snswer the rest for you.

This will help me get an idea of your view on programming. Even if you answer questions incorrect, your reasoning for your answer could still be impressive, thus showing me you have a good philosophical view on programming

that are a lot of questions for not knowing what you're signing up for.

It's to partner up with me on future botting related projects. Whether or not you feel the quiz is worth partnering up with me is your belief. As for the projects I have planned, I'd prefer only to unveil them to developers who have a good programming mind-set; would rather not waste the time explaining things to someone who may not fully understand

Edited by fixthissite

Looks like fun :E, am gonna try answering

 

EDIT: nuuu don't look at muh answers

Edited by FrostBug

  • Author

Looks like fun :E, am gonna try answering

Great! smile.png Don't let any of the questions discourage you; I'm not judgemental at all. I respect trying over not trying anyday (as long as no one gets hurt..).

 

I'm actually hoping developers who don't understand these topics look into them. I never said you couldn't use google, as long as you actually understand it, explaining it in your own words. It's easy to tell when someone actually knows something, and when they only know of it, especially when they get out on the field ;)

Edited by fixthissite

Yeah I think its about time I go read over my programming textbooks again.

  • Author

Yeah I think its about time I go read over my programming textbooks again.

Feel free to research every question independently :) As long as you understand it, then you'll be good. I'm not looking for people who already know this stuff (although that would be nice, it would be rare on here), rather than people who are willing to learn and able to learn independently; I don't wanna be holding hands through-out projects if you catch my drift.

As I've informed others, just give it your best. If you feel you aren't knowledable enough, I will tell you the answers after so you can look into it if you're interested. This could be a learning experience.

All I'm looking for is people who know this stuff, whether it be they know it now or they know it after researching the questions in this post. It's easy to tell when someone is BSing once they get out on the field, so feel free to get as familiar as you want with these topics now, possibly fill out the questionaire tomorrow or the day after (or however long it takes you to familiarize yourself with a lot of this stuff; doesn't even gotta be all of it. Like I said, I don't mind teaching as long as it's not EVERYTHING)

Looks like fun :E, am gonna try answering

delta timing is probably.. exactly what it sounds like :doge: ? The same as Question #1

Could you please send this is a message so other's don't get an easy "quick fix" lesson? I guess it's not THAT big of a problem, since people can just google.. But i'd rather them have the experience of looking, possibly stumbling across something else that may spark their interest :) Also, I can easily reply, going over any answers you may have gotten wrong without switching back and fourth from messages to this thread

Edited by fixthissite

Most people on here aren't that professional programmers, anyways good luck finding a team :)

  • Author

Most people on here aren't that professional programmers, anyways good luck finding a team :)

Don't worry, I'm aware. But Google is one hell of a tool. If they can look into it and explain it in their own words, there's hope. I do not discourage looking into the questions (I actually encourage it). This is not to see how much you know right now, rather than how eager you are to proceed.

Feel free to give it a try! All answers are confidential, and you will be given the correct answers afterwards (for learning purposes). Although the amount of answers you get correct do impact my decision, it's due to the low amount of right answers reflecting your ability to gather data, which is definitely something I'm not fond of. If you can't look into the subjects, then you probably won't qualify.

Believe it or not, I've actually received some excellent answers. Although some questions go unanswered, that's perfectly fine with me (as mentioned in the original post). I hope anyone who is interested in programming will give this a shot! That way, I can give correct answers in context to your other answers (or possible misunderstandings). I will be releasing the answers on Monday, but that will not compare to the 1 on 1 answers you could get by filling out the quiz in a private message! :)

25.

// infer generics doesn't throw error but most compilers throw warnings.
List<String> list = new ArrayList<String>(),removeList = new ArrayList<String>();
list.add("hey");

for(String string : list) {
    // list.remove(string) throws exception because you can't remove while iterating through a list unless your using an iterator.
    removeList.add(string);
}
// fix to make a new list and remove y collection from x list.
list.remove(removeList);
 

also in java 8 api under collections there is a new method that is called removeIf and with a interface with a boolean to check what object to return.

 

 

your not going to get good java developers that can answer all these questions for cheap huehue.

 

  • Author

your not going to get good java developers that can answer all these questions for cheap huehue.

I didn't say anything about "cheap", nor do I expect anyone to be able to answer ALL these questions. Please check out my other posts. I have explained this a few times already.

If you want to take the quiz, please send me your answers in a private message. Although I encourage devs to research, I don't want devs getting all the info basically handed to them in a neatly formatted post :P Hope you understand, and I hope to see an attempt! :)

Edited by fixthissite

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.